/*
 * NIT Mobile CSS — Complete Responsive System
 * Covers: Nav/Sidebar, Hero, Cards, Footer, Forms, Grids
 * Breakpoints: 1200px | 992px | 768px | 600px | 480px
 */

/* ════════════════════════════════════════════════
   GLOBAL SITE-WIDE WRAPPER SAFETY
════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; }
body { overflow-x: hidden; min-width: 320px; }
img  { max-width: 100%; height: auto; display: block; }

/* ════════════════════════════════════════════════
   HEADER / NAV SYSTEM
════════════════════════════════════════════════ */

/* ── Top announcement bar ── */
.top-announcement {
    background: transparent;
    padding: 8px 0;
    width: 100%;
    z-index: 10001;
}
.top-bar-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}
.top-contact {
    color: rgba(255,255,255,0.85);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.top-contact i { color: var(--accent-color, #00b4d8); }
.top-apply-btn {
    background: linear-gradient(135deg, #00b4d8, #0077b6);
    color: #fff;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s;
}
.top-apply-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Main nav bar ── */
.main-nav-bar {
    background: transparent;
    padding: 0;
    width: 100%;
    z-index: 10000;
    position: relative;
    top: 0;
    box-shadow: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.main-nav-bar.scrolled {
    position: fixed;
    background: rgba(11, 28, 60, 0.65) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideDownGlass 0.4s ease-out forwards;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-height: 64px;
    position: relative;
}

/* ── Brand ── */
.nav-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-decoration: none;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
}
.nav-logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}
.nav-brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1px;
    min-width: 0;
}
.nav-brand-name {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.nav-brand-sub {
    color: rgba(255,255,255,0.55);
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-badges-nav {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}
.nav-badge {
    height: 32px;
    width: auto;
    object-fit: contain;
}

/* ── Mobile Hamburger Toggle ── */
.mobile-menu-toggle {
    display: none;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
    z-index: 10002;
}
.mobile-menu-toggle:hover { background: rgba(255,255,255,0.15); }
.mobile-menu-toggle.active { background: rgba(0,180,216,0.2); border-color: rgba(0,180,216,0.4); }

/* ── Nav Bottom Row (desktop) ── */
.nav-bottom-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: flex-end;
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    flex-wrap: nowrap;
}

.nav-list > li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,0.85);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
    letter-spacing: 0.02em;
}
.nav-list > li > a:hover,
.nav-list > li > a.nav-active {
    color: #fff;
    background: rgba(0,180,216,0.15);
}
.nav-list > li > a.nav-active {
    color: var(--accent-color, #00b4d8);
}

/* ── Dropdown ── */
.has-dropdown { position: relative; }
.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #0b1c3c;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    min-width: 220px;
    padding: 8px;
    z-index: 10003;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: ddFadeIn 0.2s ease;
}
@keyframes ddFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.has-dropdown:hover > .nav-dropdown,
.has-dropdown:focus-within > .nav-dropdown { display: block; }

.nav-dropdown li a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.8);
    font-size: 0.82rem;
    padding: 9px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.nav-dropdown li a:hover {
    background: rgba(0,180,216,0.15);
    color: #fff;
}
.nav-dropdown li a i {
    width: 16px;
    text-align: center;
    color: var(--accent-color, #00b4d8);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ── Nav action buttons ── */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    flex-shrink: 0;
}
.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
    border: 1.5px solid transparent;
    cursor: pointer;
}
.btn-nav.btn-outline {
    border-color: rgba(255,255,255,0.3);
    color: #fff;
    background: transparent;
}
.btn-nav.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}
.btn-nav.btn-primary {
    background: linear-gradient(135deg, #00b4d8, #0077b6);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0,180,216,0.3);
}
.btn-nav.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,180,216,0.45);
}

/* ── Nav icon chevron ── */
.nav-icon {
    font-size: 0.6rem !important;
    transition: transform 0.3s ease;
    display: inline-block;
}
.has-dropdown.expanded > a .nav-icon,
.nav-icon.rotated { transform: rotate(180deg); }

