/* ==========================================================================
   TERA KITE — header.css
   Blue + white header: desktop nav, mega menu, profile dropdown, mobile drawer.
   LOAD ORDER: style.css → header.css (header.php me already aisa hi hai).

   Sections: 1 Tokens · 2 Reset · 3 Accessibility · 4 Header shell + logo ·
             5 Desktop nav · 6 Header actions · 7 Mega menu · 8 Role badges ·
             9 Avatars / referral / copy (shared) · 10 Profile dropdown ·
             11 Mobile drawer · 12 Breakpoints · 13 Reduced motion

   NOTE: Aurora / accent tokens neeche hero, domains, cta, faq jaise sections
   ke liye hain. Jo token project me kahin use nahi hota use delete kar sakte ho.
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
    /* Brand (red) */
    --brand-red: #C8102E;  --brand-red-dark: #8f0a20;  --brand-red-light: #E4142F;
    --brand-red-soft: rgba(200, 16, 46, 0.08);  --brand-red-glow: rgba(200, 16, 46, 0.28);
    --brand-gradient: linear-gradient(135deg, #8f0a20 0%, #C8102E 55%, #E4142F 100%);
    --shine-gradient: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.55) 50%, transparent 100%);

    /* Header theme (blue + white) — header / drawer ke saare colors yahin se */
    --hb-blue: #008bdc;  --hb-blue-dark: #0072b8;  --hb-blue-soft: #eaf5fc;
    --hb-blue-tint:   rgba(0, 139, 220, 0.14);     /* chhote icon / copy button background */
    --hb-blue-border: rgba(0, 139, 220, 0.45);     /* dashed referral border */
    --hb-ink: #1d2433;  --hb-text: #3c4150;  --hb-muted: #667085;
    --hb-line: #e6e9ef;  --hb-panel: #f6f8fb;
    --hb-alert: #d92d20;                           /* "Registration not started" */
    --hb-ok: #22c55e;                              /* copied */
    --hd-radius: 0px;                              /* header buttons/cards: 0 = square, 4px = halka round */
    --drawer-x: 1.1rem;                            /* drawer ka left/right padding */

    /* Backwards-compatible names (purane sections use karte hain) */
    --bg-main: #ffffff;  --bg-header: #ffffff;
    --border-subtle: #ececef;  --border-medium: #dcdfe4;
    --text-primary: #14213d;  --text-muted: #5c6478;  --text-light: #9297a6;
    --gold-accent: var(--brand-red);  --gold-hover: var(--brand-red-dark);  --gold-soft: var(--brand-red-soft);
    --text-on-gold: #ffffff;  --navy-deep: #0e1a30;  --blue-gradient: var(--brand-gradient);
    --danger: #e53935;  --danger-soft: rgba(229, 57, 53, 0.07);
    --h-text: #17181c;  --h-text-muted: #6b6f76;  --h-border: #e9e9ee;  --h-surface: #ffffff;

    /* Layout + type */
    --font-base: 1rem;  --font-nav: 0.72rem;
    --font-serif: 'Lora', 'Georgia', serif;
    --font-sans: 'Bricolage Grotesque', 'Inter', sans-serif;
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --max-width: 1440px;
    --navbar-height: 68px;

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
    --transition: color .28s var(--ease), background-color .28s var(--ease),
                  border-color .28s var(--ease), box-shadow .28s var(--ease),
                  transform .28s var(--ease), opacity .28s var(--ease);

    /* Shadow + radius */
    --shadow-xs: 0 1px 2px rgba(14, 26, 48, 0.05);
    --shadow-sm: 0 6px 20px rgba(14, 26, 48, 0.08);
    --shadow-md: 0 16px 40px rgba(14, 26, 48, 0.12);
    --shadow-accent: 0 8px 20px rgba(200, 16, 46, 0.24);
    --radius-sm: 6px;  --radius-md: 10px;  --radius-full: 999px;  --radius-btn: 8px;

    /* Aurora dark theme (hero / domains / deliverables / cta / why / faq) */
    --bg-void: #060a16;  --bg-deep: #0a1128;
    --bg-panel: rgba(255, 255, 255, 0.04);  --border-soft: rgba(255, 255, 255, 0.08);
    --text-white: #f4f6fb;  --aurora-text-muted: #8b93ac;
    --blue-primary: #3b82f6;  --blue-deep: #1d4ed8;
    --violet-accent: #8b5cf6;  --cyan-accent: #22d3ee;  --amber-accent: #fbbf24;
    --gradient-aurora: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 40%, #8b5cf6 75%, #22d3ee 100%);
    --gradient-text: linear-gradient(90deg, #60a5fa 0%, #a78bfa 60%, #22d3ee 100%);

    /* Accent trio (.accent-violet / .accent-cyan / .accent-blue) */
    --accent-violet-strong: #7c3aed;  --accent-violet-light: #a78bfa;
    --accent-violet-tint: rgba(139, 92, 246, 0.14);  --accent-violet-border: rgba(167, 139, 250, 0.45);  --accent-violet-shadow: rgba(124, 58, 237, 0.18);
    --accent-cyan-strong: #0891b2;  --accent-cyan-light: #22d3ee;
    --accent-cyan-tint: rgba(34, 211, 238, 0.14);  --accent-cyan-border: rgba(34, 211, 238, 0.4);  --accent-cyan-shadow: rgba(34, 211, 238, 0.16);
    --accent-blue-strong: #1d4ed8;  --accent-blue-light: #60a5fa;
    --accent-blue-tint: rgba(59, 130, 246, 0.14);  --accent-blue-border: rgba(96, 165, 250, 0.45);  --accent-blue-shadow: rgba(37, 99, 235, 0.2);
}


