/* ═══════════════════════════════════════════════════════════════
   Pump Earnchain — Premium Dark Dashboard
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #06080d;
    --bg-secondary: #0c1018;
    --bg-card: rgba(14, 18, 27, 0.85);
    --bg-card-hover: rgba(20, 26, 40, 0.95);
    --bg-expanded: rgba(12, 16, 24, 0.95);
    --text-primary: #e8ecf4;
    --text-secondary: #6b7a90;
    --text-muted: #3d4a5c;
    --accent-green: #00e676;
    --accent-red: #ff3d57;
    --accent-brand: #6c5ce7;
    --accent-brand-light: #a29bfe;
    --accent-cyan: #00d2ff;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --glass: rgba(255, 255, 255, 0.03);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --nav-height: 64px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ── Animated Gradient Background ───────────────────────────── */
.gradient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(108, 92, 231, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(0, 210, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(0, 230, 118, 0.05) 0%, transparent 50%);
    animation: gradientShift 20s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes gradientShift {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1) rotate(1deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(-1deg);
    }
}

/* ── Splash / Loading Screen ────────────────────────────────── */
.splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.splash-logo {
    width: 72px;
    height: 72px;
    filter: drop-shadow(0 0 30px rgba(108, 92, 231, 0.5));
    animation: logoPulse 2.5s ease-in-out infinite;
}

@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 30px rgba(108, 92, 231, 0.5));
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 50px rgba(108, 92, 231, 0.8));
    }
}

.splash-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.progress-bar-container {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-brand), var(--accent-cyan));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.splash-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* ── Navigation ─────────────────────────────────────────────── */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(6, 8, 13, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity var(--transition);
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-logo {
    width: 28px;
    height: 28px;
}

.nav-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ws-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: background var(--transition);
}

.ws-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.ws-dot.offline {
    background: var(--text-muted);
}

.ws-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ── Main Content ───────────────────────────────────────────── */
#app {
    position: relative;
    z-index: 1;
    padding: calc(var(--nav-height) + 24px) 16px 40px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ── Category Tabs ──────────────────────────────────────────── */
.tab-bar {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(0, 210, 255, 0.1));
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.1);
}

.tab-btn .icon {
    width: 16px;
    height: 16px;
}

/* ── Filter Bar ──────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 14px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
    transition: border-color var(--transition);
}

.filter-bar:focus-within {
    border-color: rgba(108, 92, 231, 0.4);
}

.filter-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.filter-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    padding: 12px 0;
    font-family: inherit;
}

.filter-input::placeholder {
    color: var(--text-muted);
}

/* ── Coin List ──────────────────────────────────────────────── */
.coin-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.coin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease both;
}

.coin-row:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.coin-row.expanded {
    border-color: rgba(108, 92, 231, 0.3);
    background: var(--bg-expanded);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transform: none;
}

.coin-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.coin-name-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.coin-symbol {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.coin-pair {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.coin-mini-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mini-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.mini-icon {
    width: 10px;
    height: 10px;
    color: var(--text-muted);
}

.coin-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.coin-price {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.coin-change {
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 3px 8px;
    border-radius: 5px;
}

.coin-change.positive {
    color: var(--accent-green);
    background: rgba(0, 230, 118, 0.1);
}

.coin-change.negative {
    color: var(--accent-red);
    background: rgba(255, 61, 87, 0.1);
}

.coin-change.neutral {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
}

/* ── Expanded Detail Panel ──────────────────────────────────── */
.coin-detail-panel {
    background: var(--bg-expanded);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 20px 16px;
    animation: slideDown 0.3s ease both;
    margin-bottom: 6px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }

    to {
        opacity: 1;
        max-height: 800px;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    padding: 12px;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.stat-label .icon {
    width: 12px;
    height: 12px;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.chart-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 350px;
}

.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Price Colors ───────────────────────────────────────────── */
.positive {
    color: var(--accent-green);
}

.negative {
    color: var(--accent-red);
}

.neutral {
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coin-row:nth-child(1) {
    animation-delay: 0.02s;
}

.coin-row:nth-child(2) {
    animation-delay: 0.04s;
}

.coin-row:nth-child(3) {
    animation-delay: 0.06s;
}

.coin-row:nth-child(4) {
    animation-delay: 0.08s;
}

.coin-row:nth-child(5) {
    animation-delay: 0.10s;
}

.coin-row:nth-child(6) {
    animation-delay: 0.12s;
}

.coin-row:nth-child(7) {
    animation-delay: 0.14s;
}

.coin-row:nth-child(8) {
    animation-delay: 0.16s;
}

.coin-row:nth-child(9) {
    animation-delay: 0.18s;
}

.coin-row:nth-child(10) {
    animation-delay: 0.20s;
}

.coin-row:nth-child(n+11) {
    animation-delay: 0.22s;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-wrapper {
        height: 280px;
    }

    .tab-btn {
        font-size: 0.78rem;
        padding: 8px 10px;
    }

    .coin-mini-stats {
        gap: 6px;
    }

    .mini-stat {
        font-size: 0.65rem;
    }
}

@media (min-width: 768px) {
    #app {
        padding-left: 24px;
        padding-right: 24px;
    }

    .chart-wrapper {
        height: 400px;
    }
}

@media (min-width: 1024px) {
    #app {
        padding-left: 32px;
        padding-right: 32px;
    }
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 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.15);
}

::selection {
    background: rgba(108, 92, 231, 0.3);
}


/* ── Filter Controls (ATR chips + sort) ─────────────────────── */
.filter-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chip-group {
    display: flex;
    gap: 4px;
}

.chip {
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.chip:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.chip.active {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(0, 210, 255, 0.1));
    border-color: rgba(108, 92, 231, 0.4);
    color: var(--text-primary);
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.sort-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.sort-btn .icon {
    width: 14px;
    height: 14px;
}