/* ════════════════════════════════════════════════
   BREAKPOINT: 1200px — hide badges, compress
════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .brand-badges-nav { display: none; }
    .nav-brand-sub    { display: none; }
    .nav-brand-name   { font-size: 0.82rem; }
    .nav-list > li > a { padding: 8px 7px; font-size: 0.74rem; }
    .btn-nav { padding: 6px 10px; font-size: 0.72rem; }
}

/* ════════════════════════════════════════════════
   BREAKPOINT: 992px — MOBILE SIDEBAR MODE
════════════════════════════════════════════════ */
@media (max-width: 992px) {

    /* Show hamburger */
    .mobile-menu-toggle { display: flex; }

    /* Nav bottom row becomes a slide-in sidebar */
    .nav-bottom-row {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 85vw);
        height: 100dvh;
        height: 100vh;
        background: #0a1628;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 0 0 40px;
        z-index: 10001;
        overflow-y: auto;
        overflow-x: hidden;
        box-shadow: -8px 0 40px rgba(0,0,0,0.5);
        transition: right 0.38s cubic-bezier(0.22, 1, 0.36, 1);
        -webkit-overflow-scrolling: touch;
    }

    /* Sidebar header */
    .nav-bottom-row::before {
        content: '';
        display: block;
        height: 64px; /* space for close button */
        flex-shrink: 0;
    }

    /* Open state */
    .nav-bottom-row.mobile-open {
        right: 0;
    }

    /* Overlay behind sidebar */
    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        backdrop-filter: blur(3px);
        z-index: 10000;
    }
    .nav-overlay.active { display: block; }

    /* Nav list as vertical column */
    .nav-list {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding: 8px 12px;
        gap: 2px;
    }

    .nav-list > li { width: 100%; }

    .nav-list > li > a {
        width: 100%;
        padding: 12px 14px;
        font-size: 0.9rem;
        border-radius: 10px;
        justify-content: space-between;
        color: rgba(255,255,255,0.88);
    }
    .nav-list > li > a:hover { background: rgba(0,180,216,0.12); color: #fff; }

    /* Dropdown — accordion style inside sidebar */
    .nav-dropdown {
        position: static;
        display: none;
        background: rgba(255,255,255,0.04);
        border: none;
        border-radius: 10px;
        margin: 4px 0 4px 12px;
        padding: 4px 0;
        box-shadow: none;
        animation: none;
        min-width: unset;
    }
    .nav-dropdown.mobile-open {
        display: block !important;
    }
    .nav-dropdown li a {
        padding: 10px 14px;
        font-size: 0.85rem;
        border-radius: 8px;
        color: rgba(255,255,255,0.75);
    }
    .nav-dropdown li a:hover {
        background: rgba(0,180,216,0.12);
        color: #fff;
    }

    /* Desktop hover dropdown disabled on mobile */
    .has-dropdown:hover > .nav-dropdown { display: none; }
    .has-dropdown:focus-within > .nav-dropdown { display: none; }

    /* Nav actions as full-width stacked buttons */
    .nav-actions {
        flex-direction: column;
        align-items: stretch;
        margin: 12px;
        gap: 8px;
        border-top: 1px solid rgba(255,255,255,0.08);
        padding-top: 16px;
    }
    .btn-nav {
        justify-content: center;
        padding: 11px 16px;
        font-size: 0.88rem;
        border-radius: 10px;
        width: 100%;
    }

    /* Top bar stacking */
    .top-bar-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 8px 16px;
    }
    .ticker-wrapper {
        width: 100%;
        margin: 0;
        order: 3;
        background: rgba(255,255,255,0.06);
        border-radius: 8px;
    }
    .top-contact { font-size: 0.76rem; }
    .top-right   { align-self: flex-end; }
}

