/* ============================================================
   ECEL Mobile Native — Bottom Tabs + Drawer + Minimalist Top Bar
   Active only on mobile (max-width: 900px)
   ============================================================ */

/* ── Hide mobile components on desktop ─────────────────────── */
.ecel-mobile-tabs,
.ecel-drawer,
.ecel-drawer-backdrop,
.ecel-guest-menu-btn { display: none; }

@media (max-width: 900px) {

    /* ============================================================
       1. TOP BAR — minimalist
       ============================================================ */
    .navbar .nav-menu { display: none !important; }
    .navbar .nav-toggle { display: none !important; }
    .navbar .mobile-menu { display: none !important; }

    .navbar .nav-features {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        margin-left: auto;
    }

    .navbar .brand-logo { height: 40px !important; }
    .navbar .brand-title { font-size: 1rem !important; }
    .navbar .brand-subtitle { display: none !important; }

    /* Hide username + chevron — keep avatar only */
    .navbar .user-profile .username,
    .navbar .user-profile .user-profile__chevron { display: none !important; }

    /* DISABLE the desktop dropdowns on mobile (drawer takes over) */
    .navbar .user-profile .profile-dropdown,
    .navbar .nav-notifications .notifications-dropdown {
        display: none !important;
    }

    /* Avatar gets a subtle ring to indicate it's tappable */
    .navbar .user-profile__trigger {
        cursor: pointer;
        padding: 4px !important;
        border-radius: 999px;
        transition: background 0.15s ease;
    }
    .navbar .user-profile__trigger:active {
        background: rgba(239, 68, 68, 0.15);
    }

    .navbar .cta-button-nav {
        padding: 0.45rem 0.8rem !important;
        font-size: 0.75rem !important;
    }

    /* Guest hamburger button (right side, opens drawer for guests) */
    .ecel-guest-menu-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 38px; height: 38px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.08);
        color: #e5e7eb;
        font-size: 1rem;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.15s ease, transform 0.1s ease;
    }
    .ecel-guest-menu-btn:active { transform: scale(0.92); background: rgba(239, 68, 68, 0.2); }

    /* ============================================================
       2. BOTTOM TAB BAR
       ============================================================ */
    .ecel-mobile-tabs {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 999;
        background: rgba(10, 10, 14, 0.92);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        border-top: 1px solid rgba(239, 68, 68, 0.2);
        padding: 0.35rem 0;
        padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .ecel-mobile-tabs--hidden { transform: translateY(110%); }

    .ecel-mobile-tab {
        flex: 1;
        display: flex; flex-direction: column;
        align-items: center; justify-content: center;
        gap: 0.18rem;
        min-height: 52px;
        padding: 0.3rem 0.2rem;
        text-decoration: none;
        color: #9ca3af;
        font-size: 0.62rem;
        font-weight: 600;
        font-family: 'Inter', sans-serif;
        letter-spacing: 0.02em;
        position: relative;
        transition: color 0.18s ease, transform 0.12s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .ecel-mobile-tab:active { transform: scale(0.92); }
    .ecel-mobile-tab i { font-size: 1.18rem; transition: transform 0.18s ease; }
    .ecel-mobile-tab span { line-height: 1; }
    .ecel-mobile-tab.active { color: #ef4444; }
    .ecel-mobile-tab.active i { transform: scale(1.1); }
    .ecel-mobile-tab.active::before {
        content: '';
        position: absolute;
        top: 0; left: 50%;
        transform: translateX(-50%);
        width: 28px; height: 3px;
        border-radius: 0 0 3px 3px;
        background: linear-gradient(90deg, #ef4444, #dc2626);
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    }
    .ecel-mobile-tab__badge {
        position: absolute;
        top: 4px; right: 28%;
        min-width: 16px; height: 16px;
        padding: 0 4px;
        background: #ef4444;
        color: #fff;
        font-size: 0.6rem;
        font-weight: 700;
        border-radius: 999px;
        display: flex; align-items: center; justify-content: center;
        box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
        border: 2px solid rgba(10, 10, 14, 0.92);
    }
    .ecel-mobile-tab__badge--dot {
        min-width: 9px; height: 9px;
        padding: 0;
        right: 32%;
    }

    body { padding-bottom: calc(64px + env(safe-area-inset-bottom)) !important; }
    a, button { -webkit-tap-highlight-color: transparent; }

    /* ============================================================
       3. RIGHT DRAWER
       ============================================================ */
    .ecel-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        opacity: 0;
        pointer-events: none;
        z-index: 1100;
        transition: opacity 0.25s ease;
    }
    .ecel-drawer-backdrop--open {
        opacity: 1;
        pointer-events: auto;
    }

    .ecel-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0; right: 0; bottom: 0;
        width: min(86vw, 360px);
        z-index: 1101;
        background: linear-gradient(180deg, #14141a 0%, #0a0a10 100%);
        border-left: 1px solid rgba(239, 68, 68, 0.2);
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
        transform: translateX(100%);
        transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .ecel-drawer--open { transform: translateX(0); }

    /* Drawer header */
    .ecel-drawer__header {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        padding: 1.1rem 1rem 1rem;
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(220, 38, 38, 0.05));
        border-bottom: 1px solid rgba(239, 68, 68, 0.18);
    }
    .ecel-drawer__avatar-wrap {
        position: relative;
        flex-shrink: 0;
    }
    .ecel-drawer__avatar {
        width: 52px; height: 52px;
        border-radius: 999px;
        object-fit: cover;
        border: 2px solid rgba(239, 68, 68, 0.6);
        background: #1a1a22;
        display: flex; align-items: center; justify-content: center;
        color: #fff;
        font-weight: 800;
        font-size: 1.4rem;
        font-family: 'Bebas Neue', sans-serif;
    }
    .ecel-drawer__avatar--fallback {
        background: linear-gradient(135deg, #ef4444, #b91c1c);
    }
    .ecel-drawer__vip {
        position: absolute;
        bottom: -2px; right: -2px;
        width: 20px; height: 20px;
    }
    .ecel-drawer__info { flex: 1; min-width: 0; }
    .ecel-drawer__name {
        font-family: 'Bebas Neue', sans-serif;
        font-size: 1.25rem;
        color: #fff;
        letter-spacing: 0.02em;
        line-height: 1.1;
        margin-bottom: 0.3rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .ecel-drawer__meta {
        display: flex; align-items: center; gap: 0.5rem;
        font-size: 0.75rem;
    }
    .ecel-drawer__role {
        display: inline-flex; align-items: center; gap: 0.3rem;
        padding: 0.18rem 0.55rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.06);
        color: #d1d5db;
        font-weight: 600;
        font-size: 0.7rem;
    }
    .ecel-drawer__role--admin {
        background: rgba(239, 68, 68, 0.18);
        color: #fca5a5;
    }
    .ecel-drawer__role--captain {
        background: rgba(251, 191, 36, 0.18);
        color: #fcd34d;
    }
    .ecel-drawer__flag {
        width: 18px; height: 13px;
        border-radius: 2px;
        object-fit: cover;
    }
    .ecel-drawer__close {
        margin-left: auto;
        min-width: 44px; min-height: 44px;
        width: 44px; height: 44px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.06);
        border: none;
        color: #e5e7eb;
        font-size: 1.05rem;
        cursor: pointer;
        display: flex; align-items: center; justify-content: center;
        transition: background 0.15s ease, transform 0.1s ease;
    }
    .ecel-drawer__close:active {
        background: rgba(239, 68, 68, 0.25);
        transform: scale(0.92);
    }

    /* Guest header variant */
    .ecel-drawer__header--guest {
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(0, 0, 0, 0));
    }
    .ecel-drawer__guest {
        display: flex; align-items: center; gap: 0.7rem; flex: 1;
    }
    .ecel-drawer__guest-logo { width: 42px; height: 42px; object-fit: contain; }
    .ecel-drawer__guest-title {
        font-family: 'Bebas Neue', sans-serif;
        font-size: 1.1rem;
        color: #fff;
        line-height: 1.1;
    }
    .ecel-drawer__guest-link {
        color: #ef4444;
        font-size: 0.8rem;
        font-weight: 700;
        text-decoration: none;
    }

    /* Drawer scroll body */
    .ecel-drawer__scroll {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.6rem 0;
    }
    .ecel-drawer__section {
        padding: 0.2rem 0.5rem;
        display: flex; flex-direction: column;
    }
    .ecel-drawer__section + .ecel-drawer__section {
        border-top: 1px solid rgba(255, 255, 255, 0.04);
        margin-top: 0.4rem;
        padding-top: 0.6rem;
    }
    .ecel-drawer__section--footer {
        margin-top: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        padding-top: 0.8rem;
    }
    .ecel-drawer__section-label {
        padding: 0.9rem 1rem 0.4rem;
        font-size: 0.65rem;
        font-weight: 800;
        letter-spacing: 0.14em;
        color: #6b7280;
        text-transform: uppercase;
    }
    .ecel-drawer__section-label--admin { color: #f87171; }

    .ecel-drawer__link {
        display: flex; align-items: center; gap: 0.85rem;
        padding: 0.78rem 0.95rem;
        border-radius: 10px;
        color: #e5e7eb;
        font-size: 0.92rem;
        font-weight: 500;
        text-decoration: none;
        transition: background 0.15s ease, transform 0.1s ease, color 0.15s ease;
        position: relative;
    }
    .ecel-drawer__link i {
        width: 22px;
        text-align: center;
        font-size: 1rem;
        color: #9ca3af;
        transition: color 0.15s ease;
    }
    .ecel-drawer__link span { flex: 1; }
    .ecel-drawer__link:active {
        background: rgba(239, 68, 68, 0.12);
        transform: scale(0.98);
    }
    .ecel-drawer__link:hover i { color: #ef4444; }

    .ecel-drawer__link--cta {
        background: linear-gradient(135deg, #ef4444, #b91c1c);
        color: #fff;
        font-weight: 700;
        margin-bottom: 0.3rem;
    }
    .ecel-drawer__link--cta i { color: #fff; }

    .ecel-drawer__link--admin { color: #fca5a5; }
    .ecel-drawer__link--admin i { color: #fca5a5; }

    .ecel-drawer__link--logout { color: #f87171; }
    .ecel-drawer__link--logout i { color: #f87171; }

    .ecel-drawer__pill {
        flex: none !important;
        padding: 0.12rem 0.45rem;
        background: rgba(251, 191, 36, 0.18);
        color: #fcd34d;
        font-size: 0.62rem;
        font-weight: 700;
        border-radius: 999px;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }
}