/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--navbar-height) + 12px);   /* anchor links header ke neeche na chhupein */
    scrollbar-width: none;                                    /* native scrollbar hidden */
}
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* Overlay scrollbar (JS: app.js "overlay scrollbar" block) */
.tk-scrollbar {
    position: fixed; right: 0; bottom: 0;
    top: var(--header-height, var(--navbar-height));
    width: 14px; z-index: 2000;
    pointer-events: none; opacity: 0;
    transition: opacity 0.3s var(--ease);
}
.tk-scrollbar.is-visible { opacity: 1; }
.tk-scrollbar-thumb {
    position: absolute; right: 3px; top: 0;
    width: 6px; min-height: 40px;
    background: rgba(110, 112, 124, 0.7);
    border-radius: 999px;
    pointer-events: auto; cursor: grab; touch-action: none;
    transition: width 0.15s var(--ease), background-color 0.15s var(--ease);
}
.tk-scrollbar-thumb:hover,
.tk-scrollbar.is-dragging .tk-scrollbar-thumb { width: 9px; background: rgba(80, 82, 94, 0.85); }
.tk-scrollbar.is-dragging .tk-scrollbar-thumb { cursor: grabbing; }

body {
    font-family: var(--font-sans);
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-main);
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
button { background: none; border: none; font: inherit; color: inherit; cursor: pointer; }
ul { list-style: none; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 2.5rem; }
@media (min-width: 1400px) { .container { padding: 0 3.5rem; } }


/* ==========================================================================
   3. ACCESSIBILITY
   ========================================================================== */
.skip-link {
    position: fixed; top: 0; left: 12px; z-index: 10000;
    padding: 0.7rem 1.1rem;
    background: var(--hb-blue); color: #fff;
    font-family: var(--font-body); font-size: 0.85rem; font-weight: 700;
    box-shadow: var(--shadow-sm);
    transform: translateY(-150%);
    transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); outline: none; }

/* Keyboard focus ring: site me red, header/drawer me blue */
:where(a, button, [role="menuitem"]):focus-visible {
    outline: 2px solid var(--brand-red);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}
.site-header :where(a, button, [role="menuitem"]):focus-visible,
.mobile-drawer :where(a, button, [role="menuitem"]):focus-visible {
    outline-color: var(--hb-blue);
    border-radius: var(--hd-radius);
}


/* ==========================================================================
   4. HEADER SHELL + LOGO
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 1000; background: #fff; border-bottom: 1px solid var(--hb-line); }
.navbar { display: flex; align-items: center; height: var(--navbar-height); gap: 1.5rem; position: relative; }

.logo-group { display: flex; align-items: center; flex-shrink: 0; z-index: 10; }
.logo-box { height: 46px; display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }
.brand-logo-img { height: 95%; width: auto; max-width: 110%; object-fit: contain; }
.logo-text-img { height: 42px; width: auto; max-width: none; object-fit: contain; flex-shrink: 0; }


/* ==========================================================================
   5. DESKTOP NAV  (Menu ▾ · Internships ▾ · Services)
   ========================================================================== */
