/* ==========================================================================
   Medistar Healthcare - Notice & Announcement Popup Modal
   Supports 6 Design Presets & Image-Only Mode
   Matches Reference Mockups with Full Responsiveness
   ========================================================================== */

/* Modal Backdrop */
.medistar-popup-backdrop {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(14, 31, 56, 0.72) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 99999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
}

.medistar-popup-backdrop.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Modal Window */
.medistar-popup-card {
  position: relative;
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 25px 60px rgba(14, 31, 56, 0.3), 0 4px 20px rgba(0, 0, 0, 0.12);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  margin: auto !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.8);
  z-index: 100000000;
}

.medistar-popup-backdrop.active .medistar-popup-card {
  transform: scale(1) translateY(0);
}

.medistar-popup-preview-card {
  position: relative;
  background: #ffffff;
  border-radius: 26px;
  box-shadow: 0 16px 40px rgba(14, 31, 56, 0.18);
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.preview-wrapper.is-desktop .medistar-popup-preview-card {
  max-width: 680px;
}

.preview-wrapper.is-tablet .medistar-popup-preview-card {
  max-width: 520px;
}

.preview-wrapper.is-mobile .medistar-popup-preview-card {
  max-width: 375px;
}

/* Close Button (X) */
.medistar-popup-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.medistar-popup-close:hover {
  background: #026fe8;
  color: #ffffff;
  border-color: #026fe8;
  transform: rotate(90deg);
}

/* Popup Content Wrapper */
.medistar-popup-inner {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}

/* --------------------------------------------------------------------------
   Template Layouts: Split Grid (Left Text, Right Media)
   -------------------------------------------------------------------------- */
.popup-split-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  padding: 36px 36px 20px;
  position: relative;
  min-height: 380px;
}

.popup-left-col {
  padding-right: 18px;
  z-index: 2;
}

.popup-right-col {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

/* Pill Badges */
.popup-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.popup-badge.badge-blue {
  background: #eaf3fe;
  color: #026fe8;
  border: 1px solid rgba(2, 111, 232, 0.15);
}

.popup-badge.badge-orange {
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid rgba(234, 88, 12, 0.18);
}

.popup-badge.badge-red {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.18);
}

.popup-badge.badge-purple {
  background: #faf5ff;
  color: #9333ea;
  border: 1px solid rgba(147, 51, 234, 0.18);
}

.popup-badge.badge-green {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.18);
}

/* Typography */
.popup-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.85rem;
  font-weight: 800;
  color: #0e1f38;
  line-height: 1.22;
  margin-bottom: 10px;
  letter-spacing: -0.015em;
}

.popup-desc {
  font-size: 0.92rem;
  color: #556987;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Primary Pill CTA Button */
.popup-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #026fe8;
  color: #ffffff !important;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(2, 111, 232, 0.28);
  transition: all 0.25s ease;
  border: none;
  cursor: pointer;
}

.popup-cta-btn:hover {
  background: #005bc5;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(2, 111, 232, 0.36);
}

.popup-cta-btn.full-width {
  width: 100%;
  justify-content: center;
}

.popup-cta-btn.btn-red {
  background: #dc2626;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.28);
}

.popup-cta-btn.btn-red:hover {
  background: #b91c1c;
}

/* Right Media Visuals */
.popup-media-frame {
  position: relative;
  width: 100%;
  max-width: 270px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  overflow: hidden;
}

.popup-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(14, 31, 56, 0.12);
  display: block;
}

/* Template 1 Specifics (Cardiology) */
.template-cardiology {
  background: radial-gradient(circle at 90% 40%, #eef7ff 0%, #ffffff 65%);
}

/* Template 2 Specifics (Health Camp) */
.template-health_camp,
.template-camp {
  background: radial-gradient(circle at 90% 30%, #fff7ed 0%, #ffffff 65%);
}

.camp-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #334155;
  margin-bottom: 6px;
  font-weight: 600;
}

.camp-info-row svg {
  color: #ea580c;
  flex-shrink: 0;
}

.camp-features-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0 20px;
  text-align: center;
}

.camp-feat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.camp-feat-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #026fe8;
}

.camp-feat-pill span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  line-height: 1.2;
}

/* Template 3 Specifics (Ambulance) */
.template-ambulance {
  background: radial-gradient(circle at 90% 30%, #fff1f2 0%, #ffffff 65%);
}

.ambulance-hotline-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #dc2626;
  color: #ffffff !important;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.35rem;
  font-weight: 800;
  padding: 12px 24px;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
  margin-bottom: 20px;
  transition: all 0.25s ease;
}

.ambulance-hotline-btn:hover {
  background: #b91c1c;
  transform: translateY(-2px);
}

.ambulance-features-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.amb-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.amb-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fef2f2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
}

.amb-pill span {
  font-size: 0.70rem;
  font-weight: 700;
  color: #475569;
  line-height: 1.2;
}

/* Template 4 Specifics (Vaccination) */
.template-vaccination,
.template-vaccine {
  background: radial-gradient(circle at 90% 30%, #f0fdf4 0%, #ffffff 65%);
}

.vaccine-bullet-list {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vaccine-bullet-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.vaccine-bullet-list li svg {
  color: #026fe8;
  flex-shrink: 0;
}

.floating-shield-badge {
  position: absolute;
  top: 14px;
  left: -14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  color: #026fe8;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(2, 111, 232, 0.18);
  border: 2px solid #e0f2fe;
}

/* Template 5 Specifics (Neurology) */
.template-neurology {
  background: radial-gradient(circle at 90% 30%, #e0f2fe 0%, #ffffff 65%);
}

.neurology-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0 22px;
}

.neuro-chip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.neuro-chip:hover {
  background: #ffffff;
  border-color: #026fe8;
  transform: translateY(-2px);
}

.neuro-chip svg {
  color: #026fe8;
}

.neuro-chip span {
  font-size: 0.68rem;
  font-weight: 700;
  color: #334155;
  line-height: 1.2;
}

/* Template 6 Specifics (Dashain / Festive) */
.template-dashain {
  background: radial-gradient(circle at 90% 30%, #fffbeb 0%, #ffffff 65%);
}

/* Image-Only Banner Mode */
.popup-image-only-layout {
  position: relative;
  width: 100%;
}

.popup-banner-link {
  display: block;
  text-decoration: none;
}

.popup-banner-full-img {
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: cover;
  display: block;
}

/* Don't show this again footer bar */
.popup-footer-bar {
  padding: 12px 36px 18px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.popup-dismiss-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #64748b;
  cursor: pointer;
  user-select: none;
}

.popup-dismiss-label input {
  accent-color: #026fe8;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Responsive Mobile Breakpoint
   -------------------------------------------------------------------------- */
@media (max-width: 680px) {
  .medistar-popup-card {
    border-radius: 20px;
    max-width: 95vw;
  }

  .popup-split-layout {
    grid-template-columns: 1fr;
    padding: 30px 20px 16px;
    gap: 20px;
  }

  .popup-left-col {
    padding-right: 0;
    text-align: center;
  }

  .popup-badge {
    margin-left: auto;
    margin-right: auto;
  }

  .popup-title {
    font-size: 1.45rem;
  }

  .popup-desc {
    font-size: 0.88rem;
    margin-bottom: 16px;
  }

  .popup-media-frame {
    max-width: 100%;
    height: 200px;
  }

  .camp-features-row,
  .ambulance-features-strip,
  .neurology-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .popup-footer-bar {
    padding: 10px 20px 14px;
    justify-content: center;
  }
}
