/* Illinois Conservatory for the Arts - Hero Popup Styles */


/* Universal box-sizing to prevent padding overflow issues */
* {
  box-sizing: border-box;
}

@layer base {
  :root {
    --ease: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Hero Popup Specific Variables */
    --hero-popup-bg: #1E312F;
    --hero-popup-text: var(--ica-bg);
    --hero-popup-accent: var(--ica-lime);
    --hero-popup-border: #F0F0F5;
    --hero-popup-shadow: 0 20px 60px rgba(3, 51, 46, 0.3);
    
    /* Spacing Variables */
    --hero-spacing-xs: 0.5rem;
    --hero-spacing-sm: 0.75rem;
    --hero-spacing-md: 1rem;
    --hero-spacing-lg: 1.5rem;
    --hero-spacing-xl: 2rem;
    
    /* Border Radius Variables */
    --hero-radius-sm: 4px;
    --hero-radius-md: 8px;
    --hero-radius-lg: 12px;
    --hero-radius-full: 50%;
    
    /* Z-Index Variables */
    --hero-z-modal: 9999;
    --hero-z-close: 10;
    --hero-z-loading: 10;
    
    /* Other variables are already defined in style.css */
  }
}

.hero-popup-modal .hero-popup-header {
  padding: 1.5rem 1.5rem 1rem !important;
  text-align: center !important;
  border-bottom: 1px solid rgba(249, 246, 244, 0.1) !important;
  flex-shrink: 0 !important;
}


/* Base content area styles - shared by all content areas */
.hero-popup-content-area {
  padding: var(--hero-spacing-md) var(--hero-spacing-lg) var(--hero-spacing-lg) !important;
  flex: 1 !important;
  flex-direction: column !important;
  min-height: 0 !important;
  position: relative !important;
}

/* Modal-specific content area with centered content */
.hero-popup-modal .hero-popup-content-area {
  justify-content: center !important;
  overflow: hidden !important;
}
/* ========================================
   HERO POPUP MODAL STYLES
   ======================================== */