.desktop-nav { display: flex; align-items: center; min-width: 0; margin-left: 0.75rem; }
.desktop-nav-menu { display: flex; align-items: center; gap: 0.15rem; }
.desktop-nav-menu > li { position: relative; }

.desktop-nav-menu .nav-link {
    display: inline-flex; align-items: center; gap: 7px;
    height: 40px; padding: 0 0.95rem;
    font-family: var(--font-body); font-size: 0.93rem; font-weight: 500; line-height: 1;
    white-space: nowrap;
    color: var(--hb-ink);
    transition: color 0.2s var(--ease);
}
.desktop-nav-menu .nav-link:hover,
.desktop-nav-menu .nav-link.is-open,
.desktop-nav-menu .nav-link.is-active { color: var(--hb-blue); }

/* Menu | Internships | Services — items ke beech chhoti vertical line (Register | For Partners jaisi) */
.desktop-nav-menu > li + li::before {
    content: ''; position: absolute; left: -0.075rem; top: 50%;
    width: 1px; height: 20px; transform: translateY(-50%);
    background: var(--hb-line);
    pointer-events: none;
}

.nav-chevron { flex-shrink: 0; transition: transform 0.2s var(--ease); }
.nav-link[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }


/* ==========================================================================
   6. HEADER ACTIONS  (notice · Login · Register · | · For Partners >)
   ========================================================================== */
.header-actions { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; flex-shrink: 0; z-index: 10; }
.navbar-divider { width: 1px; height: 28px; margin: 0 0.25rem; background: var(--hb-line); flex-shrink: 0; }

/* Alert text — visitor aur logged-in dono ko dikhta hai (desktop + mobile) */
.header-notice { margin-right: 0.5rem; font-size: 0.85rem; color: var(--hb-alert); }

.btn-login, .btn-register {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.6rem 1.3rem;
    font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; line-height: 1.2;
    white-space: nowrap;
    border: 1.5px solid var(--hb-blue);
    border-radius: var(--hd-radius);
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-login { color: var(--hb-blue); background: #fff; }
.btn-login:hover { background: var(--hb-blue-soft); }
.btn-register { color: #fff; background: var(--hb-blue); }
.btn-register:hover { background: var(--hb-blue-dark); border-color: var(--hb-blue-dark); }

.btn-partners {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 0.5rem 0.25rem;
    font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
    white-space: nowrap;
    color: var(--hb-blue);
    transition: color 0.2s var(--ease);
}
.btn-partners:hover { color: var(--hb-blue-dark); }

/* Mobile triggers (desktop par hidden) */
.menu-toggle {
    display: none;
    flex-direction: column; justify-content: center;
    gap: 5px; width: 38px; height: 38px; padding: 0.45rem;
    border-radius: 50%;
}
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--hb-ink); border-radius: 2px; transition: transform 0.28s var(--ease), opacity 0.28s var(--ease); }
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-avatar-btn { display: none; }


/* ==========================================================================
   7. MEGA MENU  (Menu ▾ aur Internships ▾ — full width panels)
   ========================================================================== */
.mega-menu {
    position: absolute; left: 0; right: 0; top: 100%;
    max-height: calc(100vh - var(--navbar-height) - 8px);
    overflow-y: auto;
    background: var(--hb-panel);
    border-bottom: 1px solid var(--hb-line);
    box-shadow: 0 22px 34px -22px rgba(16, 24, 40, 0.28);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0s linear 0.18s;
    z-index: 1100;
}
.mega-menu.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.mega-grid {
    display: grid;
    grid-template-columns: repeat(var(--mega-cols, 4), minmax(0, 1fr));
    gap: 2.5rem;
    padding: 2rem 0 2.25rem;
}
.mega-col h3 {
    margin-bottom: 0.9rem; padding-bottom: 0.85rem;
    font-family: var(--font-body); font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--hb-muted);
    border-bottom: 1px solid #dde2ea;
}
.mega-links-2 { columns: 2; column-gap: 2rem; }
.mega-links-3 { columns: 3; column-gap: 2rem; }
.mega-links-4 { columns: 4; column-gap: 2rem; }
.mega-col a {
    display: block; break-inside: avoid; padding: 0.42rem 0;
    font-size: 0.95rem; font-weight: 500; color: var(--hb-ink);
    transition: color 0.15s var(--ease);
}
.mega-col a:hover, .mega-col a.is-active { color: var(--hb-blue); }
.mega-col a.is-active { font-weight: 600; }


