/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Tablet and below */
@media (max-width: 992px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2.2rem; }
    
    .highlights, 
    .stats, 
    .footer-content,
    .programs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        max-width: 360px;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile */
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(40px) saturate(180%);
        -webkit-backdrop-filter: blur(40px) saturate(180%);
        flex-direction: column;
        align-items: stretch;
        padding: 100px 0 40px;
        padding-top: calc(80px + env(safe-area-inset-top));
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 
            4px 0 32px rgba(0, 46, 109, 0.12),
            inset -1px 0 0 rgba(93, 187, 255, 0.08);
        border-right: 1px solid rgba(93, 187, 255, 0.1);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(93, 187, 255, 0.3) transparent;
        z-index: 999;
    }
    
    .nav-menu::-webkit-scrollbar {
        width: 6px;
    }
    
    .nav-menu::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .nav-menu::-webkit-scrollbar-thumb {
        background: rgba(93, 187, 255, 0.3);
        border-radius: 3px;
    }
    
    .nav-menu::-webkit-scrollbar-thumb:hover {
        background: rgba(93, 187, 255, 0.5);
    }
    
    /* Mobile menu overlay - handled by JavaScript adding class to body */
    body.menu-open {
        overflow: hidden;
    }
    
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 998;
        opacity: 1;
        pointer-events: all;
        animation: fadeInOverlay 0.3s ease;
    }
    
    @keyframes fadeInOverlay {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    .hamburger.active {
        background: linear-gradient(135deg, rgba(93, 187, 255, 0.15), rgba(93, 187, 255, 0.08)) !important;
        color: var(--sky-blue) !important;
        z-index: 1001;
    }
    
    .hamburger.active i {
        transform: rotate(90deg);
    }
    
    /* Ensure hamburger is visible and styled on mobile */
    .hamburger {
        display: flex !important;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        margin: 4px 24px;
        width: calc(100% - 48px);
    }
    
    .nav-link {
        width: 100%;
        padding: 14px 20px;
        border-radius: 12px;
        justify-content: flex-start;
        font-size: 1rem;
        position: relative;
    }
    
    .nav-link::before {
        display: block;
    }
    
    .nav-link.active {
        background: linear-gradient(135deg, rgba(93, 187, 255, 0.15), rgba(93, 187, 255, 0.08));
        box-shadow: 0 2px 8px rgba(93, 187, 255, 0.15);
    }
    
    .nav-link.active::after {
        display: none;
    }
    
    /* Disable hover effects on mobile - use tap states instead */
    .nav-link:hover::before {
        opacity: 0.6;
    }
    
    .nav-link:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        background: transparent;
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 4px 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                    padding-top 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    padding-bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 12px;
        display: block !important;
    }
    
    .nav-item:hover .dropdown-menu {
        /* Disable hover on mobile */
    }
    
    /* Active dropdown on mobile - controlled by JS */
    .nav-item .dropdown-menu[style*="max-height"] {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
    
    .dropdown-item {
        padding: 12px 32px;
        margin: 2px 8px;
        font-size: 0.95rem;
        display: block;
    }
    
    .dropdown-item::before {
        left: 16px;
        width: 3px;
    }
    
    .dropdown-item:active {
        transform: translateX(2px);
        opacity: 0.9;
    }
    
    /* Prevent hover from interfering with dropdown on mobile */
    .nav-item:hover .dropdown-menu {
        /* Desktop only - handled by media query */
    }
    
    .hamburger {
        display: flex;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --section-padding: 70px 0;
    }
    
    h1 { font-size: 2.4rem; }
    h2 { font-size: 2rem; }
    
    .navbar {
        padding: 16px 0;
    }
    
    .navbar.scrolled {
        padding: 12px 0;
    }
    
    .logo-img {
        width: 42px;
        height: 42px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .nav-menu {
        max-width: 320px;
        padding: 90px 0 30px;
    }
    
    .nav-item {
        margin: 4px 20px;
        width: calc(100% - 40px);
    }
    
    .nav-link {
        padding: 12px 18px;
        font-size: 0.95rem;
    }
    
    .dropdown-item {
        padding: 10px 28px;
        font-size: 0.9rem;
    }
    
    .hero-btns {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn {
        width: 100%;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .highlights,
    .stats,
    .footer-content,
    .programs-grid {
        grid-template-columns: 1fr;
    }
    
    .shape-1, 
    .shape-2, 
    .shape-3 {
        opacity: 0.3;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.7rem; }
    
    .navbar {
        padding: 14px 0;
    }
    
    .navbar.scrolled {
        padding: 10px 0;
    }
    
    .logo-img {
        width: 38px;
        height: 38px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .nav-menu {
        max-width: 100%;
        padding: 80px 0 30px;
    }
    
    .nav-item {
        margin: 3px 16px;
        width: calc(100% - 32px);
    }
    
    .nav-link {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .dropdown-item {
        padding: 10px 24px;
        font-size: 0.85rem;
    }
    
    .hamburger {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    
    .hamburger i {
        font-size: 1.3rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .footer-content {
        gap: 30px;
    }
}

/* Footer Responsive */
@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    footer {
        padding: 70px 0 35px;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 35px;
        text-align: center;
    }
    
    .footer-heading::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    footer {
        padding: 60px 0 30px;
    }
}

/* Responsive Design for About Page */
@media (max-width: 1200px) {
    .intro-grid,
    .timeline-content,
    .vision-mission-cards,
    .values-grid-expanded,
    .accreditation-grid-detailed,
    .awards-grid,
    .facilities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .leader-profile {
        grid-template-columns: 250px 1fr;
    }
    
    .board-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .page-hero {
        height: auto;
        padding: 120px 0 80px;
    }
    
    .page-hero h1 {
        font-size: 3rem;
    }
    
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .timeline-year {
        position: relative;
        top: 0;
        width: 120px;
        margin: 0 auto;
    }
    
    .timeline-content {
        grid-template-columns: 1fr;
    }
    
    .timeline-image {
        height: 200px;
    }
    
    .accreditation-main {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    .accreditation-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .intro-grid,
    .vision-mission-cards,
    .values-grid-expanded,
    .accreditation-grid-detailed,
    .awards-grid,
    .facilities-grid,
    .board-grid {
        grid-template-columns: 1fr;
    }
    
    .page-hero-stats {
        gap: 20px;
    }
    
    .hero-stat {
        min-width: 120px;
        padding: 20px;
    }
    
    .leader-profile {
        grid-template-columns: 1fr;
    }
    
    .leader-image {
        height: 300px;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .page-hero h1 {
        font-size: 2.4rem;
    }
    
    .page-hero p {
        font-size: 1.1rem;
    }
    
    .hero-stat h3 {
        font-size: 2rem;
    }
    
    .timeline-text {
        padding: 20px;
    }
    
    .leader-info {
        padding: 20px;
    }
    
    .leader-stats {
        flex-direction: column;
        gap: 20px;
    }
}