/* ================================================================
   CodeLabs Crypto Dashboard — Global Design System
   Component-specific styles go in their .razor.css files
   ================================================================ */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- Design Tokens ---- */
:root {
    --bg-app:       #0b0e1a;
    --bg-panel:     #0d1117;
    --bg-elevated:  #161b22;
    --border:       #21262d;
    --border-light: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted:   #484f58;
    --accent:       #f0b90b;
    --green:        #0ecb81;
    --red:          #f6465d;
    --font-mono:    'Roboto Mono', 'Courier New', monospace;
    --radius-sm:    6px;
    --radius-md:    10px;
    --radius-lg:    14px;
}

/* ---- Base ---- */
html, body { height: 100%; overflow: hidden; }

body {
    background: var(--bg-app);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

/* ---- Keyframes ---- */
@keyframes fup {
    0%   { background: rgba(14, 203, 129, 0.20); }
    100% { background: transparent; }
}
@keyframes fdn {
    0%   { background: rgba(246, 70, 93, 0.20); }
    100% { background: transparent; }
}
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes livepulse {
    0%, 100% { opacity: 1;   box-shadow: 0 0 0 0   rgba(14,203,129,0.4); }
    50%      { opacity: 0.5; box-shadow: 0 0 0 5px rgba(14,203,129,0);   }
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Flash utilities ---- */
.flash-up { animation: fup 0.55s ease forwards; }
.flash-dn { animation: fdn 0.55s ease forwards; }

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.badge-pos  { background: rgba(14,203,129,0.12); color: var(--green); }
.badge-neg  { background: rgba(246,70,93,0.12);  color: var(--red);   }
.badge-zero { background: rgba(110,118,129,0.1); color: var(--text-muted); }

/* ---- Spinner ---- */
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 12px;
}

/* ---- Loading block ---- */
.loading-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    color: var(--text-muted);
}
.loading-block p { font-size: 13px; margin-top: 4px; }

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ---- Live badge ---- */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(14, 203, 129, 0.1);
    border: 1px solid rgba(14, 203, 129, 0.25);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--green);
}
.live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    animation: livepulse 1.5s ease-in-out infinite;
}

/* ---- Common search input ---- */
.search-input {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 12px 7px 34px;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }
.search-wrap { position: relative; }
.search-wrap .search-icon {
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}