/* ==========================================================================
   8. ROLE BADGES
   ========================================================================== */
.role-badge {
    display: inline-block; width: fit-content; padding: 2px 8px;
    font-size: 0.55rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    border-radius: var(--hd-radius);
}
.badge-admin { background: rgba(0, 114, 184, 0.12); color: var(--hb-blue-dark); }
.badge-user  { background: var(--hb-blue-soft); color: var(--hb-blue); }
.badge-guest, .badge-visitor { background: rgba(107, 114, 128, 0.1); color: #6b7280; }


/* ==========================================================================
   9. SHARED: avatars · referral box · copy button
      (desktop dropdown + mobile drawer dono yahi use karte hain)
   ========================================================================== */
.header-avatar, .dd-avatar, .drawer-avatar {
    flex-shrink: 0; border-radius: 50%; object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--hb-blue);
}
.header-avatar { width: 36px; height: 36px; transition: transform 0.2s var(--ease); }
.dd-avatar     { width: 42px; height: 42px; }
.drawer-avatar { width: 46px; height: 46px; }
@media (hover: hover) and (pointer: fine) {
    .profile-trigger:hover .header-avatar { transform: scale(1.05); }
}

.dd-referral-row, .drawer-referral-inline {
    display: flex; align-items: center;
    background: var(--hb-blue-soft);
    border: 1px dashed var(--hb-blue-border);
    border-radius: var(--hd-radius);
}
.dd-referral-row { justify-content: space-between; gap: 6px; margin-top: 8px; padding: 6px 10px; }
.drawer-referral-inline { gap: 6px; width: fit-content; margin-top: 3px; padding: 4px 9px; }

