/* ============================================
   KIDS JOY — Responsive Breakpoints & Mobile Optimization
   ============================================ */

/* ============================================
   1. Extra Large Desktop (max-width: 1400px)
   ============================================ */
@media (max-width: 1400px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: var(--space-xl);
  }
}

/* ============================================
   2. Laptop (max-width: 1200px)
   ============================================ */
@media (max-width: 1200px) {
  .hero .container {
    gap: var(--space-xl);
  }

  .choose-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .academics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .facilities-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .teachers-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   3. Tablet Landscape & Mobile Nav (max-width: 992px)
   ============================================ */
@media (max-width: 992px) {
  /* Navigation Container */
  .navbar .container {
    position: relative;
  }

  /* Mobile Drawer Menu */
  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 340px;
    height: 100vh;
    height: 100dvh;
    background: var(--clr-bg);
    border-left: 1px solid rgba(15, 23, 42, 0.1);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 5.5rem 1.5rem 2rem;
    gap: 0.5rem;
    overflow-y: auto;
  }

  [data-theme="dark"] .nav-menu {
    border-left-color: rgba(255, 255, 255, 0.1);
  }

  .nav-menu.open {
    transform: translateX(0);
  }

  /* Hamburger Toggle Button */
  .nav-actions {
    position: relative;
    z-index: 1005;
  }

  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 8px;
    border-radius: var(--radius-md);
    background: rgba(var(--clr-primary-rgb), 0.08);
    cursor: pointer;
    z-index: 1006;
    border: 1px solid rgba(var(--clr-primary-rgb), 0.15);
    transition: all var(--transition-base);
  }

  .nav-hamburger:hover {
    background: rgba(var(--clr-primary-rgb), 0.15);
  }

  .nav-hamburger span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: var(--clr-text);
    border-radius: 4px;
    transition: all 0.3s ease;
  }

  .nav-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .nav-link {
    font-size: var(--fs-body);
    padding: 0.75rem 1rem;
    width: 100%;
    border-radius: var(--radius-md);
    color: var(--clr-text);
  }

  .nav-link:hover, 
  .nav-link.active {
    background: rgba(var(--clr-primary-rgb), 0.08);
  }

  .nav-link::after {
    display: none;
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown-toggle {
    justify-content: space-between;
  }

  .nav-dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    background: transparent;
    border: none;
    padding: 0.5rem 0 0.5rem 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-dropdown.open .nav-dropdown-menu {
    max-height: 500px;
  }

  .nav-cta {
    display: none;
  }

  /* Mobile Overlay */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Hero Section */
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-visual {
    min-height: 350px;
  }

  .hero-image-wrapper {
    max-width: 400px;
    margin: 0 auto;
  }

  .floating-book { top: 5%; left: 10%; }
  .floating-cap { bottom: 10%; right: 10%; }
  .floating-globe { top: 15%; right: 5%; }
  .floating-star { bottom: 25%; left: 5%; }
  .floating-pencil { display: none; }

  /* About Section */
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .about-image-badge {
    bottom: -1rem;
    right: 1rem;
  }

  /* Stats Section */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* MVV Section */
  .mvv-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Teachers Grid */
  .teachers-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Events Timeline */
  .events-timeline::before {
    left: 30px;
  }

  .event-item,
  .event-item:nth-child(odd) {
    flex-direction: row;
    text-align: left;
  }

  .event-item:nth-child(odd) .event-card,
  .event-item:nth-child(even) .event-card {
    margin-left: var(--space-3xl);
    margin-right: 0;
    flex: 1;
  }

  .event-dot {
    left: 30px;
  }

  .event-item:nth-child(odd) .event-countdown {
    justify-content: flex-start;
  }

  /* Contact Grid */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  /* Footer Grid */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  /* Testimonials Slider */
  .testimonial-card {
    flex: 0 0 calc(50% - var(--space-md));
  }
}

/* ============================================
   4. Tablet Portrait (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
  /* Navigation */
  .nav-menu {
    width: 100%;
    max-width: 100%;
  }

  .section-header {
    margin-bottom: var(--space-xl);
  }

  /* Hero Section */
  .hero-visual {
    min-height: 280px;
  }

  .hero-image-wrapper {
    max-width: 320px;
  }

  .hero-gradient-orb.orb-1 {
    width: 250px;
    height: 250px;
  }

  .hero-gradient-orb.orb-2 {
    width: 200px;
    height: 200px;
  }

  .hero-gradient-orb.orb-3 {
    width: 150px;
    height: 150px;
  }

  /* About Features */
  .about-features {
    grid-template-columns: 1fr;
  }

  /* MVV Cards */
  .mvv-cards {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  /* Academics & Facilities Grids */
  .academics-grid,
  .facilities-grid,
  .choose-grid {
    grid-template-columns: 1fr;
  }

  /* Campus Virtual Tour Popups */
  .campus-popup {
    position: relative;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin-top: 1rem;
    width: 100%;
    min-width: auto;
  }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  /* Gallery Grid */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item.tall,
  .gallery-item.wide {
    grid-row: auto;
    grid-column: auto;
    aspect-ratio: 1;
  }

  /* Teachers Grid */
  .teachers-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .teacher-card {
    height: 350px;
  }

  /* Achievements Grid */
  .achievements-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  /* Testimonials */
  .testimonial-card {
    flex: 0 0 100%;
    margin: 0;
  }

  .testimonials-track {
    gap: 1rem;
  }

  /* Contact Form */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  /* Lightbox */
  .lightbox-content {
    max-width: 95%;
    max-height: 70vh;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .lightbox-prev { left: 0.75rem; }
  .lightbox-next { right: 0.75rem; }

  /* Back to Top */
  .back-to-top {
    width: 42px;
    height: 42px;
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

/* ============================================
   5. Mobile (max-width: 576px)
   ============================================ */
@media (max-width: 576px) {
  /* Hero */
  .hero-stats {
    gap: var(--space-md);
    flex-wrap: wrap;
  }

  .hero-stat-number {
    font-size: 1.4rem;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .hero-floating,
  .hero-image-decoration {
    display: none;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .stat-card {
    padding: var(--space-md);
  }

  .stat-number {
    font-size: 1.5rem;
  }

  /* Events Timeline */
  .events-timeline::before {
    left: 15px;
  }

  .event-dot {
    left: 15px;
    width: 12px;
    height: 12px;
  }

  .event-item:nth-child(odd) .event-card,
  .event-item:nth-child(even) .event-card {
    margin-left: var(--space-2xl) !important;
    margin-right: 0 !important;
  }

  .event-countdown {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .countdown-unit {
    min-width: 45px;
    padding: 0.4rem 0.5rem;
  }

  /* Gallery Filters & Grid */
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-filters {
    gap: 0.4rem;
  }

  .gallery-filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: var(--fs-xs);
  }

  /* Newsletter Form */
  .newsletter-form {
    flex-direction: column;
  }

  /* Section Padding */
  .section {
    padding: var(--space-2xl) 0;
  }
}

/* ============================================
   6. Small Mobile (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
  .hero-visual {
    min-height: 220px;
  }

  .hero-image-wrapper {
    max-width: 250px;
  }

  .about-image-badge {
    position: static;
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: var(--space-sm);
    padding: 0.75rem 1rem;
  }

  .about-image-badge .number {
    font-size: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
