:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #121212;
    --bg-card: #1e1e1e;
    --bg-tertiary: #2a2a2a;
    --bg-hover: #333333;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-blue: #247FFF;
    --accent-blue-hover: #1a6ce0;
    --accent-teal: #00D4AA;
    --accent-green: #22C55E;
    --accent-red: #EF4444;
    --accent-yellow: #F59E0B;
    --accent-orange: #FF6B35;
    --border-color: #2a2a2a;
    --border-light: #3a3a3a;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Navigation */
.nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo span {
    color: var(--accent-blue);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    padding: 8px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link.highlight {
    color: var(--accent-orange);
}

.nav-cta {
    background: var(--accent-blue);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}

.nav-cta:hover {
    background: var(--accent-blue-hover);
}

/* Main Layout */
.main-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

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

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

/* Cohort Grid */
.cohort-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.cohort-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.cohort-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.cohort-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.cohort-emoji {
    font-size: 24px;
}

.cohort-name {
    font-size: 14px;
    font-weight: 600;
}

.cohort-tier {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.cohort-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.cohort-stat {
    text-align: center;
}

.cohort-stat-value {
    font-size: 16px;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
}

.cohort-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Bias Bar */
.bias-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    margin-bottom: 8px;
}

.bias-long {
    background: var(--accent-green);
    transition: width 0.3s ease;
}

.bias-short {
    background: var(--accent-red);
    transition: width 0.3s ease;
}

.bias-neutral {
    background: var(--text-muted);
    transition: width 0.3s ease;
}

.bias-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-family: 'IBM Plex Mono', monospace;
}

.bias-long-label { color: var(--accent-green); }
.bias-short-label { color: var(--accent-red); }
.bias-neutral-label { color: var(--text-muted); }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

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

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.badge-green {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
}

.badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.badge-blue {
    background: rgba(36, 127, 255, 0.15);
    color: var(--accent-blue);
}

.badge-teal {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-teal);
}

.badge-yellow {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.badge-orange {
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent-orange);
}

/* Heatmap */
.heatmap-container {
    overflow-x: auto;
}

.heatmap {
    display: grid;
    gap: 2px;
    min-width: 600px;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
}

.heatmap-cell:hover {
    transform: scale(1.05);
    z-index: 10;
}

.heatmap-cell.long {
    background: var(--accent-green);
    color: #000;
}

.heatmap-cell.short {
    background: var(--accent-red);
    color: #fff;
}

.heatmap-cell.neutral {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Sparkline */
.sparkline {
    width: 60px;
    height: 20px;
}

/* Wallet Address */
.wallet-address {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.wallet-address a {
    color: var(--accent-blue);
    text-decoration: none;
}

.wallet-address a:hover {
    text-decoration: underline;
}

/* Timeframe Buttons */
.timeframe-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.timeframe-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.timeframe-btn.active {
    background: var(--accent-blue);
    color: white;
}

/* Chart Container */
#chart-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    height: 300px;
}

/* Whale Alerts */
.whale-alert {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 14px;
    border-left: 3px solid var(--accent-blue);
}

.whale-alert .amount {
    font-size: 18px;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--accent-blue);
}

.whale-alert .time {
    font-size: 11px;
    color: var(--text-muted);
}

/* Indicator Items */
.indicator-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.indicator-item:last-child {
    border-bottom: none;
}

.indicator-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.indicator-value {
    font-size: 14px;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
}

.indicator-bullish { color: var(--accent-green); }
.indicator-bearish { color: var(--accent-red); }
.indicator-neutral { color: var(--text-muted); }

/* Chat */
#chat-messages {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) transparent;
    max-height: 200px;
    overflow-y: auto;
}

#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.message {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    max-width: 90%;
    font-size: 13px;
}

.message.user {
    background: var(--accent-blue);
    color: white;
    margin-left: auto;
}

.message.ai {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Search Input */
.search-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-primary);
    width: 100%;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Button */
.btn {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

/* Metric Display */
.metric {
    text-align: center;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
}

.metric-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

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

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.tab.active {
    color: var(--accent-blue);
    background: rgba(36, 127, 255, 0.1);
}

/* Utility Classes */
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-blue { color: var(--accent-blue); }
.text-teal { color: var(--accent-teal); }
.text-yellow { color: var(--accent-yellow); }
.text-orange { color: var(--accent-orange); }
.text-muted { color: var(--text-muted); }

.font-mono { font-family: 'IBM Plex Mono', monospace; }
.font-bold { font-weight: 600; }
.font-semibold { font-weight: 500; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }

/* Status Indicator */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online { background: var(--accent-green); }
.status-dot.offline { background: var(--accent-red); }

/* Price Change */
.price-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 500;
}

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

/* Loading State */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

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