/* ==========================================================================
   shared.css — Shared styles for yessahblessah.cc
   Sidebar, variables, reset, scrollbar, hamburger, overlay, responsive
   ========================================================================== */

/* RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* GLOBAL INTERACTIVE — cursor pointer on all clickable elements */
a, button, [role="button"], input[type="submit"], input[type="button"], .clickable {
    cursor: pointer;
}

/* 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;
    }
}

/* DESIGN TOKENS — DARK (default) — Warm Luxe Brown */
:root {
    --bg: #0e0e12;
    --surface: #1a1714;
    --surface2: #231f1a;
    --surface3: #2c2720;
    --border: #3a3328;
    --border-subtle: #302a22;
    --gold: #D4AF37;
    --gold-dim: #b8962e;
    --gold-glow: rgba(212, 175, 55, 0.12);
    --text: #F0EDE8;
    --text-dim: #8A8578;
    --text-muted: #6e6a5f;
    --accent: #22c55e;
    --accent-dim: rgba(34, 197, 94, 0.1);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.1);
    --cyan: #22d3ee;
    --cyan-dim: rgba(34, 211, 238, 0.1);
    --purple: #a78bfa;
    --purple-dim: rgba(167, 139, 250, 0.1);
}

/* DESIGN TOKENS — LIGHT */
[data-theme="light"] {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --surface2: #f0f0f0;
    --surface3: #e8e8e8;
    --border: #d4d4d4;
    --border-subtle: #e5e5e5;
    --gold: #8a6d0a;
    --gold-dim: #7a5d08;
    --gold-glow: rgba(184, 150, 15, 0.12);
    --text: #1a1a1a;
    --text-dim: #666666;
    --text-muted: #6b6b6b;
    --accent: #16a34a;
    --accent-dim: rgba(22, 163, 74, 0.08);
    --red: #dc2626;
    --red-dim: rgba(220, 38, 38, 0.08);
    --cyan: #0891b2;
    --cyan-dim: rgba(8, 145, 178, 0.08);
    --purple: #7c3aed;
    --purple-dim: rgba(124, 58, 237, 0.08);
}

/* BODY */
html {
    background: var(--bg);
    height: 100%;
    overscroll-behavior: none;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    font-weight: 300;
    max-width: 100vw;
    margin: 0;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* Grain texture overlay removed — was breaking position:fixed on iOS Safari */

/* Selection color */
::selection {
    background: var(--gold);
    color: #000;
}

/* Scroll container for mobile (Android WebView fix) — only when bottom-nav exists */
/* #app-scroll removed — position:fixed works natively on modern browsers */
/* Scroll container for mobile (Android/Telegram WebView fix) */
@media (max-width: 768px) {
    body.has-bottomnav {
        overflow: hidden;
    }
    #app-scroll {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    #app-scroll > .main-content,
    #app-scroll > main {
        flex: 1;
    }
}
.mono { font-family: 'JetBrains Mono', monospace; }

/* SERIF HEADINGS — Playfair Display */
.serif { font-family: 'Playfair Display', Georgia, serif; font-weight: 400; }

/* DISPLAY / ACCENT — Bebas Neue */
.display { font-family: 'Bebas Neue', Impact, sans-serif; font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* SIDEBAR */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px 20px;
    text-decoration: none;
    color: var(--text);
}

.sidebar-logo img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.sidebar-logo-text {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.3px;
}

.sidebar-logo-sub {
    font-size: 11px;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.7;
}

.sidebar-price {
    padding: 0 16px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-price-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.sidebar-price-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 400;
    color: var(--text);
    letter-spacing: -0.5px;
    margin-bottom: 2px;
}

.sidebar-price-change {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    margin-bottom: 8px;
}

.sidebar-price-change.up { color: var(--accent); }
.sidebar-price-change.down { color: var(--red); }

.sidebar-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    height: 32px;
}

.sidebar-sparkline .bar {
    width: 2px;
    background: var(--gold);
    border-radius: 1px;
    min-height: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.sidebar-nav > a,
.sidebar-submenu > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: color 0.1s, background 0.1s;
    cursor: pointer;
    letter-spacing: 0.01em;
}