.dd-copy-btn, .drawer-copy-ref {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    color: var(--hb-blue); background: var(--hb-blue-tint);
    border-radius: var(--hd-radius);
    transition: var(--transition);
}
.dd-copy-btn     { width: 24px; height: 24px; font-size: 0.6rem; }
.drawer-copy-ref { width: 20px; height: 20px; font-size: 0.58rem; }
.dd-copy-btn:hover, .drawer-copy-ref:hover { background: var(--hb-blue); color: #fff; }
.dd-copy-btn.copied, .drawer-copy-ref.copied { background: var(--hb-ok); color: #fff; }


/* ==========================================================================
   10. DESKTOP PROFILE DROPDOWN (logged-in)
   ========================================================================== */
.desktop-profile-wrap { position: relative; display: inline-block; }
.profile-trigger { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; }
.dropdown-arrow { margin-right: 2px; font-size: 0.58rem; color: var(--hb-muted); transition: transform 0.22s var(--ease-out); }
.profile-trigger[aria-expanded="true"] .dropdown-arrow { transform: rotate(180deg); }

.desktop-dropdown {
    position: absolute; right: 0; top: calc(100% + 14px);
    width: 256px;
    background: #fff;
    border: 1px solid var(--hb-line);
    border-radius: var(--hd-radius);
    box-shadow: 0 14px 30px -12px rgba(16, 24, 40, 0.22);
    overflow: hidden; z-index: 1100;
    opacity: 0; visibility: hidden;
    transform: translateY(8px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out), visibility 0s linear 0.2s;
}
.desktop-dropdown.active {
    opacity: 1; visibility: visible; transform: none;
    transition-delay: 0s;
}

.dd-user-card { padding: 1rem 1.05rem 0.85rem; background: var(--hb-panel); border-bottom: 1px solid var(--hb-line); }
.dd-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.dd-user-info { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.dd-name-row { display: flex; align-items: center; gap: 6px; }
.dd-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.82rem; font-weight: 700; color: var(--hb-ink); }
.dd-email { display: flex; align-items: center; gap: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.64rem; color: var(--hb-muted); }
.dd-email .fas { flex-shrink: 0; font-size: 0.56rem; color: var(--hb-blue); }
.dd-last-login { display: flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 0.6rem; color: #98a2b3; }
.dd-last-login .fas { flex-shrink: 0; font-size: 0.56rem; color: #c4cad4; }

.dd-referral-label { display: flex; align-items: center; gap: 5px; flex-shrink: 0; font-size: 0.6rem; color: var(--hb-muted); }
.dd-referral-label i { font-size: 0.6rem; color: var(--hb-blue); }
.dd-referral-code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'Courier New', monospace; font-size: 0.68rem; font-weight: 700; letter-spacing: 1px; color: var(--hb-blue-dark); }

.dd-links { padding: 0.35rem 0; }
.dd-link {
    position: relative; display: flex; align-items: center; gap: 10px;
    padding: 0.6rem 1.05rem;
    font-size: 0.76rem; font-weight: 500; color: #344054;
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.dd-link i { width: 14px; flex-shrink: 0; font-size: 0.74rem; color: var(--hb-blue); }
.dd-link:hover, .dd-link.is-active { background: var(--hb-blue-soft); color: var(--hb-blue); }
.dd-divider { height: 1px; margin: 0.3rem 0; background: var(--hb-line); }
.dd-logout, .dd-logout i { color: var(--danger); }
.dd-logout:hover { background: #fff5f5; color: #c62828; }


/* ==========================================================================
   11. MOBILE DRAWER (base — desktop par hidden)
   ========================================================================== */
.mobile-drawer { display: none; }
body.drawer-open { overflow: hidden !important; }


/* ==========================================================================
   12. RESPONSIVE
   ========================================================================== */

/* ---- ≤992px: mobile / tablet navigation ---- */
@media (max-width: 992px) {
    :root { --navbar-height: 60px; }
    .container { padding: 0 1.4rem; }
    .logo-box { height: 40px; }
    .logo-text-img { height: 38px; }

    /* .header-notice yahan hide NAHI hota — mobile par bhi dikhta hai */
    .desktop-nav, .mega-menu, .navbar-divider,
    .site-header .btn-login, .site-header .btn-register, .site-header .btn-partners,
    .desktop-profile-wrap { display: none !important; }

    .header-notice {
        margin-right: 0.25rem; max-width: 110px;
        font-size: 0.7rem; font-weight: 500; line-height: 1.2; text-align: right;
    }

    .menu-toggle { display: flex !important; }
    .mobile-avatar-btn {
        position: relative; display: flex !important; align-items: center; justify-content: center;
        width: 36px; height: 36px; padding: 0; flex-shrink: 0; border-radius: 50%;
    }
    .mobile-avatar-btn .avatar-icon-state { transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); }
    .mobile-avatar-btn .avatar-close-state {
        position: absolute; inset: 0;
        display: flex; align-items: center; justify-content: center;
        opacity: 0; pointer-events: none;
        transition: opacity 0.2s var(--ease);
    }
    .mobile-avatar-btn .avatar-close-state span { position: absolute; width: 20px; height: 2px; background: var(--hb-ink); border-radius: 2px; }
    .mobile-avatar-btn .avatar-close-state span:nth-child(1) { transform: rotate(45deg); }
    .mobile-avatar-btn .avatar-close-state span:nth-child(2) { transform: rotate(-45deg); }
    .mobile-avatar-btn.drawer-open .avatar-icon-state  { opacity: 0; transform: scale(0.7); }
    .mobile-avatar-btn.drawer-open .avatar-close-state { opacity: 1; }

    /* ---- Drawer panel ---- */
    .mobile-drawer {
        display: block; position: fixed;
        top: var(--navbar-height); left: 0;
        width: 100%; height: calc(100dvh - var(--navbar-height));
        background: #fff;
        border-top: 1px solid var(--hb-line);
        box-shadow: 0 16px 34px rgba(16, 24, 40, 0.14);
        z-index: 999; overflow: hidden;
        transform-origin: top; transform: scaleY(0);
        opacity: 0; visibility: hidden; pointer-events: none;
        transition: transform 0.32s var(--ease-out), opacity 0.2s ease, visibility 0s linear 0.32s;
    }
    .mobile-drawer.active {
        transform: scaleY(1); opacity: 1; visibility: visible; pointer-events: auto;
        transition-delay: 0s;
    }
    .drawer-inner { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

    /* Drawer text: kuch bhi CAPITAL nahi (style.css ka uppercase override) — sirf role badge capital */
    .mobile-drawer *:not(.role-badge) { text-transform: none !important; letter-spacing: normal !important; }

    /* Logged-in profile card (order 0) */
    .drawer-profile-card { order: 0; display: flex; align-items: center; gap: 12px; flex-shrink: 0; padding: 0.95rem var(--drawer-x); background: var(--hb-panel); border-bottom: 1px solid var(--hb-line); }
    .drawer-user-info { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 3px; }
    .drawer-name-badge-row { display: flex; align-items: center; gap: 6px; width: 100%; }
    .drawer-user-name { max-width: 130px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; font-weight: 700; color: var(--hb-ink); }
    .drawer-name-badge-row .role-badge { flex-shrink: 0; }
    .drawer-meta-row { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; overflow: hidden; }
    .drawer-user-email { display: flex; align-items: center; flex: 1; gap: 3px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.64rem; color: var(--hb-muted); }
    .drawer-user-email .fas { flex-shrink: 0; font-size: 0.56rem; color: var(--hb-blue); }
    .drawer-user-login { display: flex; align-items: center; flex-shrink: 0; gap: 3px; white-space: nowrap; font-size: 0.58rem; color: var(--hb-muted); }
    .drawer-user-login .fas { flex-shrink: 0; font-size: 0.56rem; }
    .drawer-referral-inline i { font-size: 0.58rem; color: var(--hb-blue); }
    .drawer-referral-inline span { font-size: 0.62rem; color: var(--hb-muted); }
    .drawer-referral-inline strong { font-family: 'Courier New', monospace; font-size: 0.66rem; letter-spacing: 0.5px; color: var(--hb-blue-dark); }

    /* Nav list (order 1): chhota icon + simple text */
    .drawer-nav-list {
        order: 1; display: flex; flex-direction: column; flex: 0 1 auto;
        width: 100%; min-height: 0; margin: 0;
        padding: 0.35rem var(--drawer-x) 0.25rem;
        overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    }
    .drawer-nav-list li { width: 100%; }
    .drawer-nav-list .nav-link {
        display: flex; align-items: center; gap: 12px; width: 100%;
        padding: 0.5rem 0;
        font-family: var(--font-body); font-size: 0.95rem; font-weight: 400;
        color: var(--hb-text);
        transition: color 0.15s var(--ease);
    }
    .drawer-nav-list .nav-link:hover,
    .drawer-nav-list .nav-link:active,
    .drawer-nav-list .nav-link.is-active { color: var(--hb-blue); }
    .drawer-nav-list .nav-link.is-active { font-weight: 500; }
    .drawer-nav-list .nav-icon-wrap {
        display: inline-flex; align-items: center; justify-content: center;
        width: 20px; flex-shrink: 0;
        font-size: 0.8rem; color: var(--hb-blue);
    }
    .drawer-nav-list .nav-link:hover .nav-icon-wrap,
    .drawer-nav-list .nav-link.is-active .nav-icon-wrap { color: var(--hb-blue-dark); }

    /* Visitor: Register / Login (order 2) — simple text links */
    .drawer-auth {
        order: 2; display: flex; flex-direction: column-reverse; flex-shrink: 0;   /* Register upar, Login neeche */
        margin: 0.35rem var(--drawer-x) 0; padding: 0.35rem 0 0.5rem;
        border-top: 1px solid var(--hb-line);
    }
    .btn-drawer-signin, .btn-drawer-register {
        display: block; padding: 0.8rem 0;
        font-family: var(--font-body); font-size: 0.95rem; font-weight: 400;
        color: var(--hb-text); text-align: left;
    }
    .btn-drawer-signin:hover, .btn-drawer-register:hover,
    .btn-drawer-signin:active, .btn-drawer-register:active { color: var(--hb-blue); }

    /* Footer (order 3) */
    .drawer-footer { order: 3; margin-top: auto; flex-shrink: 0; background: var(--hb-panel); border-top: 1px solid var(--hb-line); }
    .drawer-footer-loggedin, .drawer-footer-guest { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.8rem var(--drawer-x); }
    .drawer-footer-left, .drawer-contact-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
    .drawer-email, .drawer-phone { display: flex; align-items: center; gap: 4px; }
    .drawer-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.68rem; font-weight: 600; color: var(--hb-ink); }
    .drawer-phone { font-size: 0.63rem; color: var(--hb-muted); }
    .drawer-email .fas, .drawer-phone .fas { width: 11px; flex-shrink: 0; font-size: 0.62rem; color: var(--hb-blue); }

    /* Social icons: jitne bhi ho, line me na aayein to neeche wrap ho jayein */
    .drawer-footer-socials, .drawer-socials { display: flex; flex-wrap: wrap; gap: 0.4rem; min-width: 0; }
    .drawer-socials { justify-content: flex-end; }
    .drawer-footer-socials { margin-top: 5px; }
    .drawer-footer-socials a, .drawer-socials a {
        display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
        width: 26px; height: 26px;
        font-size: 0.68rem; color: var(--hb-muted);
        background: #fff; border: 1px solid var(--hb-line); border-radius: var(--hd-radius);
        transition: var(--transition);
    }
    .drawer-footer-socials a:active, .drawer-socials a:active { color: #fff; background: var(--hb-blue); border-color: var(--hb-blue); }

    .drawer-signout-btn {
        display: inline-flex; align-items: center; flex-shrink: 0; gap: 0.4rem;
        padding: 0.58rem 0.95rem;
        font-family: var(--font-body); font-size: 0.74rem; font-weight: 700; white-space: nowrap;
        color: var(--danger);
        background: var(--danger-soft); border: 1px solid rgba(229, 57, 53, 0.25); border-radius: var(--hd-radius);
        transition: background-color 0.15s, border-color 0.15s;
    }
    .drawer-signout-btn i { font-size: 0.72rem; color: var(--danger); }
    .drawer-signout-btn:active { background: rgba(229, 57, 53, 0.16); border-color: rgba(229, 57, 53, 0.4); }
}

/* ---- 993–1280px: laptop, thoda compact ---- */
@media (min-width: 993px) and (max-width: 1280px) {
    .container { padding: 0 1.75rem; }
    .navbar { gap: 1rem; }
    .desktop-nav-menu .nav-link { padding: 0 0.7rem; font-size: 0.88rem; }
    .btn-login, .btn-register { padding: 0.55rem 1rem; font-size: 0.86rem; }
    .btn-partners { font-size: 0.86rem; }
    .mega-grid { gap: 1.5rem; }
    .mega-col a { font-size: 0.88rem; }
}

/* ---- 577–992px: tablet — drawer right side panel + dim backdrop ---- */
@media (min-width: 577px) and (max-width: 992px) {
    .mobile-drawer {
        left: auto; right: 0;
        width: min(400px, 92vw);
        border-left: 1px solid var(--hb-line); border-top: none;
        transform-origin: top right;
    }
    body.drawer-open::after {
        content: ''; position: fixed; inset: var(--navbar-height) 0 0 0;
        background: rgba(16, 24, 40, 0.35);
        z-index: 998; pointer-events: none;
    }
}

/* ---- ≤576px: small mobile ---- */
@media (max-width: 576px) {
    .container { padding: 0 1.1rem; }
    .logo-box { height: 38px; }
    .logo-text-img { height: 36px; }
    .header-notice { max-width: 88px; font-size: 0.66rem; }

    /* Drawer footer: chhote phone par contact upar, social icons neeche (poori width) */
    .drawer-footer-guest { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
    .drawer-socials { justify-content: flex-start; }
    .drawer-footer-loggedin { flex-wrap: wrap; }
    .drawer-footer-left { flex: 1 1 60%; }
    .drawer-email { white-space: normal; word-break: break-all; }   /* lamba email screen se bahar na jaye */
}

/* ---- ≤360px: bahut chhote phones ---- */
@media (max-width: 360px) {
    .logo-text-img { height: 32px; }
    .header-notice { max-width: 72px; font-size: 0.62rem; }
    .drawer-footer-socials a, .drawer-socials a { width: 24px; height: 24px; font-size: 0.64rem; }
    .drawer-footer-socials, .drawer-socials { gap: 0.3rem; }
    .drawer-nav-list .nav-link { font-size: 0.9rem; }
}


/* ==========================================================================
   13. REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}