@layer components {
  .hero-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity var(--ease), visibility var(--ease);
    /* Core Web Vitals optimizations */
    will-change: opacity, visibility;
    contain: layout style paint;
    /* Ensure proper centering */
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Prevent flash during page load */
    z-index: -1;
  }


  .hero-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(3, 51, 46, 0.8);
    backdrop-filter: blur(4px);
  }

  /* Active state - makes popup visible */
  .hero-popup-modal.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
  }

  .hero-popup-content {
    /* Prevent any positioning shifts */
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.9) !important;
    /* Ensure consistent dimensions */
    max-width: 900px;
    width: 95vw;
    height: 85vh;
    max-height: 85vh;
    /* Restore styling */
    background: var(--hero-popup-bg) !important;
    background-color: var(--hero-popup-bg) !important;
    border: 1px solid var(--hero-popup-border) !important;
    border-radius: var(--hero-radius-lg);
    box-shadow: var(--hero-popup-shadow);
    overflow: hidden;
    transition: transform var(--ease);
    animation: promoModalSlideIn 0.3s ease-out;
    /* Ensure consistent centering */
    margin: 0;
    left: 50% !important;
    top: 50% !important;
    transform-origin: center center;
    /* Ensure proper scrolling */
    display: flex;
    flex-direction: column;
  }

  /* Responsive width for screens above 600px */
  @media (min-width: 600px) {
    .hero-popup-content {
      max-width: 500px !important;
      width: 90vw !important;
    }
  }



  @keyframes promoModalSlideIn {
    from {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.9);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }

  .hero-popup-close {
    position: absolute !important;
    top: var(--hero-spacing-md) !important;
    right: var(--hero-spacing-md) !important;
    background: none !important;
    border: 2px solid var(--hero-popup-accent) !important;
    cursor: pointer !important;
    padding: var(--hero-spacing-sm) !important;
    border-radius: var(--hero-radius-full) !important;
    transition: all var(--ease) !important;
    z-index: var(--hero-z-close) !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
  }

  .hero-popup-close:hover {
    background-color: var(--ica-lime);
    color: var(--ica-green-deep);
    transform: scale(1.1);
  }

  .promo-close-icon {
    width: 20px;
    height: 20px;
    display: block;
    filter: brightness(0) invert(1);
    color: white !important;
  }

  /* Force close button content to be white */
  .hero-popup-close * {
    color: white !important;
    fill: white !important;
  }

  .hero-popup-close svg {
    fill: white !important;
    color: white !important;
  }

  /* Force all close button content to be white */
  .hero-popup-close::before,
  .hero-popup-close::after {
    color: white !important;
  }

  /* Override any inherited colors */
  .hero-popup-close,
  .hero-popup-close *,
  .hero-popup-close svg,
  .hero-popup-close svg * {
    color: white !important;
    fill: white !important;
    stroke: white !important;
  }

  .hero-popup-body {
    padding: 0 !important;
    color: var(--ica-bg) !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important;
    /* Ensure proper flex layout */
    flex: 1;
    min-height: 0;
    /* Enable scrolling for long content */
    max-height: 100%;
  }

  .hero-popup-image {
    height: auto;
    overflow: hidden;
    max-height: 35vh;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
    flex-shrink: 0;
    padding: 1rem 2rem 0 2rem;
  }

  /* Hide empty image and header divs to prevent spacing issues */
  .hero-popup-image:empty,
  .hero-popup-header:empty {
    display: none !important;
  }

  /* Also hide divs that only contain whitespace */
  .hero-popup-image:not(:has(*)),
  .hero-popup-header:not(:has(*)) {
    min-height: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .hero-popup-hero-image {
    margin-top: 20px;
    width: 80%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 30vh;
    min-height: 150px;
    max-width: 100%;
    /* Ensure responsive behavior */
    aspect-ratio: auto;
  }



  .hero-popup-title {
    font-family: "Termina", var(--font-ui), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--ica-lime) !important;
    margin: 0 0 0.75rem !important;
    line-height: 1.3 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  }

  .hero-popup-subtitle {
    font-family: var(--font-body) !important;
    text-transform: uppercase !important;
    font-size: 1.2rem;
    color: var(--ica-bg) !important;
    margin: 0 !important;
    line-height: 1.6 !important;
    opacity: 0.95 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  }

  /* Content area now uses base styles above with scrollable override */
  .hero-popup-content-area {
    justify-content: flex-start !important;
    overflow: auto !important;
    /* Ensure proper scrolling */
    scrollbar-width: thin;
    scrollbar-color: var(--ica-lime) transparent;
  }

  /* Custom scrollbar for webkit browsers */
  .hero-popup-content-area::-webkit-scrollbar {
    width: 6px;
  }

  .hero-popup-content-area::-webkit-scrollbar-track {
    background: transparent;
  }

  .hero-popup-content-area::-webkit-scrollbar-thumb {
    background: var(--ica-lime);
    border-radius: 3px;
  }

  .hero-popup-content-area::-webkit-scrollbar-thumb:hover {
    background: var(--ica-mint);
  }


  /* Top section container */
  .hero-popup-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
  }

  /* Script content container */
  .hero-popup-script {
    width: 100%;
    flex: 1;
    position: relative;
    overflow: auto;
    /* Enable scrolling for form content */
    scrollbar-width: thin;
    /* Center content vertically and horizontally */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }

  /* Unified loading dots styling for all containers */
  .promo-form-loading-dots {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--hero-spacing-md);
    padding: var(--hero-spacing-xl);
    color: var(--hero-popup-text);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: var(--hero-z-loading);
    text-align: center;
    opacity: 0.7;
    transition: opacity 0.5s ease;
  }
  
  /* Unified loading text styling */
  .promo-loading-text {
    font-size: 1rem;
    color: var(--hero-popup-text);
    font-weight: 500;
    margin-bottom: var(--hero-spacing-xs);
    display: block;
  }
  
  /* Unified loading dots container styling */
  .promo-loading-dots-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }

  /* Hide loading dots when form is loaded */
  .loaded .promo-form-loading-dots {
    display: none;
  }

  /* Fade-out state triggered by JS right before removal */
  .promo-form-loading-dots.is-fading-out {
    opacity: 0;
  }

  /* Error Message Styles */
  .hero-error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--ica-bg);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin: 1rem;
    font-family: var(--font-ui);
  }

  .hero-error-title {
    font-size: 1.2rem !important;
    margin-bottom: 1rem;
    color: var(--ica-lime) !important;
    font-family: var(--font-ui) !important;
  }

  .hero-error-message-text {
    margin-bottom: 1rem;
    font-family: var(--font-ui);
  }

  .hero-error-button {
    font-size: 1rem !important;
    background: var(--ica-lavender);
    color: var(--ica-green-deep,#1E312F) !important;
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 0.75rem;
    font-family: var(--font-ui);
    transition: var(--ease);
  }

  .hero-error-button:hover {
    opacity: 0.8;
  }

  .hero-error-contact {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.8;
    opacity: 0.95;
    font-family: var(--font-ui);
  }

  .hero-error-contact > div {
    margin-bottom: 0.5rem;
  }

  .hero-error-contact > div:last-child {
    margin-bottom: 0;
  }

  .hero-error-link {
    color: var(--ica-lime) !important;
    text-decoration: underline;
    transition: var(--ease);
  }

  .hero-error-link:hover {
    color: var(--ica-lavender) !important;
  }

  /* Hero Form Specific Styles */
  #promo-spot-availability-form {
    width: 100%;
    height: 100%;
    min-height: 200px;
    flex: 1;
    position: relative;
    overflow: auto;
    /* Enable scrolling for form content */
    scrollbar-width: thin;
  }

  /* Center container only; do not override inner form styles */
  /* (Avoid touching Ontraport's internal CSS) */

  /* Only target our own loading elements, not Ontraport's content */
  
  /* Loading dots now use unified styles above */


  .promo-loading-dot {
    width: 8px;
    height: 8px;
    background-color: var(--ica-lime);
    border-radius: 50%;
    animation: promoLoadingDots 1.4s infinite ease-in-out both;
  }

  .promo-loading-dot:nth-child(1) {
    animation-delay: -0.32s;
  }

  .promo-loading-dot:nth-child(2) {
    animation-delay: -0.16s;
  }

  .promo-loading-dot:nth-child(3) {
    animation-delay: 0s;
  }

  @keyframes promoLoadingDots {
    0%, 80%, 100% {
      transform: scale(0);
      opacity: 0.5;
    }
    40% {
      transform: scale(1);
      opacity: 1;
    }
  }

  /* Hide/fade styles now use unified styles above */

  /* Remove overrides targeting Ontraport-specific selectors */

  /* Custom scrollbar for form container */
  #promo-spot-availability-form::-webkit-scrollbar {
    width: 6px;
  }

  #promo-spot-availability-form::-webkit-scrollbar-track {
    background: transparent;
  }

  #promo-spot-availability-form::-webkit-scrollbar-thumb {
    background: var(--ica-lime);
    border-radius: 3px;
  }

  #promo-spot-availability-form::-webkit-scrollbar-thumb:hover {
    background: var(--ica-mint);
  }

  /* No styling on Ontraport iframes - let them use their own CSS */
}