/* ════════════════════════════════════════════════
   BREAKPOINT: 768px — Tablet & Large Phones
════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* Container */
    .container { padding: 0 16px; }
    .section-padding { padding: 60px 0; }
    .section-title { margin-bottom: 36px; }
    .section-title h2 { font-size: 1.8rem; }
    .section-title p  { font-size: 0.95rem; }

    /* Hero */
    .hero { height: auto; min-height: 100svh; padding-top: 120px; padding-bottom: 60px; }
    .hero-title    { font-size: 2.2rem; letter-spacing: -0.5px; margin-top: 0; }
    .hero-subtitle { font-size: 1rem; }
    .hero-actions  { flex-direction: column; gap: 12px; }
    .hero-actions .btn { width: 100%; justify-content: center; }

    /* About grid */
    .about-grid          { grid-template-columns: 1fr; gap: 30px; }
    .about-stats-card    { bottom: 0; right: 0; position: relative; margin-top: 16px; }
    .about-features      { grid-template-columns: 1fr; }
    .about-content h2    { font-size: 1.8rem; }

    /* Accreditation */
    .acc-grid { gap: 16px; }
    .acc-item { min-width: 120px; padding: 16px 20px; }
    .acc-item h3 { font-size: 1.2rem; }

    /* Programs grid */
    .programs-grid { grid-template-columns: 1fr 1fr; gap: 16px; }

    /* Features grid */
    .features-grid { grid-template-columns: 1fr; gap: 16px; }

    /* Stats container */
    .stats-container { grid-template-columns: 1fr; gap: 16px; }
    .stat-box { padding: 24px 20px; }
    .stat-box .counter { font-size: 2.2rem; }

    /* Gallery grid */
    .gallery-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

    /* Principal section */
    .principal-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
    .principal-img {
        width: 160px;
        height: 160px;
        border-radius: 50%;
        overflow: hidden;
        margin: 0 auto;
    }
    .principal-img img { width: 100%; height: 100%; object-fit: cover; }

    /* Admission banner */
    .banner-glass { padding: 36px 20px; }
    .banner-glass h2 { font-size: 1.8rem; }
    .banner-actions { flex-direction: column; align-items: center; gap: 12px; }
    .banner-actions .btn { width: 100%; justify-content: center; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .footer-about { grid-column: 1 / -1; }
    .footer-bottom-flex {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        align-items: center;
    }
    .footer-legal-links { justify-content: center; }
}

/* ════════════════════════════════════════════════
   BREAKPOINT: 600px — Phones
════════════════════════════════════════════════ */
@media (max-width: 600px) {

    .hero-title    { font-size: 1.8rem; }
    .hero-subtitle { font-size: 0.92rem; }

    /* Programs — single column */
    .programs-grid { grid-template-columns: 1fr; gap: 14px; }
    .program-card  { padding: 24px 20px; }

    /* Gallery — single column */
    .gallery-grid { grid-template-columns: 1fr; }

    /* Accreditation */
    .acc-grid { justify-content: flex-start; }
    .acc-item { min-width: 0; width: 100%; }

    /* Events grid */
    .events-grid-row { grid-template-columns: 1fr; gap: 16px; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .footer-about { grid-column: auto; }

    /* Section title */
    .section-title h2 { font-size: 1.5rem; }
    .section-title h2::after { bottom: -6px; }

    /* Nav brand compact */
    .nav-brand-name { font-size: 0.75rem; }
    .nav-logo-img   { height: 36px; }
    .nav-container  { min-height: 56px; padding: 0 12px; }
}

/* ════════════════════════════════════════════════
   BREAKPOINT: 480px — Small phones
════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .hero { min-height: 100svh; padding-top: 100px; }
    .hero-title { font-size: 1.6rem; }

    .section-padding { padding: 44px 0; }
    .section-title h2 { font-size: 1.35rem; }

    .acc-grid { gap: 10px; }

    .stat-box .counter { font-size: 2rem; }

    .btn { padding: 10px 20px; font-size: 0.9rem; }

    /* About stats card not floating */
    .about-stats-card { right: 0; bottom: 0; }

    /* Chat widget */
    .chat-widget { bottom: 12px; right: 12px; }
    .chat-fab { width: 50px; height: 50px; font-size: 1.1rem; }
}

/* ════════════════════════════════════════════════
   SIDEBAR CLOSE BUTTON (injected via JS)
════════════════════════════════════════════════ */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    background: #0a1628;
    z-index: 2;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-logo img   { height: 34px; width: auto; }
.sidebar-logo span  { color: #fff; font-weight: 700; font-size: 0.85rem; }
.sidebar-close-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: background 0.2s;
    flex-shrink: 0;
}
.sidebar-close-btn:hover { background: rgba(231,76,60,0.5); }

/* ════════════════════════════════════════════════
   REDUCE MOTION
════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .nav-bottom-row { transition: none; }
    .nav-dropdown   { animation: none; }
}
