/* ── Shared styles (all pages) ────────────────────────────────── */

/* ── CSS Custom Properties (Light Mode) ──────────────────────── */
:root {
    --bg-primary: #f5f5f7;
    --bg-card: #ffffff;
    --bg-badge: #e8e8ed;
    --bg-banner: #1d1d1f;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #a1a1a6;
    --border-color: #d2d2d7;
    --border-light: #e8e8ed;
    --accent: #0071e3;
    --accent-hover: #005bb5;
    --danger: #ff3b30;
    --success: #34c759;
    --warning: #ff9500;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.15);
}

/* ── Dark Mode ───────────────────────────────────────────────── */
[data-theme="dark"] {
    --bg-primary: #1c1c1e;
    --bg-card: #2c2c2e;
    --bg-badge: #3a3a3c;
    --bg-banner: #000000;
    --text-primary: #f5f5f7;
    --text-secondary: #98989d;
    --text-muted: #636366;
    --border-color: #48484a;
    --border-light: #3a3a3c;
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --danger: #ff453a;
    --success: #30d158;
    --warning: #ff9f0a;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.5);
}

/* ── Site banner ──────────────────────────────────────────────── */
.site-banner {
    background: var(--bg-banner);
    color: #fff;
    text-align: center;
    padding: 0.3rem 1rem;
    font-size: clamp(0.6rem, 2.5vw, 0.875rem);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.02em;
}

/* ── Toast notification ──────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #ffffff;
    background: var(--success);
    box-shadow: 0 4px 12px var(--shadow-medium);
    opacity: 1;
    transition: opacity 0.4s ease;
    z-index: 10000;
    text-align: center;
    max-width: 90%;
}
.toast.error { background: var(--danger); }
.toast.hidden { opacity: 0; pointer-events: none; }

/* ── Hamburger button ────────────────────────────────────────── */
.hamburger-btn {
    position: fixed;
    top: 0.6rem;
    right: 0.75rem;
    z-index: 5000;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    box-shadow: 0 2px 8px var(--shadow-light);
    transition: background 0.2s;
}
[data-theme="dark"] .hamburger-btn {
    background: rgba(44,44,46,0.92);
}
.hamburger-btn:hover {
    background: var(--bg-badge);
}
.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.2s;
}
.hamburger-btn.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.open span:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Nav overlay & drawer ────────────────────────────────────── */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 4000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.nav-drawer {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: var(--bg-primary);
    z-index: 4500;
    box-shadow: -4px 0 16px var(--shadow-medium);
    transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow-y: auto;
    padding: 4rem 1.25rem 2rem;
}
.nav-drawer.open {
    right: 0;
}
.nav-drawer a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background 0.15s;
}
.nav-drawer a:hover {
    background: var(--bg-badge);
}
.nav-drawer a.active {
    background: var(--accent);
    color: #fff;
}
.nav-drawer a .nav-icon {
    font-size: 1.25rem;
    width: 1.5rem;
    text-align: center;
}
.nav-drawer .nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.75rem 0;
}
.nav-drawer .nav-logout {
    color: var(--danger);
}

/* ── Dark Mode Toggle in Drawer ──────────────────────────────── */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.theme-toggle:hover {
    background: var(--bg-badge);
}
.theme-toggle .nav-icon {
    font-size: 1.25rem;
    width: 1.5rem;
    text-align: center;
}

/* ── Hidden utility ──────────────────────────────────────────── */
.hidden { display: none !important; }
