/* ═══════════════════════════════════════════════════════════
   YLG Bullion — Shared Base Stylesheet
   dashboard-styles.css

   Usage (add BEFORE your page's own <style> tag):
     <link rel="stylesheet" href="dashboard-styles.css">

   This file provides:
     1. CSS Variables  — shared design tokens
     2. Base Reset     — body, *, box-sizing
     3. Shared Layout  — .sidebar, .main-content, .dashboard-container
     4. Navigation     — .nav-item, .sidebar-nav
     5. Logo Block     — .logo-section, .logo-y-text etc.
     6. Stat Cards     — .stats-grid, .stat-card
     7. Live Price     — .live-price-section, .price-value, .live-tag
     8. Wallet         — .wallet-section, .unlock-wallet-btn
     9. Utilities      — .positive, .negative, .section-title

   Page-specific inline <style> will override anything here.
   ═══════════════════════════════════════════════════════════ */


/* ══════════════════════════════════
   1. CSS VARIABLES (Design Tokens)
   ══════════════════════════════════ */
:root {
    /* Core colours */
    --color-dark-bg:      #111111;
    --color-medium-dark:  #1A1A1A;
    --color-gold-accent:  #FFD700;
    --color-text-light:   #E0E0E0;
    --color-text-fade:    #A0A0A0;
    --color-positive:     #00B050;
    --color-negative:     #D93025;
    --color-white:        #FFFFFF;

    /* Aliases — so both var(--gold) and var(--color-gold-accent) work */
    --gold:    var(--color-gold-accent);
    --bg:      var(--color-dark-bg);
    --card:    var(--color-medium-dark);
    --text:    var(--color-text-light);
    --muted:   var(--color-text-fade);
    --green:   var(--color-positive);
    --red:     var(--color-negative);
    --white:   var(--color-white);

    /* Spacing & shape */
    --radius-sm:  6px;
    --radius:     8px;
    --radius-lg:  12px;
    --transition: 0.2s ease;
    --shadow:     0 4px 20px rgba(0, 0, 0, 0.4);

    /* Sidebar width */
    --sidebar-width: 240px;
}


/* ══════════════════════════════════
   2. BASE RESET
   ══════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--color-dark-bg);
    color: var(--color-text-light);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }

::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,215,0,0.25); border-radius: 99px; }


/* ══════════════════════════════════
   3. SHARED LAYOUT
   ══════════════════════════════════ */

/* Flex wrapper used by dashboard / chat pages */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--color-medium-dark);
    border-right: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
}

/* Main content area */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 28px 32px;
    box-sizing: border-box;
    min-height: 100vh;
}


/* ══════════════════════════════════
   4. NAVIGATION
   ══════════════════════════════════ */
.sidebar-nav {
    flex-grow: 1;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--color-text-fade);
    text-decoration: none;
    border-left: 3px solid transparent;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 13px;
    flex-shrink: 0;
}

.nav-item:hover {
    background-color: #252525;
    color: var(--color-text-light);
}

.nav-item.active {
    background-color: rgba(255, 215, 0, 0.08);
    color: var(--color-gold-accent);
    border-left-color: var(--color-gold-accent);
    font-weight: 600;
}

/* Sidebar auth / login box */
.account-required-box {
    padding: 16px;
    margin: 12px;
    background: #252525;
    border: 1px solid #333;
    border-radius: var(--radius);
    text-align: center;
}

.account-required-box p {
    font-size: 12px;
    color: var(--color-text-fade);
    margin: 4px 0;
}

.sidebar-login-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: var(--color-gold-accent);
    color: #000;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    transition: var(--transition);
}

.sidebar-login-btn:hover { background: #e6c200; }


/* ══════════════════════════════════
   5. LOGO BLOCK
   ══════════════════════════════════ */
.logo-section {
    padding: 18px 20px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-gold-accent);
    flex-shrink: 0;
}

.logo-text-group { line-height: 1; }

.logo-y-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-gold-accent);
    display: block;
}

.logo-subtext {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-light);
    letter-spacing: 2px;
    display: block;
    margin-top: 1px;
}

.logo-company {
    font-size: 9px;
    color: var(--color-text-fade);
    display: block;
    margin-top: 3px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}


