/* ===== School Interest List Popup Styles ===== */
/**
 * Shared School Interest Popup Component Styles
 * 
 * This CSS file provides styling for the Illinois Conservatory for the Arts
 * school interest list popup component. This is a reusable component that can
 * be included on any page where users need to join the interest list for
 * ICA's K-12 day school pilot program.
 * 
 * Component Features:
 * - Responsive modal popup with smooth animations
 * - Accessible design with focus management
 * - Loading states and progress indicators
 * - Mobile-optimized layout
 * - Print-friendly styles
 * - Reduced motion support for accessibility
 * 
 * Usage: Include this CSS file on any page that uses the school interest popup
 * 
 * @package Illinois_Conservatory
 * @version 1.0.0
 * @author ICA Development Team
 */

/* Popup Modal Base */
.school-interest-popup-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  contain: layout style paint;
  will-change: opacity, visibility;
  overscroll-behavior: contain;
  touch-action: none;
}

/* Popup Overlay */
.school-interest-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

/* Popup Content Container */
.school-interest-popup-content {
  margin-top: 10vh;
  position: relative;
  background: var(--ica-white);
  border-radius: 12px;
  width: 95vw;
  max-width: 600px;
  min-height: 70vh;
  max-height: 90vh;
  overflow: hidden; /* header sticks; content area scrolls */
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  contain: layout style;
  will-change: transform;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
}

.school-interest-popup-modal[style*="opacity: 1"] .school-interest-popup-content {
  transform: scale(1);
}

/* Close Button */
.school-interest-popup-close {
  position: absolute;
  top: 30px;
  right: 1rem;
  background: none;
  border: 1px solid var(--ica-green-deep);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background-color 0.2s ease;
  color: #6b7280;
  line-height: 1;
  z-index: 1002;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.school-interest-popup-close:hover {
  background-color: var(--ica-lime);
  color: var(--ica-green-deep);
}

.school-interest-close-icon {
  width: 24px;
  height: 24px;
}

/* Popup Body */
.school-interest-popup-body {
  padding: 2rem;
  min-height: 70vh;
  text-align: center;
  display: flex;
  flex-direction: column;
}

/* Sticky Header (logos + content) */
.school-interest-sticky-header {
  position: sticky;
  top: 0;
  background: var(--ica-white);
  z-index: 1;
  padding-bottom: 0.1rem;
}

/* Logo Row */
.school-interest-popup-logos {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: nowrap;
}

.school-interest-popup-primary-logo {
  max-width: 200px;
  height: auto;
  object-fit: contain;
}

.school-interest-popup-school-icon {
  max-width: 170px;
  height: auto;
  object-fit: contain;
}

/* Popup Header */
.school-interest-popup-header {
  margin-bottom: 1.5rem;
}

.school-interest-popup-title {
  font-family: var(--font-ui);
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 700;
  color: var(--ica-green-deep);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 50%, #C6D62B7A 50%);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  display: inline-block;
}

/* Popup Subheader */
.school-interest-popup-subheader {
  margin-bottom: 1.5rem;
}

.school-interest-popup-subtitle {
  font-family: var(--font-ui);
  font-size: 19px;
  font-weight: 600;
  color: var(--ica-green-deep);
  margin: 0;
  line-height: 1.3;
}

/* Popup Description */
.school-interest-popup-description {
  margin-bottom: 2rem;
}

.school-interest-popup-description p {
  font-family: var(--font-body);
  color: var(--ica-green-deep);
  margin: 0;
  line-height: 1.6;
}

/* Content Area */
.school-interest-popup-content-area {
  margin-top: 2rem;
  flex: 1 1 auto;
  overflow-y: auto; /* only this area scrolls */
}

.school-interest-iframe-container {
  position: relative;
  min-height: 200px;
}

/* Loading Bar */
.school-interest-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
}

.school-interest-loading-bar {
  width: 100%;
  max-width: 300px;
  height: 4px;
  background-color: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.school-interest-loading-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--ica-green-deep), var(--ica-teal));
  border-radius: 2px;
  animation: school-interest-loading-animation 2s ease-in-out infinite;
}

@keyframes school-interest-loading-animation {
  0% {
    width: 0%;
    transform: translateX(-100%);
  }
  50% {
    width: 100%;
    transform: translateX(0%);
  }
  100% {
    width: 0%;
    transform: translateX(100%);
  }
}

.school-interest-loading-text {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Form Container */
#school-interest-form-container {
  width: 100%;
  min-height: 200px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .school-interest-popup-modal {
    padding: 0.5rem;
  }
  
  .school-interest-popup-content {
    width: 95vw; /* ensure 95vw on mobile */
    max-height: calc(100vh - 1rem);
    min-height: 70vh;
  }
  
  .school-interest-popup-body {
    padding: 1.5rem;
  }
  
  .school-interest-popup-logos {
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;
  }
  
  .school-interest-popup-primary-logo {
    max-width: 150px;
  }
  
  .school-interest-popup-school-icon {
    max-width: 150px;
  }
  
  
}

@media (max-width: 480px) {
  .school-interest-popup-body {
    padding: 1rem;
  }
  
  .school-interest-popup-logos {
    flex-direction: row;
    gap: 1.5rem;
    flex-wrap: nowrap;
  }
  
  .school-interest-popup-primary-logo {
    max-width: 120px;
  }
  
  .school-interest-popup-school-icon {
    max-width: 120px;
  }

  
}

/* Accessibility & Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  .school-interest-popup-modal,
  .school-interest-popup-content {
    transition: none;
  }
  
  .school-interest-popup-modal[style*="opacity: 1"] .school-interest-popup-content {
    transform: none;
  }
  
  .school-interest-loading-progress {
    animation: none;
    width: 100%;
    transform: none;
  }
}

/* Focus Management */
.school-interest-popup-modal:focus {
  outline: none;
}

.school-interest-popup-close:focus {
  outline: 2px solid var(--ica-green-deep);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .school-interest-popup-modal {
    display: none !important;
  }
}
