/* ==========================================================================
   PROFESSIONAL DESIGN OVERRIDES
   Applied last — overrides base styles for a cleaner, polished look
   ========================================================================== */

/* ===== 1. REFINED CSS VARIABLES ===== */
:root {
    /* ── Nepal-Oriented Professional Palette ── */
    --primary:       #102A43;
    --primary-dark:  #0b1e30;
    --primary-light: #1E5AA8;
    --secondary:     #C8962A;   /* kept for logo gold only */

    /* Nepal identity */
    --nase-navy:    #102A43;
    --nase-blue:    #1E5AA8;
    --nase-red:     #C1121F;
    --nase-red-dk:  #9B0E18;
    --nase-light:   #F5F7FA;
    --nase-bg:      #F7FAFC;
    --nase-white:   #FFFFFF;
    --nase-text:    #1F2937;
    --nase-muted:   #6B7280;

    /* Typography */
    --font-heading: 'Poppins', 'Montserrat', Arial, sans-serif;
    --font-body:    'Inter', 'DM Sans', Arial, sans-serif;
    --font-ui:      'DM Sans', 'Inter', Arial, sans-serif;

    /* Neutral palette */
    --text-dark:   #18181B;
    --text-muted:  #71717A;
    --border-light: #E4E4E7;
    --bg-light:    #FAFAFA;
    --bg-white:    #FFFFFF;

    /* Professional shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.03);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.03);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);

    /* Refined spacing scale (4px base) */
    --sp-1:  0.25rem;
    --sp-2:  0.5rem;
    --sp-3:  0.75rem;
    --sp-4:  1rem;
    --sp-6:  1.5rem;
    --sp-8:  2rem;
    --sp-10: 2.5rem;
    --sp-12: 3rem;
    --sp-16: 4rem;
    --sp-20: 5rem;
    --sp-24: 6rem;

    /* Easing curves */
    --ease-out:     cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out:  cubic-bezier(0.4, 0, 0.2, 1);
    --dur-fast:     150ms;
    --dur-normal:   250ms;
    --dur-slow:     400ms;

    /* Border radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 32px;
}

/* ===== 2. TYPOGRAPHY ===== */
body {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0;
    line-height: 1.68;
    color: var(--nase-text);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--nase-navy);
    font-weight: 700;
}

h2 {
    font-size: clamp(1.875rem, 4vw, 3rem);
    margin-bottom: var(--sp-4);
}

h3 {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    letter-spacing: -0.015em;
}

p {
    font-family: var(--font-body);
    line-height: 1.75;
    color: var(--nase-muted);
}

/* ===== 3. REDUCE VISUAL CLUTTER ===== */
/* Tone down animated background */
.bg-grid {
    opacity: 0.025 !important;
    animation: none !important; /* Stop moving grid */
}

.glow-orb {
    opacity: 0.18 !important;
    filter: blur(100px) !important;
}

/* Remove distracting elements */
.shooting-star,
.rainbow-constellation,
.star {
    display: none !important;
}

/* Light institutional background */
body {
    background-color: var(--nase-bg);
}

/* ===== 4. CONTAINER — TIGHTER MAX-WIDTH ===== */
.container {
    max-width: 1200px !important;
    padding: 0 clamp(1.25rem, 4vw, 2.5rem) !important;
}

/* ===== 5. SECTION SPACING ===== */
section {
    padding: var(--sp-24) 0 !important;
}

.section-header {
    margin-bottom: var(--sp-12) !important;
}

.section-tag {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--nase-red);
    margin-bottom: var(--sp-3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.section-tag::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 2px;
    background: var(--nase-red);
    border-radius: 2px;
}
.section-tag::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 2px;
    background: var(--nase-red);
    border-radius: 2px;
}

.section-description {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== 6. PROFESSIONAL BUTTONS ===== */
.btn {
    padding: 0.875rem 1.875rem !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    border-radius: var(--radius-md) !important;
    transition:
        transform var(--dur-normal) var(--ease-out),
        box-shadow var(--dur-normal) var(--ease-out),
        background var(--dur-normal) var(--ease-out) !important;
    position: relative;
    overflow: hidden;
}

/* Ripple on click */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    opacity: 0;
    transition: opacity var(--dur-fast);
}
.btn:active::after { opacity: 1; }

