/* ============================================
   PREMIUM GLASSMORPHISM MODAL SYSTEM
   iOS 26-Inspired Design with Premium Animations
   ============================================ */

:root {
  --glass-blur: 20px;
  --glass-opacity: 0.7;
  --glass-border-opacity: 0.2;
  --animation-duration: 0.6s;
  --animation-timing: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   MODAL BACKDROP & CONTAINER
   ============================================ */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.active {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   MODAL CONTAINER - BUBBLE ANIMATION
   ============================================ */

.modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  max-width: 90%;
  max-height: 90vh;
  width: 600px;
  background: rgba(20, 25, 35, 0.95);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 32px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 0 20px rgba(255, 255, 255, 0.05),
    0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: all var(--animation-duration) var(--animation-timing);
}

.modal-container.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.modal-container.closing {
  transform: translate(-50%, -50%) scale(0.7);
  opacity: 0;
  pointer-events: none;
}

/* ============================================
   MODAL HEADER - REMOVED (CLEAN LOOK)
   ============================================ */

.modal-header {
  display: none;
}

/* ============================================
   MODAL CLOSE BUTTON - CIRCULAR GLASSMORPHISM
   ============================================ */

.modal-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1001;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 0 12px rgba(255, 255, 255, 0.05);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.1) rotate(90deg);
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.4),
    inset 0 0 16px rgba(255, 255, 255, 0.1);
}

.modal-close-btn:active {
  transform: scale(0.95);
}

/* ============================================
   MODAL BACK BUTTON - CIRCULAR GLASSMORPHISM
   ============================================ */

.modal-back-btn {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1001;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 0 12px rgba(255, 255, 255, 0.05);
}

.modal-back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.1) translateX(-4px);
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.4),
    inset 0 0 16px rgba(255, 255, 255, 0.1);
}

.modal-back-btn:active {
  transform: scale(0.95);
}

/* ============================================
   MODAL CONTENT AREA
   ============================================ */

.modal-content {
  padding: 60px 40px 40px 40px;
  overflow-y: auto;
  max-height: calc(90vh - 60px);
  animation: slideInContent 0.7s var(--animation-timing) 0.1s both;
}

/* ============================================
   KIDS IMAGE WITH ANIMATION
   ============================================ */

.modal-kids-image {
  width: 100%;
  max-width: 400px;
  height: auto;
  margin: 0 auto 24px auto;
  display: block;
  animation: bounceInImage 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.modal-kids-image-container {
  text-align: center;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s var(--animation-timing) 0.25s both;
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  transition: background 0.3s ease;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.35);
}

/* ============================================
   MODAL TITLE - ELEGANT TYPOGRAPHY
   ============================================ */

.modal-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
  animation: fadeInUp 0.6s var(--animation-timing) 0.15s both;
  font-family: 'Times New Roman', Times, serif;
  text-align: center;
}

.modal-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 28px;
  line-height: 1.5;
  animation: fadeInUp 0.6s var(--animation-timing) 0.2s both;
  text-align: center;
}

/* ============================================
   FEATURE CARDS - FLASH CARD STYLE
   ============================================ */

.features-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
  width: 100%;
}

.feature-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: slideInCard 0.5s var(--animation-timing) both;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 220px;
  justify-content: flex-start;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  border-radius: 20px;
}

.feature-card:nth-child(1) { animation-delay: 0.25s; }
.feature-card:nth-child(2) { animation-delay: 0.3s; }
.feature-card:nth-child(3) { animation-delay: 0.35s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.45s; }

.feature-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-8px);
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.4),
    inset 0 0 20px rgba(255, 255, 255, 0.08);
}