.sidebar-nav > a:hover,
.sidebar-submenu > a:hover {
    color: var(--gold);
    background: var(--gold-glow);
}

.sidebar-nav > a svg,
.sidebar-submenu > a svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.sidebar-nav > a:hover svg,
.sidebar-nav > a.active svg,
.sidebar-submenu > a:hover svg {
    opacity: 1;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
}

.sidebar-submenu.open .submenu-arrow {
    transform: rotate(90deg);
}

.submenu-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.sidebar-submenu.open .submenu-items {
    max-height: 100px;
}

.submenu-items a {
    display: block;
    padding-top: 4px;
    padding-bottom: 4px;
    padding-left: 42px !important;
    font-size: 12px !important;
    color: var(--text-dim) !important;
    text-decoration: none;
}

.submenu-items a:hover {
    color: var(--text) !important;
}
.submenu-items a.active {
    color: var(--gold) !important;
}

.sidebar-bottom {
    padding: 16px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.sidebar-bottom a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.15s;
}

.sidebar-bottom a:first-child {
    color: var(--gold);
    font-weight: 500;
    font-size: 13px;
    padding: 8px 0;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

/* THEME TOGGLE */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-dim);
    font-size: 12px;
    transition: color 0.1s;
}
.theme-toggle:hover {
    color: var(--text);
}
.theme-toggle-btn {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}
.theme-toggle-btn::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--gold);
    border-radius: 50%;
    transition: transform 0.2s;
}
[data-theme="light"] .theme-toggle-btn::after {
    transform: translateX(16px);
}

.sidebar-bottom a:hover {
    color: var(--text);
}

.sidebar-bottom a svg {
    flex-shrink: 0;
}

/* PAGE THEME TOGGLE (fixed top-left) */
.page-theme-btn {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 250;
    width: 36px;
    height: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
}
.page-theme-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* TOP BAR (fixed container for login button) */
.top-bar {
    display: none;
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 250;
}

/* USER MENU */
.user-menu {
    position: relative;
}
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 6px 10px;
    cursor: pointer;
    transition: border-color 0.1s;
}
.user-menu-btn:hover {
    border-color: var(--gold);
}
.user-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gold);
    color: #000;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 160px;
    padding: 4px 0;
    z-index: 300;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.user-dropdown.open {
    display: block;
}
.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    font-family: 'Inter', -apple-system, sans-serif;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
}
.user-dropdown a:hover,
.user-dropdown button:hover {
    background: rgba(255,255,255,0.05);
}
.user-dropdown a svg,
.user-dropdown button svg {
    opacity: 0.6;
}

/* TOP LOGIN BUTTON (when not logged in) */
.top-login-btn {
    display: block;
    background: var(--surface);
    border: 1px solid var(--gold);
    border-radius: 8px;
    color: var(--gold);
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', -apple-system, sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}
.top-login-btn:hover {
    background: var(--gold);
    color: #000;
}

/* HAMBURGER BUTTON */
.sidebar-hamburger {
    display: none;
    position: fixed;
    top: 14px;
    right: 14px;
    left: auto;
    z-index: 250;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.1s;
}

.sidebar-hamburger:hover {
    border-color: var(--gold-dim);
}

/* SIDEBAR THEME TOGGLE */
.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    position: absolute;
    top: 14px;
    right: 14px;
}
.sidebar-theme-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: color 0.15s;
}
.sidebar-theme-btn:hover {
    color: var(--gold);
}
@media (max-width: 768px) {
    .sidebar-theme-btn {
        display: block;
    }
}

/* CLOSE BUTTON */
.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
    z-index: 210;
}

/* SIDEBAR OVERLAY (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 190;
}
.sidebar-overlay.active {
    display: block;
}

/* RESPONSIVE — Mobile sidebar */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-hamburger {
        display: none;
    }
    .sidebar-close {
        display: block;
    }
    .top-bar {
        display: block;
        right: 12px;
    }
    .main-content {
        margin-left: 0;
        padding-bottom: 72px;
    }
}

