/* ═══════════════════════════════════════════════════════════════
   Case AI — Shared Design System
   Professional minimalist trading platform
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
    /* Backgrounds */
    --bg-primary: #0a0a0a;
    --bg-surface: #111111;
    --bg-card: #161616;
    --bg-card-hover: #1a1a1a;
    --bg-input: #0e0e0e;

    /* Text */
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;

    /* Accent */
    --accent: #e8722a;
    --accent-dim: rgba(232, 114, 42, 0.15);

    /* Trading colors */
    --green: #22c55e;
    --green-dim: rgba(34, 197, 94, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.15);

    /* Borders */
    --border: rgba(255,255,255,0.08);
    --border-hover: rgba(255,255,255,0.14);

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', 'Liberation Mono', monospace;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 150ms var(--ease);
    --transition-normal: 250ms var(--ease);
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Base ── */
body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    font-size: 14px;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Tabular numbers everywhere */
.tabular-nums,
[data-tabular] {
    font-variant-numeric: tabular-nums;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ── Selection ── */
::selection {
    background: rgba(34, 197, 94, 0.2);
    color: var(--text-primary);
}

/* ── Layout ── */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
}

/* ══════════════════════════════════════════════════════
   HEADER / NAVIGATION
   ══════════════════════════════════════════════════════ */
.site-header {
    padding: 0 24px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo img,
.logo svg,
.logo-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.nav-links a.active {
    color: var(--accent);
    background: var(--accent-dim);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.25s var(--ease);
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }


/* ══════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════ */
.site-footer {
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 48px;
}

.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.site-footer a:hover {
    color: var(--text-primary);
}

.footer-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-bottom: 16px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 12px;
    opacity: 0.7;
}


/* ══════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color var(--transition-fast);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 18px;
}


/* ══════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--green);
    color: #000;
}

.btn-primary:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: rgba(255,255,255,0.04);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--red);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}


/* ══════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-green {
    background: var(--green-dim);
    color: var(--green);
}

.badge-red {
    background: var(--red-dim);
    color: var(--red);
}

.badge-neutral {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
}


/* ══════════════════════════════════════════════════════
   FORM INPUTS
   ══════════════════════════════════════════════════════ */
.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-body);
    transition: border-color var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-textarea:focus {
    border-color: rgba(255,255,255,0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-input.mono {
    font-family: var(--font-mono);
    font-size: 13px;
}

.form-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-hint .highlight {
    color: var(--green);
    font-weight: 600;
}


/* ══════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(255,255,255,0.02);
}


/* ══════════════════════════════════════════════════════
   SCROLL REVEAL
   ══════════════════════════════════════════════════════ */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.reveal.revealed,
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ══════════════════════════════════════════════════════
   STATUS DOT (live indicator)
   ══════════════════════════════════════════════════════ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
}

.status-dot.live {
    animation: statusPulse 2s ease-in-out infinite;
}

.status-dot.disconnected {
    background: var(--red);
    animation: none;
}

.status-dot.warning {
    background: #eab308;
    animation: none;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}


/* ══════════════════════════════════════════════════════
   SECTION DIVIDER
   ══════════════════════════════════════════════════════ */
.section-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
}


/* ══════════════════════════════════════════════════════
   SPINNER / LOADING
   ══════════════════════════════════════════════════════ */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--text-secondary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.loading {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}


/* ══════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
    font-size: 14px;
}


/* ══════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--green);
    color: #000;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.25s var(--ease);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}


/* ══════════════════════════════════════════════════════
   DONATE FAB + MODAL
   ══════════════════════════════════════════════════════ */
.donate-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 20px rgba(232, 114, 42, 0.35);
}

.donate-fab:hover {
    background: #d4631f;
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(232, 114, 42, 0.5);
}

.donate-fab svg { width: 18px; height: 18px; flex-shrink: 0; }

.donate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.donate-overlay.open { display: flex; }

.donate-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    position: relative;
}

.donate-modal h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.donate-modal p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.donate-addr-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.donate-addr-box code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-primary);
    word-break: break-all;
    text-align: left;
    line-height: 1.5;
}

.donate-copy-btn {
    padding: 6px 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.donate-copy-btn:hover {
    background: var(--bg-card-hover);
}

.donate-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color var(--transition-fast);
}

.donate-close:hover { color: var(--text-primary); }

.donate-modal .donate-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.donate-donors {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.donate-donors h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.donor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: background var(--transition-fast);
}

.donor-row:hover { background: rgba(255,255,255,0.03); }

.donor-rank {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
}

.donor-rank.gold { background: rgba(234,179,8,0.2); color: #eab308; }
.donor-rank.silver { background: rgba(148,163,184,0.2); color: #94a3b8; }
.donor-rank.bronze { background: rgba(180,83,9,0.2); color: #b45309; }

.donor-wallet {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-primary);
    margin: 0 12px;
    flex: 1;
    text-align: left;
}

.donor-amount {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.donor-loading {
    color: var(--text-muted);
    font-size: 13px;
    padding: 12px 0;
}


/* ══════════════════════════════════════════════════════
   TRADING COLORS (contextual)
   ══════════════════════════════════════════════════════ */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.positive { color: var(--green); }
.negative { color: var(--red); }


/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hamburger { display: flex; }

    .nav-links {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(10, 10, 10, 0.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 24px;
        z-index: 1000;
    }

    .nav-links.open { display: flex; }

    .nav-links a {
        font-size: 18px;
        font-weight: 600;
        color: var(--text-primary);
    }
}

@media (max-width: 600px) {
    .donate-fab {
        bottom: 16px;
        right: 16px;
        padding: 10px;
        border-radius: 50%;
    }

    .donate-fab span { display: none; }
}


/* ══════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