.feature-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  width: 100%;
}

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  flex-shrink: 0;
  animation: iconPulse 2s ease-in-out infinite;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.feature-card:nth-child(2) .feature-icon {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.feature-card:nth-child(3) .feature-icon {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.feature-card:nth-child(4) .feature-icon {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.feature-card:nth-child(5) .feature-icon {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.feature-title {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  line-height: 1.3;
}

.feature-description {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 8px 0 0 0;
  line-height: 1.4;
}

/* ============================================
   FLOW CHART / ANIMATED SEQUENCE
   ============================================ */

.flow-chart {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  animation: slideInLeft 0.6s var(--animation-timing) both;
}

.flow-step:nth-child(1) { animation-delay: 0.3s; }
.flow-step:nth-child(2) { animation-delay: 0.35s; }
.flow-step:nth-child(3) { animation-delay: 0.4s; }
.flow-step:nth-child(4) { animation-delay: 0.45s; }

.flow-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.flow-content {
  flex: 1;
  padding-top: 4px;
}

.flow-title {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.8);
  margin-bottom: 4px;
}

.flow-description {
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.6);
  line-height: 1.4;
}

/* ============================================
   CTA BUTTON - PREMIUM STYLE
   ============================================ */

.modal-cta {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
  width: 100%;
  animation: slideInUp 0.6s var(--animation-timing) 0.5s both;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.95rem;
}

.modal-cta:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.6);
}

.modal-cta:active {
  transform: translateY(-2px);
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

@keyframes slideInContent {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInCard {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes iconPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(102, 126, 234, 0);
  }
}

@keyframes bounceInImage {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(-20px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes kidsJump {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes textReveal {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

.modal-kids-image:hover {
  animation: kidsJump 0.6s ease-in-out infinite;
}

@media (max-width: 768px) {
  .modal-container {
    width: 95%;
    max-width: 100%;
  }

  .modal-content {
    padding: 50px 20px 24px 20px;
    max-height: calc(90vh - 50px);
  }

  .modal-title {
    font-size: 1.8rem;
  }

  .modal-kids-image {
    max-width: 350px;
  }

  .modal-subtitle {
    font-size: 0.9rem;
  }

  .features-container {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
  }

  .feature-card {
    padding: 16px 12px;
    min-height: 200px;
  }

  .feature-icon {
    width: 45px;
    height: 45px;
    font-size: 22px;
  }

  .feature-title {
    font-size: 0.95rem;
  }

  .feature-description {
    font-size: 0.8rem;
  }

  .modal-cta {
    padding: 12px 24px;
    font-size: 0.9rem;
  }

  .modal-close-btn,
  .modal-back-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .modal-container {
    width: 98%;
    max-height: 95vh;
  }

  .modal-content {
    padding: 45px 14px 16px 14px;
    max-height: calc(95vh - 45px);
  }

  .modal-title {
    font-size: 1.5rem;
  }

  .modal-kids-image {
    max-width: 280px;
    margin-bottom: 16px;
  }

  .modal-subtitle {
    font-size: 0.85rem;
    margin-bottom: 16px;
  }

  .features-container {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
  }

  .feature-card {
    padding: 12px 10px;
    min-height: 180px;
  }

  .feature-card-header {
    gap: 8px;
  }

  .feature-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .feature-title {
    font-size: 0.9rem;
  }

  .feature-description {
    font-size: 0.75rem;
  }

  .modal-cta {
    padding: 12px 20px;
    font-size: 0.85rem;
  }
}

/* ============================================
   WELCOME POPUP MODAL
   ============================================ */

.welcome-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.welcome-popup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.welcome-popup {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  position: relative;
  transform: scale(0.8) translateY(20px);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.welcome-popup-overlay.active .welcome-popup {
  transform: scale(1) translateY(0);
}

.popup-close-btn {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s ease;
  z-index: 10;
}

.popup-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.popup-content {
  text-align: center;
  color: #fff;
}

.popup-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.popup-message {
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.popup-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.popup-btn {
  min-width: 140px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.popup-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .welcome-popup {
    padding: 1.5rem;
    margin: 1rem;
  }

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

  .popup-message {
    font-size: 1rem;
  }

  .popup-actions {
    flex-direction: column;
    align-items: center;
  }

  .popup-btn {
    width: 100%;
    max-width: 250px;
  }
}
