/* ════════════════════════════════════════════════
   Header & Navigation
   ════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 16px;
    background: rgba(7, 7, 18, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    width: 100%;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}
.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    padding: 8px;
    box-shadow: 0 4px 16px var(--accent-glow);
}
.logo-icon svg { width: 100%; height: 100%; color: white; }
.logo-text { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.logo-text .accent { color: var(--accent-light); }

.header-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 20px;
}
.badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ── Header actions wrapper ─────────────────── */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}


/* ── More menu dropdown ── */
.hdr-more-wrapper {
    position: relative;
}

.hdr-more-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary, #94a3b8);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.hdr-more-btn:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.35);
    color: var(--text-primary, #f1f5f9);
}

.hdr-more-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #1e1e3a;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 200;
    padding: 6px;
    display: flex;
    flex-direction: column;
}

.hdr-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #cbd5e1);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
    text-align: left;
    width: 100%;
}

.hdr-more-item:hover {
    background: rgba(139, 92, 246, 0.12);
    color: var(--text-primary, #f1f5f9);
}

/* Hide button labels on small screens */
.hdr-btn-label {
    font-size: 13px;
}

@media (max-width: 768px) {
    .hdr-btn-label {
        display: none;
    }
    .hdr-more-btn {
        padding: 8px;
        gap: 0;
    }
    .dashboard-nav-btn .hdr-btn-label {
        display: none;
    }
    .dashboard-nav-btn {
        padding: 8px;
        gap: 0;
    }
    .header { padding: 0 10px; }
    .header-actions { gap: 6px; }
    .logo-text { font-size: 15px; }
    .header-left { gap: 2px; }
}

@media (max-width: 480px) {
    .header-inner { height: 54px; }
    .header-actions { gap: 4px; }
    .logo-icon { width: 30px; height: 30px; padding: 6px; }
    .logo-text { font-size: 14px; }
    .history-btn .hdr-btn-label { display: none; }
    .hist-badge { position: relative; top: 0; right: 0; }
    .dashboard-nav-btn { display: none; }
    .gsearch-trigger { width: 32px; height: 32px; }
    .notif-bell-btn { width: 32px; height: 32px; }
    .theme-toggle-btn { width: 32px; height: 32px; }
}

/* Light mode */
html.light-mode .hdr-more-btn {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.04);
    color: #4b5563;
}

html.light-mode .hdr-more-btn:hover {
    background: rgba(109, 40, 217, 0.08);
    color: #6d28d9;
}

html.light-mode .hdr-more-panel {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

html.light-mode .hdr-more-item {
    color: #4b5563;
}

html.light-mode .hdr-more-item:hover {
    background: rgba(109, 40, 217, 0.06);
    color: #6d28d9;
}


/* ═══════════════════════════════════════════════
   Sidebar Navigation
   ═══════════════════════════════════════════════ */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9998; opacity: 0; pointer-events: none; transition: opacity 0.3s; backdrop-filter: blur(2px); }
.sidebar-overlay.sidebar-overlay-show { opacity: 1; pointer-events: auto; }

.app-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 280px; background: rgba(15,15,30,0.98); border-right: 1px solid rgba(255,255,255,0.08); z-index: 9999; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); overflow-y: auto; display: flex; flex-direction: column; }
.app-sidebar.sidebar-open { transform: translateX(0); }

.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-title { font-size: 16px; font-weight: 700; color: var(--text-primary, #f1f5f9); }
.sidebar-close { background: none; border: none; color: var(--text-secondary, #94a3b8); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: background 0.2s; }
.sidebar-close:hover { background: rgba(255,255,255,0.06); color: var(--text-primary, #f1f5f9); }

.sidebar-group { padding: 12px 12px 4px; }
.sidebar-group-label { font-size: 11px; font-weight: 700; color: var(--text-muted, #64748b); text-transform: uppercase; letter-spacing: 0.5px; padding: 0 8px 8px; }

.sidebar-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: none; background: none; border-radius: 10px; color: var(--text-secondary, #cbd5e1); font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.15s; text-align: left; }
.sidebar-item:hover { background: rgba(139,92,246,0.1); color: var(--text-primary, #f1f5f9); }
.sidebar-item:active { background: rgba(139,92,246,0.15); }
.sidebar-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }

/* Light mode */
.light-mode .app-sidebar { background: rgba(255,255,255,0.98); border-right-color: rgba(0,0,0,0.08); }
.light-mode .sidebar-header { border-bottom-color: rgba(0,0,0,0.06); }
.light-mode .sidebar-title { color: #1e293b; }
.light-mode .sidebar-close { color: #64748b; }
.light-mode .sidebar-close:hover { background: rgba(0,0,0,0.04); color: #1e293b; }
.light-mode .sidebar-group-label { color: #94a3b8; }
.light-mode .sidebar-item { color: #475569; }
.light-mode .sidebar-item:hover { background: rgba(139,92,246,0.06); color: #1e293b; }
.light-mode .sidebar-overlay { background: rgba(0,0,0,0.3); }

@media (max-width: 320px) { .app-sidebar { width: 260px; } }


/* Sidebar toggle button (left of logo) */
.header-left { display: flex; align-items: center; gap: 4px; }
.sidebar-toggle-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: none; background: none; color: var(--text-muted, #64748b); cursor: pointer; transition: all 0.2s; flex-shrink: 0; border-radius: 6px; }
.sidebar-toggle-btn:hover { color: var(--text-primary, #f1f5f9); background: rgba(139,92,246,0.08); }
.light-mode .sidebar-toggle-btn { color: #94a3b8; }
.light-mode .sidebar-toggle-btn:hover { color: #1e293b; background: rgba(139,92,246,0.06); }