/* ========================================
   HERO POPUP RESPONSIVE STYLES
   ======================================== */

/* Desktop (1025px and above) */
@media (min-width: 1025px) {
  .hero-popup-content {
    max-width: 900px;
    width: 90vw;
    height: 87vh;
    max-height: 87vh;
  }

  .hero-popup-hero-image {
    
    max-height: 120px;
    min-height: 100px;
  }

  .hero-popup-title {
    font-size: 1.5rem;
  }

  .hero-popup-subtitle {
    font-size: 1.1rem;
  }

  .hero-popup-header {
    padding: 2rem 1.5rem 1.5rem;
  }

  .hero-popup-content-area {
    padding: 1.5rem 2rem 2rem;
  }
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 768px) {
  .hero-popup-content {
    max-width: 700px;
    width: 92vw;
    height: 87vh;
    max-height: 87vh;
  }

  .hero-popup-hero-image {

    max-height: 120px;
    min-height: 100px;
  }

  .hero-popup-title {
    font-size: 1.3rem;
  }

  .hero-popup-subtitle {
    font-size: 1rem;
  }

  .hero-popup-header {
    padding: 1.5rem 1.5rem 1rem;
  }

  .hero-popup-content-area {
    padding: 1rem 1.5rem 1.5rem;
  }
}