/* ══════════════════════════════════
   6. PAGE HEADER
   ══════════════════════════════════ */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 18px;
    margin-bottom: 24px;
    border-bottom: 1px solid #2a2a2a;
    gap: 12px;
}

.header-title-group h2 {
    font-size: 22px;
    color: var(--color-text-light);
    margin: 0 0 4px;
}

.header-title-group p {
    font-size: 13px;
    color: var(--color-text-fade);
    margin: 0;
}

.header-actions { display: flex; gap: 8px; align-items: center; }

.header-actions .btn-login {
    padding: 8px 16px;
    border-radius: var(--radius);
    background: #333;
    color: var(--color-text-light);
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.header-actions .btn-register {
    padding: 8px 16px;
    border-radius: var(--radius);
    background: var(--color-gold-accent);
    color: #000;
    font-size: 13px;
    font-weight: 700;
    transition: var(--transition);
}

.header-actions .btn-login:hover   { background: #444; }
.header-actions .btn-register:hover { background: #e6c200; }


/* ══════════════════════════════════
   7. LIVE PRICE SECTION
   ══════════════════════════════════ */
.live-price-section {
    background: var(--color-medium-dark);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    border-top: 3px solid var(--color-gold-accent);
    border: 1px solid #2a2a2a;
    border-top: 3px solid var(--color-gold-accent);
}

.price-header {
    position: relative;
    padding-bottom: 14px;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 16px;
}

.price-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--color-text-light);
}

.live-tag {
    position: absolute;
    top: 0; right: 0;
    background: var(--color-negative);
    color: #fff;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.current-price {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
}

.price-value {
    font-size: 42px;
    font-weight: 700;
    color: var(--color-white);
    font-variant-numeric: tabular-nums;
}

.price-change {
    font-size: 16px;
    font-weight: 700;
}


/* ══════════════════════════════════
   8. STAT CARDS GRID
   ══════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.stat-card {
    background: #252525;
    border: 1px solid #2a2a2a;
    padding: 16px;
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.stat-card:hover { border-color: rgba(255,215,0,0.25); }

.stat-card h4 {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-text-fade);
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-white);
    font-variant-numeric: tabular-nums;
}


/* ══════════════════════════════════
   9. WALLET SECTION
   ══════════════════════════════════ */
.wallet-section {
    background: var(--color-medium-dark);
    border: 1px solid #2a2a2a;
    padding: 24px;
    border-radius: var(--radius-lg);
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 14px;
    margin-bottom: 18px;
}

.section-title h3 {
    margin: 0;
    font-size: 16px;
    color: var(--color-gold-accent);
}

.wallet-lock-icon {
    color: var(--color-gold-accent);
    font-size: 18px;
}

.wallet-locked-content {
    background: #222;
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
}

.wallet-large-icon {
    font-size: 40px;
    color: #444;
    margin-bottom: 12px;
    display: block;
}

.instruction-text {
    color: var(--color-text-fade);
    font-size: 14px;
    line-height: 1.6;
}

.unlock-wallet-btn {
    margin-top: 20px;
    padding: 13px 28px;
    background: var(--color-gold-accent);
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.unlock-wallet-btn:hover { background: #e6c200; transform: translateY(-1px); }


/* ══════════════════════════════════
   10. UTILITY CLASSES
   ══════════════════════════════════ */
.positive { color: var(--color-positive); }
.negative { color: var(--color-negative); }

/* Dashboard card (generic) */
.dashboard-card {
    background: var(--color-medium-dark);
    border: 1px solid #2a2a2a;
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 20px;
}

/* Gold divider */
.gold-divider {
    border: none;
    border-top: 1px solid rgba(255,215,0,0.2);
    margin: 16px 0;
}

/* Loading spinner */
.ylg-spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(255,255,255,0.08);
    border-top-color: var(--color-gold-accent);
    border-radius: 50%;
    animation: ylg-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes ylg-spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state-box {
    text-align: center;
    padding: 50px 20px;
    color: var(--color-text-fade);
}

.empty-state-box i {
    font-size: 32px;
    opacity: 0.3;
    display: block;
    margin-bottom: 12px;
}