.btn-primary {
    background: linear-gradient(135deg, var(--nase-red) 0%, var(--nase-red-dk) 100%) !important;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.38) !important;
    border: none !important;
    color: #fff !important;
}

.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 28px rgba(220, 38, 38, 0.50) !important;
    background: linear-gradient(135deg, #ef4444 0%, var(--nase-red) 100%) !important;
}

.btn-primary:active { transform: translateY(0) !important; }

.btn-secondary {
    background: #fff !important;
    color: var(--primary) !important;
    border: 1.5px solid var(--border-light) !important;
    box-shadow: var(--shadow-sm) !important;
}

.btn-secondary:hover {
    background: #EEF2FA !important;
    border-color: var(--primary-light) !important;
    color: var(--primary-dark) !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-md) !important;
}

/* ===== 7. NAVIGATION ===== */
nav {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 12px rgba(30, 58, 110, 0.08) !important;
    animation: none !important;
    position: fixed !important;
    top: 0 !important;
    z-index: 1000 !important;
}

nav::before, nav::after { display: none !important; }

/* ── TOP BAR ── logo navy → warm gold natural gradient */
.nav-top-bar {
    background: linear-gradient(135deg, #1D3461 0%, #22396E 30%, #6B4D14 65%, #C8962A 100%) !important;
    border-bottom: 1px solid rgba(30, 90, 168, 0.35) !important;
    box-shadow: 0 2px 16px rgba(12, 29, 53, 0.35) !important;
}

.nav-top-bar .container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    padding-top: 0.6rem !important;
    padding-bottom: 0.6rem !important;
    gap: 0 !important;
}