/* Mobile Large (481px - 767px) */
@media (max-width: 767px) and (min-width: 481px) {
  .hero-popup-content {
    max-width: 95vw;
    width: 95vw;
    height: 87vh;
    max-height: 87vh;
    border-radius: 8px;
  }

  .hero-popup-hero-image {
    max-height: 120px;
    min-height: 100px;
    margin-top: 20px;
  }

  .hero-popup-title {
    font-size: 1.2rem;
    line-height: 1.2;
  }

  .hero-popup-subtitle {
    font-size: 16px !important;
    line-height: 1.3;
  }

  .hero-popup-header {
    padding: 1rem 1.2rem 0.75rem;
  }

  .hero-popup-content-area {
    padding: 0.75rem 1rem 1rem;
  }

  .hero-popup-close {
    top: 0.75rem !important;
    right: 0.75rem !important;
    padding: 0.5rem !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }

  .promo-close-icon {
    width: 18px;
    height: 18px;
  }
}

/* Mobile Small (320px - 480px) */
@media (max-width: 480px) {
  .hero-popup-content {
    max-width: 99vw;
    width: 99vw;
    height: 90vh;
    max-height: 87vh;
    border-radius: 6px;
  }

  .hero-popup-hero-image {
    max-height: 120px;
    min-height: 100px;
    margin-top: 15px;
  }

  .hero-popup-title {
    font-size: 1.1rem;
    line-height: 1.2;
    margin: 0 0 0.5rem;
  }

  .hero-popup-subtitle {
    font-size: 14px;
    line-height: 1.3;
  }

  .hero-popup-header {
    padding: 0.75rem 1.0rem 0.5rem;
  }

  .hero-popup-content-area {
    padding: 0.5rem 0.75rem 0.75rem;
  }

  .hero-popup-close {
    top: 0.5rem !important;
    right: 0.5rem !important;
    padding: 0.4rem !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }

  .promo-close-icon {
    width: 16px;
    height: 16px;
  }

  /* Ensure iframe content is properly sized */
  /* No styling on Ontraport iframes - let them use their own CSS */
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-popup-content {
    height: 87vh;
    max-height: 87vh;
  }

  .hero-popup-hero-image {
    max-height: 120px;
    min-height: 100px;
    margin-top: 10px;
  }

  .hero-popup-header {
    padding: 0.75rem 1.2rem 0.5rem;
  }

  .hero-popup-content-area {
    padding: 0.5rem 1rem 0.75rem;
  }
}


/* ========================================
   ACCESSIBILITY & FOCUS STYLES
   ======================================== */
.hero-popup-close:focus {
  outline: 2px solid var(--ica-lime) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(198, 214, 43, 0.3) !important;
}



/* Prevent body scroll when hero popup is open */
body.popup-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  top: 0 !important;
  left: 0 !important;
}

