/* ============================================================
   crypto.css — Crypto Markets page
   Matches the dark theme of Bollinger / Observatory pages.
   ============================================================ */

/* ── PAGE SHELL ─────────────────────────────────────────────── */
.crypto-page {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 0 2rem;
    min-height: calc(100vh - 56px);
    background: #0d1117;
    color: #e0e6ed;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── HEADER BAR ─────────────────────────────────────────────── */
.crypto-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
    box-shadow: 0 2px 20px rgba(0, 212, 255, 0.06);
    position: sticky;
    top: 56px;
    z-index: 100;
}

.crypto-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.crypto-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 12px;
}

.crypto-page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffd700;
    letter-spacing: 0.5px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.crypto-page-subtitle {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}

.crypto-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.crypto-live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 20px;
    padding: 4px 10px;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: #00ff88;
    border-radius: 50%;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px #00ff88; }
    50%       { opacity: 0.4; box-shadow: none; }
}

.live-text {
    font-size: 0.72rem;
    color: #00ff88;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
}

.crypto-last-update {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
}

/* ── TICKER STRIP ────────────────────────────────────────────── */
.crypto-ticker-strip {
    display: flex;
    gap: 0;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    scrollbar-width: none;
}

.crypto-ticker-strip::-webkit-scrollbar { display: none; }

.ticker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.55rem 1.1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.ticker-item:hover {
    background: rgba(0, 212, 255, 0.06);
}

.ticker-item.active {
    background: rgba(255, 215, 0, 0.08);
    border-bottom: 2px solid #ffd700;
}

.ticker-sym {
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.5px;
}

.ticker-price-sm {
    font-size: 0.72rem;
    color: #00d4ff;
    font-variant-numeric: tabular-nums;
}

.ticker-chg-sm {
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
}

.ticker-chg-sm.up   { color: #00ff88; }
.ticker-chg-sm.down { color: #ff4444; }

/* ── MAIN LAYOUT ─────────────────────────────────────────────── */
.crypto-main {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    flex: 1;
    min-height: 0;
}

/* ── LEFT PANEL ─────────────────────────────────────────────── */
.crypto-left-panel {
    padding: 1rem;
    background: #0b0f18;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

.panel-section-label {
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0.75rem;
    padding-left: 4px;
}

.crypto-coin-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Individual coin card */
.coin-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.coin-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--coin-color, #00d4ff);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 2px 0 0 2px;
}

.coin-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 212, 255, 0.2);
    transform: translateX(2px);
}

.coin-card:hover::before,
.coin-card.active::before {
    opacity: 1;
}

.coin-card.active {
    background: rgba(255, 215, 0, 0.07);
    border-color: rgba(255, 215, 0, 0.25);
}

.coin-card-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coin-card-body {
    flex: 1;
    min-width: 0;
}

.coin-card-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coin-card-sym {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.coin-card-right {
    text-align: right;
    flex-shrink: 0;
}

.coin-card-price {
    font-size: 0.8rem;
    font-weight: 600;
    color: #00d4ff;
    font-variant-numeric: tabular-nums;
}

.coin-card-change {
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}

.coin-card-change.up   { color: #00ff88; }
.coin-card-change.down { color: #ff4444; }

/* Skeleton shimmer while loading */
.coin-card.loading .coin-card-price,
.coin-card.loading .coin-card-change {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    color: transparent;
    min-width: 60px;
    min-height: 12px;
    display: block;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── RIGHT PANEL ─────────────────────────────────────────────── */
.crypto-right-panel {
    display: flex;
    flex-direction: column;
    background: #0d1117;
    overflow: hidden;
}

.crypto-chart-header {
    padding: 0.9rem 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.chart-coin-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-coin-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-coin-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.chart-coin-ticker {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.chart-stats-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.chart-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chart-stat-label {
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
}

.chart-stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #00d4ff;
    font-variant-numeric: tabular-nums;
}

.chart-stat-value.up   { color: #00ff88; }
.chart-stat-value.down { color: #ff4444; }

/* ── CHART CONTROLS ─────────────────────────────────────────── */
.chart-controls-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.controls-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ctrl-label {
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    white-space: nowrap;
}

.btn-group-ctrl {
    display: flex;
    gap: 3px;
}

.ctrl-btn {
    padding: 3px 10px;
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.5px;
}

.ctrl-btn:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    color: #00d4ff;
}

.ctrl-btn.active {
    background: rgba(196, 144, 0, 0.15);
    border: 1px solid #ffd700;
    color: #fff8dc;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}

/* ── CHART AREA ─────────────────────────────────────────────── */
.crypto-chart-wrap {
    flex: 1;
    position: relative;
    min-height: 340px;
}

.crypto-chart-plot {
    width: 100%;
    height: 100%;
    min-height: 340px;
}

.crypto-volume-plot {
    width: 100%;
    height: 100px;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.chart-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(13, 17, 23, 0.85);
    gap: 14px;
    z-index: 20;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s;
}

.chart-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.chart-spinner {
    width: 34px;
    height: 34px;
    border: 2px solid rgba(255, 215, 0, 0.15);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.chart-loading-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

/* ── MARKET OVERVIEW STRIP ──────────────────────────────────── */
.crypto-market-strip {
    padding: 1rem 1.5rem;
    background: #0b0f18;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.market-strip-title {
    font-size: 0.62rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0.75rem;
}

.market-strip-cards {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.market-strip-cards::-webkit-scrollbar { display: none; }

.market-card {
    min-width: 130px;
    padding: 0.65rem 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.market-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--coin-color, #00d4ff);
    opacity: 0.7;
}

.market-card-sym {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.market-card-price {
    font-size: 1rem;
    font-weight: 600;
    color: #00d4ff;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.market-card-change {
    font-size: 0.72rem;
    margin-top: 5px;
    font-variant-numeric: tabular-nums;
}

.market-card-change.up   { color: #00ff88; }
.market-card-change.down { color: #ff4444; }

.market-card-sparkline {
    margin-top: 8px;
    height: 30px;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .crypto-main {
        grid-template-columns: 1fr;
    }

    .crypto-left-panel {
        max-height: 260px;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .crypto-coin-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 6px;
    }
}

@media (max-width: 600px) {
    .chart-stats-row { gap: 0.8rem; }
    .crypto-header { flex-wrap: wrap; gap: 0.5rem; }
    .chart-controls-bar { gap: 0.8rem; }
}

/* ── BOOTSTRAP DROPDOWN DARK OVERRIDE ───────────────────────── */
/* Exact values from carousel-shared.css                        */
.dropdown-menu {
    background-color: rgba(5, 10, 21, 0.95) !important;
    border:           1px solid rgba(0, 212, 255, 0.15) !important;
    backdrop-filter:  blur(12px);
    box-shadow:       0 8px 32px rgba(0, 0, 0, 0.5) !important;
    z-index:          1050 !important;
}

.dropdown-item {
    color:          rgba(160, 196, 228, 0.85) !important;
    font-size:      13px;
    letter-spacing: 0.04em;
}

.dropdown-item:hover {
    background-color: rgba(0, 212, 255, 0.08) !important;
    color:            #00d4ff !important;
}

.dropdown-divider {
    border-color: rgba(0, 212, 255, 0.1) !important;
}