/* ── BOTTOM BAR ── slightly deeper navy → gold gradient */
.nav-bottom-bar {
    background: linear-gradient(135deg, #162848 0%, #1D3461 35%, #7A5818 70%, #B8862A 100%) !important;
    border-bottom: 1px solid #1E5AA8 !important;
    box-shadow: 0 4px 16px rgba(12, 29, 53, 0.28) !important;
}

.nav-bottom-bar .container {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    gap: 0 !important;
}

.nav-bottom-bar .nav-menu {
    margin-left: auto !important;
}

/* ── LOGO ── */
.logo {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    text-decoration: none !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.logo::before { display: none !important; }

.logo-image {
    height: 64px !important;
    width: auto !important;
    filter: none !important;
    background: none !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 1 !important;
    transition: transform 0.3s ease !important;
}
.logo:hover .logo-image { transform: scale(1.04) !important; }

.logo-text {
    color: #1E5AA8 !important;
    -webkit-text-fill-color: #1E5AA8 !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    animation: none !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.01em !important;
    position: relative !important;
    z-index: 1 !important;
}

.logo-text::after {
    content: '' !important;
    display: block !important;
    width: 28px !important;
    height: 2px !important;
    background: #1E5AA8 !important;
    border-radius: 2px !important;
    margin-top: 3px !important;
}

/* ── QUICK ACTIONS (top bar right) ── */
.nav-quick-actions {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
}

.quick-action {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 0.5rem 1.4rem !important;
    text-decoration: none !important;
    color: rgba(255,255,255,0.85) !important;
    border-left: 1px solid rgba(200, 150, 42, 0.18) !important;
    transition: background 0.2s ease !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

.quick-action i {
    font-size: 1.4rem !important;
    color: #7EC8F0 !important;
    transition: transform 0.2s ease !important;
}

.quick-action:hover {
    background: rgba(255,255,255,0.07) !important;
    color: #ffffff !important;
}
.quick-action:hover i { transform: translateY(-2px) !important; }

/* Enroll quick action — gold icon */
.quick-action-enroll i { color: #C8962A !important; }
.quick-action-enroll { color: #C8962A !important; font-weight: 700 !important; }

/* ── NAV LINKS (bottom bar) ── */
.nav-menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0 !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nav-link {
    display: block !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #1E3A6E !important;
    padding: 0.8rem 1.25rem !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    position: relative !important;
    margin-top: -3px !important;
}

.nav-link::after { display: none !important; }
.nav-link::before { display: none !important; }

.nav-link:hover {
    color: #1E5AA8 !important;
    background: rgba(30, 58, 110, 0.06) !important;
    border-bottom-color: #1E5AA8 !important;
    transform: none !important;
    box-shadow: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

.nav-link.active {
    color: #1E5AA8 !important;
    background: transparent !important;
    border-bottom: 3px solid #C8962A !important;
    box-shadow: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

.nav-menu li:last-child { margin-left: 0 !important; }
.enroll-btn { background: transparent !important; border: none !important; box-shadow: none !important; }

/* ===== 8. MOBILE NAV ===== */
@media (max-width: 768px) {
    .nav-menu {
        background: #fff !important;
        box-shadow: 0 12px 40px rgba(0,0,0,0.10) !important;
        border-top: 1px solid var(--border-light) !important;
    }

    .nav-link {
        padding: 0.875rem 1rem !important;
        border-bottom: 1px solid var(--border-light) !important;
        font-size: 1rem !important;
    }

    .bar {
        background: var(--text-dark) !important;
        height: 1.5px !important;
        border-radius: 2px !important;
    }

    /* Animated hamburger → X */
    .mobile-menu-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .mobile-menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

/* ===== 9. CARDS — PROFESSIONAL HOVER ===== */
.program-card,
.facility-card,
.instructor,
.testimonial-card,
.division-card,
.division-card-3d {
    background: #fff !important;
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    transition:
        transform var(--dur-normal) var(--ease-out),
        box-shadow var(--dur-normal) var(--ease-out),
        border-color var(--dur-normal) var(--ease-out) !important;
    overflow: hidden;
    position: relative;
}

/* Accent top bar on hover */
.program-card::before,
.facility-card::before,
.instructor::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-normal) var(--ease-out);
    z-index: 2;
}

.program-card:hover::before,
.facility-card:hover::before,
.instructor:hover::before {
    transform: scaleX(1);
}

.program-card:hover,
.facility-card:hover,
.instructor:hover,
.testimonial-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: var(--shadow-hover) !important;
    border-color: rgba(29, 52, 97, 0.15) !important;
}

/* ===== 10. STAT NUMBER TEXT ===== */
.stat-number,
.stat-3d-number {
    color: #1E3A6E !important;
    -webkit-text-fill-color: #1E3A6E !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    font-weight: 800 !important;
}

/* ===== 11. PROFESSIONAL FORM INPUTS ===== */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 0.875rem 1rem !important;
    border: 1.5px solid var(--border-light) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.9375rem !important;
    font-family: inherit !important;
    color: var(--text-dark) !important;
    background: #fff !important;
    transition:
        border-color var(--dur-fast),
        box-shadow var(--dur-fast) !important;
    outline: none !important;
    appearance: none !important;
}

input:hover,
textarea:hover,
select:hover {
    border-color: #A1A1AA !important;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(29, 52, 97, 0.12) !important;
}

input.error,
textarea.error,
select.error {
    border-color: #EF4444 !important;
    background: #FEF2F2 !important;
}

label {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    color: var(--text-dark) !important;
    margin-bottom: var(--sp-2) !important;
    display: block !important;
}

/* ===== 12. FOOTER ===== */
footer {
    background: var(--text-dark) !important;
    border-top: none !important;
}

footer * {
    border-color: rgba(255,255,255,0.08) !important;
}

footer p,
footer a,
footer li,
footer span {
    color: rgba(255,255,255,0.6) !important;
}

footer h4 {
    color: rgba(255,255,255,0.95) !important;
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: var(--sp-4) !important;
}

footer a:hover {
    color: rgba(255,255,255,0.95) !important;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08) !important;
    padding: var(--sp-6) 0 !important;
}

.footer-bottom p {
    font-size: 0.8125rem !important;
}

/* ===== 13. HERO SECTION — LOGO-COLORED OVERLAY ===== */
.bg-overlay {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.52) 0%,
        rgba(29, 52, 97, 0.10) 100%
    ) !important;
}

/* Hero title: logo gold gradient accent */
.hero-title .title-line:last-child,
.hero-title span:last-child {
    background: linear-gradient(90deg, #C8962A, #E8B840);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== 14. SECTION BACKGROUNDS — BRAND COLOR SCHEME ===== */

/* Stats strip — deep navy, bridges from hero */
.stats-strip {
    background: linear-gradient(135deg, #1D3461 0%, #1e3d72 60%, #162e5a 100%) !important;
}

/* About — warm cream with gold warmth */
.about-section {
    background: linear-gradient(150deg, #FFFBF0 0%, #FFF6E0 40%, #FFFDF8 80%, #FFFFF5 100%) !important;
}

/* Programs section */
.programs,
.programs-section {
    background: #F7FAFC !important;
}

/* Game / interactive — NASE brand navy */
.game-section {
    background: linear-gradient(135deg, #1D3461 0%, #243f75 30%, #1D3461 60%, #7a1a22 100%) !important;
}

/* Testimonials — soft purple-blue */
.testimonials {
    background: linear-gradient(135deg, #EFF2FF 0%, #E8F2FF 50%, #F0EEFF 100%) !important;
}

/* Contact — dark navy accent (mirrors stats strip) */
.contact {
    background: linear-gradient(135deg, #1D3461 0%, #243e72 100%) !important;
}

/* Dark sections (game + contact) — make headings white */
.game-section .section-header h2,
.game-section .section-header h3,
.contact .section-header h2,
.contact .section-header h3 {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}
.game-section .section-description,
.contact .section-description {
    color: rgba(255,255,255,0.75) !important;
}
.game-section .section-tag {
    background: rgba(200,150,42,0.25) !important;
    color: #f0c060 !important;
    border-color: rgba(200,150,42,0.4) !important;
}
.contact .section-tag {
    background: rgba(200,150,42,0.25) !important;
    color: #f0c060 !important;
    border-color: rgba(200,150,42,0.4) !important;
}

/* Nepal reach map */
.nepal-reach-section {
    background: #F7FAFC !important;
}

/* Facilities / projects — clean off-white */
.projects-section,
.facilities { background: #F8FBFF !important; }

/* Blog — handled by blog.css */
.blog { background: #F7FAFC !important; }

/* ===== 15. IMAGE TREATMENT ===== */
img {
    border-radius: var(--radius-sm);
}

.program-card img,
.blog-post img,
.instructor img {
    transition: transform var(--dur-slow) var(--ease-out);
}

.program-card:hover img,
.blog-post:hover img {
    transform: scale(1.03);
}

/* ===== 16. SMOOTH FOCUS STATES (Accessibility) ===== */
:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 3px !important;
}

/* ===== 17. LINK MICRO-INTERACTION ===== */
.footer-links a {
    position: relative;
    display: inline-block;
    transition: color var(--dur-fast);
    padding-bottom: 1px;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--dur-normal) var(--ease-out);
}

.footer-links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ===== 18. DIVISION HERO BADGES ===== */
.division-badge {
    background: rgba(255,255,255,0.15) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    border-radius: var(--radius-xl) !important;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4) !important;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ===== 19. SCROLL BAR — SUBTLE ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #F4F4F8; }
::-webkit-scrollbar-thumb {
    background: #D4D4D8;
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ===== 20. REDUCED MOTION (Accessibility) ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== 21. TABLET SPACING ===== */
@media (max-width: 1024px) {
    section { padding: var(--sp-20) 0 !important; }
}

/* ===== 22. MOBILE SPACING ===== */
@media (max-width: 768px) {
    section { padding: var(--sp-16) 0 !important; }

    h2 { font-size: clamp(1.625rem, 6vw, 2.25rem) !important; }

    .btn {
        padding: 0.8125rem 1.5rem !important;
        font-size: 0.9rem !important;
    }
}

/* ===== 23. SECTION TAG UNDERLINE — REFINED ===== */
.section-tag::after {
    background: linear-gradient(90deg, var(--primary), var(--primary-light)) !important;
    width: 32px !important;
    height: 2px !important;
}

/* ===== 24. STATS SECTION ===== */
.stats-grid .stat-item,
.hero-stats-bar .stat-item {
    border-right: 1px solid rgba(255,255,255,0.12);
    padding: var(--sp-6) var(--sp-8) !important;
}

.stat-label,
.stat-3d-label {
    display: block !important;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
    color: #5a7096 !important;
    -webkit-text-fill-color: #5a7096 !important;
    margin-top: 6px;
    opacity: 1;
}

/* ===== 25. PROGRAM ICONS — SOFTER BACKGROUND ===== */
.pillar,
.program-icon,
[class*="pillar-"] {
    border-radius: var(--radius-md) !important;
}

/* ===== 26. LOADING SCREEN ===== */
#loading-screen {
    background: var(--primary-dark) !important;
}

/* ===== 27. BACK TO TOP ===== */
.back-to-top {
    background: var(--primary) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 4px 16px rgba(29, 52, 97, 0.40) !important;
    width: 44px !important;
    height: 44px !important;
}

.back-to-top:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-3px) !important;
}