/* RESPONSIVE — Tablet bento grids (2 columns) */
@media (min-width: 769px) and (max-width: 1024px) {
    .bento {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* RESPONSIVE — Desktop */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0);
    }
    .sidebar-hamburger {
        display: none !important;
    }
    .sidebar-close {
        display: none;
    }
    .sidebar-overlay {
        display: none !important;
    }
    .top-bar {
        display: block;
    }
}

/* BOTTOM NAV (mobile) */
.bottom-nav {
    display: none;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    z-index: 200;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    flex-shrink: 0;
}
.bottom-nav::after {
    display: none;
}
.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-family: 'Inter', -apple-system, sans-serif;
    padding: 8px 12px;
    border-radius: 8px;
    transition: color 0.1s;
    -webkit-tap-highlight-color: transparent;
    min-width: 48px;
    flex: 1;
}
.bottom-nav a.active {
    color: var(--gold);
}
.bottom-nav a:hover {
    color: var(--text);
}
.bottom-nav a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.bottom-nav a span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }
}



/* MOBILE SIDEBAR (slide-in from left, CCTools style) */
.mobile-sidebar {
    display: none;
}
.mobile-sidebar.open {
    display: block;
}
.ms-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 300;
}
.ms-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 82%;
    max-width: 300px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 301;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.ms-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.ms-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ms-brand img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}
.ms-brand-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    display: block;
    line-height: 1.2;
}
.ms-brand-sub {
    font-size: 9px;
    letter-spacing: 1.2px;
    color: var(--text-dim);
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    display: block;
}
.ms-close {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.ms-close:active { color: var(--text); }
.ms-price {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.ms-price-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.ms-price-amount {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 400;
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}
.ms-price-change {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    margin-bottom: 6px;
}
.ms-price-change.up { color: var(--accent); }
.ms-price-change.down { color: var(--red); }
.ms-sparkline {
    width: 100%;
    height: 28px;
}
.ms-sparkline svg {
    width: 100%;
    height: 100%;
}
.ms-nav {
    padding: 8px 0;
    flex: 1;
}
.ms-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}
.ms-nav a:active {
    background: rgba(255,255,255,0.04);
}
.ms-nav a.active {
    background: rgba(255,255,255,0.06);
    border-left-color: var(--gold);
    color: var(--text);
}
.ms-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
}
.ms-nav a.active svg { opacity: 1; }
/* Mobile sidebar submenu */
.ms-submenu {
    /* container */
}
.ms-submenu > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}
.ms-submenu > a:active {
    background: rgba(255,255,255,0.04);
}
.ms-submenu > a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
}
.ms-arrow {
    margin-left: auto;
    font-size: 13px;
    transition: transform 0.2s;
}
.ms-submenu.open .ms-arrow {
    transform: rotate(90deg);
}
.ms-submenu-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.ms-submenu.open .ms-submenu-items {
    max-height: 120px;
}
.ms-submenu-items a {
    display: block;
    padding: 8px 16px 8px 44px;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 12px;
    transition: color 0.15s;
}
.ms-submenu-items a:active {
    color: var(--text);
}
.ms-submenu-items a.active {
    color: var(--gold);
}
.ms-social {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}
.ms-social a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 12px;
}
.ms-social a svg {
    width: 14px;
    height: 14px;
}

/* MICRO-INTERACTIONS — Fade-in-up for bento cards */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.bento-card:not(.animate-in) {
    opacity: 0;
}
.bento-card.animate-in {
    animation: fadeInUp 0.35s ease-out forwards;
}

/* STANDARDIZED BADGES */
.badge { font-size: 9px; font-weight: 600; padding: 3px 7px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: 0.5px; }
.badge.live { background: rgba(201,162,39,0.15); color: var(--gold); }
.badge.ended { background: rgba(239,68,68,0.12); color: var(--red); }
.badge.new { background: rgba(34,197,94,0.15); color: var(--accent); }
.badge.easy { background: rgba(107,114,128,0.12); color: var(--text-dim); }

/* ACCESSIBILITY */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[role="button"] { cursor: pointer; }
