/* Theme Variables */
:root, [data-theme="dark"] {
    --stat-color: #00f0ff;
    --block-color: #00f0ff;
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #1e1e2a;
    --bg-card-hover: #262635;
    --accent-primary: #00f0ff;
    --accent-secondary: #7b61ff;
    --accent-tertiary: #ff6b9d;
    --accent-success: #00ff88;
    --accent-warning: #ffb800;
    --accent-danger: #ff4757;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --border-color: #2a2a3a;
    --grid-color: rgba(0,240,255,0.03);
}

[data-theme="light"] {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8ecf1;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f4f8;
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --grid-color: rgba(0,100,150,0.05);
}

/* Base Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; transition: background 0.3s, color 0.3s; }

.grid-background {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0;
    background-image: linear-gradient(var(--grid-color) 1px, transparent 1px), linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px; animation: gridMove 20s linear infinite;
}
@keyframes gridMove { 0% { background-position: 0 0; } 100% { background-position: 50px 50px; } }

.container { position: relative; z-index: 1; max-width: 1600px; margin: 0 auto; padding: 2rem; }

/* Theme Toggle - Hidden (moved to header) */
.theme-toggle {
    display: none;
}

/* Theme Toggle in Header */
.theme-toggle-header {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: 100px;
    cursor: pointer; transition: all 0.3s; font-size: 0.85rem;
    color: var(--text-secondary);
}
.theme-toggle-header:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.theme-toggle-header svg { width: 18px; height: 18px; }
.theme-toggle-header .sun { color: var(--accent-warning); }
.theme-toggle-header .moon { color: var(--accent-secondary); }
[data-theme="light"] .theme-toggle-header .moon { display: none; }
[data-theme="dark"] .theme-toggle-header .sun { display: none; }

/* Header */
.header { text-align: center; padding: 3rem 0; margin-bottom: 2rem; }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.logo { display: inline-flex; align-items: center; gap: 1rem; }
.logo-icon {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 16px; display: flex; align-items: center; justify-content: center;
    animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse { 0%, 100% { box-shadow: 0 0 20px rgba(0,240,255,0.3); } 50% { box-shadow: 0 0 40px rgba(0,240,255,0.6); } }
.logo-icon svg { width: 32px; height: 32px; color: white; }
.logo-text { font-size: 1.75rem; font-weight: 800; background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.header-subtitle { font-size: 1.1rem; color: var(--text-secondary); }
.badges { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.badge { padding: 0.4rem 0.8rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 100px; font-size: 0.7rem; color: var(--text-secondary); }
.badge.new { border-color: var(--accent-success); color: var(--accent-success); }


/*remove it*/
.header {
    text-align: center;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
}

.header-subtitle {
    text-align: center;
}
/* Search & Filter Bar */
.search-bar { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.search-input {
    flex: 1; min-width: 200px; padding: 0.75rem 1.25rem;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 12px; font-family: inherit; font-size: 0.9rem;
    color: var(--text-primary); transition: all 0.3s;
}
.search-input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 20px rgba(0,240,255,0.15); }
.search-input::placeholder { color: var(--text-muted); }
.filter-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn {
    padding: 0.6rem 1rem; background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: 10px;
    cursor: pointer; font-family: inherit; font-size: 0.75rem;
    color: var(--text-secondary); transition: all 0.3s;
}
.filter-btn:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.filter-btn.active { background: var(--accent-primary); color: var(--bg-primary); border-color: var(--accent-primary); }
.search-results-count { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }

/* Drop Zone */
.drop-zone {
    position: relative; border: 2px dashed var(--border-color); border-radius: 24px;
    padding: 4rem 2rem; text-align: center; background: var(--bg-secondary);
    cursor: pointer; transition: all 0.3s ease;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent-primary); transform: scale(1.02); box-shadow: 0 0 60px rgba(0,240,255,0.2); }
.drop-icon {
    width: 80px; height: 80px; margin: 0 auto 1.5rem;
    background: var(--bg-tertiary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--border-color); transition: all 0.3s;
}
.drop-zone:hover .drop-icon { border-color: var(--accent-primary); background: rgba(0,240,255,0.1); transform: scale(1.1); }
.drop-icon svg { width: 36px; height: 36px; color: var(--accent-primary); }
.drop-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.drop-subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; }
.format-badge { padding: 0.5rem 1rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 100px; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-secondary); margin: 0 0.25rem; }
.file-input { display: none; }

/* Processing Overlay */
.processing-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(10,10,15,0.95); z-index: 1000; align-items: center; justify-content: center; flex-direction: column; }
.processing-overlay.active { display: flex; }
.processor-animation { width: 200px; height: 200px; position: relative; margin-bottom: 2rem; }
.processor-core { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 80px; height: 80px; background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); border-radius: 12px; display: flex; align-items: center; justify-content: center; animation: coreGlow 1.5s ease-in-out infinite; }
@keyframes coreGlow { 0%, 100% { box-shadow: 0 0 30px rgba(0,240,255,0.5); } 50% { box-shadow: 0 0 60px rgba(0,240,255,0.8); } }
.processor-ring { position: absolute; top: 50%; left: 50%; border: 2px solid var(--accent-primary); border-radius: 50%; opacity: 0.5; }
.processor-ring:nth-child(1) { width: 120px; height: 120px; margin: -60px 0 0 -60px; animation: ringRotate 3s linear infinite; }
.processor-ring:nth-child(2) { width: 160px; height: 160px; margin: -80px 0 0 -80px; animation: ringRotate 4s linear infinite reverse; border-color: var(--accent-secondary); }
.processor-ring:nth-child(3) { width: 200px; height: 200px; margin: -100px 0 0 -100px; animation: ringRotate 5s linear infinite; border-color: var(--accent-tertiary); opacity: 0.3; }
@keyframes ringRotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.processing-text { font-size: 1.25rem; font-weight: 600; color: var(--accent-primary); animation: textPulse 1s ease-in-out infinite; }
@keyframes textPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Report Container */
.report-container { display: none; }
.report-container.active { display: block; animation: fadeInUp 0.6s ease forwards; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* AI Insights Panel */
.ai-panel {
    background: linear-gradient(135deg, rgba(123,97,255,0.1), rgba(0,240,255,0.1));
    border: 1px solid var(--accent-secondary); border-radius: 24px;
    padding: 1.5rem; margin-bottom: 2rem; position: relative; overflow: hidden;
}
.ai-panel::before {
    content: ''; position: absolute; top: -50%; right: -50%;
    width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(123,97,255,0.1) 0%, transparent 70%);
    animation: aiGlow 5s ease-in-out infinite;
}
@keyframes aiGlow { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-20%, 20%); } }
.ai-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; position: relative; }
.ai-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    animation: aiPulse 2s ease-in-out infinite;
}
@keyframes aiPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.ai-icon svg { width: 24px; height: 24px; color: white; }
.ai-title { font-size: 1.2rem; font-weight: 700; }
.ai-subtitle { font-size: 0.8rem; color: var(--text-secondary); }
.ai-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; position: relative; }
.ai-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 14px; padding: 1rem; transition: all 0.3s; }
.ai-card:hover { transform: translateY(-3px); border-color: var(--accent-secondary); }
.ai-card-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.ai-card-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.ai-card-icon.value { background: rgba(0,255,136,0.15); }
.ai-card-icon.risk { background: rgba(255,71,87,0.15); }
.ai-card-icon.opportunity { background: rgba(0,240,255,0.15); }
.ai-card-icon.trend { background: rgba(255,184,0,0.15); }
.ai-card-title { font-size: 0.85rem; font-weight: 600; }
.ai-card-body { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.ai-card-metric { display: flex; align-items: baseline; gap: 0.5rem; margin-top: 0.75rem; }
.ai-metric-value { font-family: 'JetBrains Mono', monospace; font-size: 1.25rem; font-weight: 700; }
.ai-metric-value.positive { color: var(--accent-success); }
.ai-metric-value.negative { color: var(--accent-danger); }
.ai-metric-value.neutral { color: var(--accent-primary); }
.ai-metric-label { font-size: 0.7rem; color: var(--text-muted); }

/* Section Header */
.section-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.section-icon { width: 48px; height: 48px; background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.section-icon svg { width: 24px; height: 24px; color: white; }
.section-title { font-size: 1.5rem; font-weight: 700; }
.section-subtitle { font-size: 0.875rem; color: var(--text-muted); }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 1.5rem; position: relative; overflow: hidden; transition: all 0.3s; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--stat-color, var(--accent-primary)); }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.5rem; }
.stat-value { font-family: 'JetBrains Mono', monospace; font-size: 1.75rem; font-weight: 700; }
.stat-value.gradient { background: linear-gradient(135deg, var(--accent-primary), var(--accent-success)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-detail { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.5rem; }

/* Map Section */
.map-section { margin-bottom: 2rem; }
.map-container { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 20px; overflow: hidden; }
.map-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-color); flex-wrap: wrap; gap: 1rem; }
.map-title { font-size: 1rem; font-weight: 600; }
.map-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.map-btn { padding: 0.5rem 1rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 0.75rem; color: var(--text-secondary); transition: all 0.3s; }
.map-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--accent-primary); }
.map-btn.active { background: var(--accent-primary); color: var(--bg-primary); border-color: var(--accent-primary); }
#map { height: 450px; width: 100%; background: var(--bg-secondary); }
.map-legend { display: flex; gap: 1.5rem; padding: 1rem 1.5rem; background: var(--bg-tertiary); border-top: 1px solid var(--border-color); flex-wrap: wrap; font-size: 0.75rem; color: var(--text-secondary); }
.legend-item { display: flex; align-items: center; gap: 0.5rem; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; }
.legend-dot.property { background: var(--accent-primary); box-shadow: 0 0 10px var(--accent-primary); }
.legend-dot.school { background: #ff9f43; }
.legend-dot.transit { background: #54a0ff; }
.legend-dot.nearby { background: #5f27cd; }
.legend-line { width: 20px; height: 3px; background: var(--accent-tertiary); border-radius: 2px; }
.heat-legend { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.heat-gradient { width: 80px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #00ff88, #ffb800, #ff4757); }

/* Nearby Panel */
.nearby-panel { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 1.25rem; margin-bottom: 2rem; }
.nearby-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.nearby-title { font-size: 1rem; font-weight: 600; }
.nearby-tabs { display: flex; gap: 0.5rem; }
.nearby-tab { padding: 0.4rem 0.8rem; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 8px; cursor: pointer; font-size: 0.7rem; color: var(--text-secondary); transition: all 0.3s; }
.nearby-tab:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.nearby-tab.active { background: var(--accent-primary); color: var(--bg-primary); border-color: var(--accent-primary); }
.nearby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.nearby-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: var(--bg-tertiary); border-radius: 10px; cursor: pointer; transition: all 0.3s; }
.nearby-item:hover { background: var(--bg-card-hover); transform: translateX(4px); }
.nearby-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.2rem; }
.nearby-icon.school { background: rgba(255, 159, 67, 0.2); }
.nearby-icon.transit { background: rgba(84, 160, 255, 0.2); }
.nearby-icon.property { background: rgba(95, 39, 205, 0.2); }
.nearby-info { flex: 1; min-width: 0; }
.nearby-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nearby-meta { font-size: 0.7rem; color: var(--text-muted); }
.nearby-dist { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: var(--accent-primary); }

/* Processor Grid */
.processor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; padding: 2rem; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 24px; position: relative; margin-bottom: 2rem; }
.processor-grid::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-image: linear-gradient(rgba(0,240,255,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(0,240,255,0.02) 1px, transparent 1px); background-size: 20px 20px; pointer-events: none; border-radius: 24px; }
.grid-block { position: relative; aspect-ratio: 1; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4,0,0.2,1); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.75rem; text-align: center; }
.grid-block.hidden { display: none; }
.grid-block::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--block-color, var(--accent-primary)); opacity: 0; transition: opacity 0.3s; }
.grid-block:hover { transform: translateY(-4px) scale(1.02); border-color: var(--block-color, var(--accent-primary)); box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.grid-block:hover::before, .grid-block.active::before { opacity: 1; }
.grid-block.active { border-color: var(--block-color, var(--accent-primary)); background: var(--bg-card-hover); }
.block-icon { width: 28px; height: 28px; margin-bottom: 0.4rem; color: var(--block-color, var(--accent-primary)); transition: transform 0.3s; }
.grid-block:hover .block-icon { transform: scale(1.2); }
.block-label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 0.2rem; }
.block-value { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 700; color: var(--text-primary); word-break: break-all; line-height: 1.2; }
.block-indicator { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--block-color, var(--accent-primary)); animation: indicatorPulse 2s ease-in-out infinite; }
@keyframes indicatorPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.2); } }
.grid-block[data-category="address"] { --block-color: #00f0ff; }
.grid-block[data-category="value"] { --block-color: #00ff88; }
.grid-block[data-category="owner"] { --block-color: #7b61ff; }
.grid-block[data-category="building"] { --block-color: #ffb800; }
.grid-block[data-category="land"] { --block-color: #ff6b9d; }
.grid-block[data-category="transaction"] { --block-color: #00d4aa; }
.grid-block[data-category="location"] { --block-color: #ff9f43; }
.grid-block[data-category="tax"] { --block-color: #a55eea; }

/* Charts Grid */
.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.chart-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 20px; padding: 1.5rem; }
.chart-header { margin-bottom: 1.5rem; }
.chart-title { font-size: 1.125rem; font-weight: 600; }
.bar-chart { display: flex; flex-direction: column; gap: 0.75rem; }
.bar-item { display: flex; align-items: center; gap: 1rem; }
.bar-label { width: 80px; font-size: 0.75rem; color: var(--text-secondary); flex-shrink: 0; }
.bar-container { flex: 1; height: 20px; background: var(--bg-tertiary); border-radius: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 10px; transition: width 1s cubic-bezier(0.4,0,0.2,1); }
.bar-fill.land { background: linear-gradient(90deg, var(--accent-success), var(--accent-primary)); }
.bar-fill.improvement { background: linear-gradient(90deg, var(--accent-secondary), var(--accent-tertiary)); }
.bar-value { width: 80px; text-align: right; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 600; flex-shrink: 0; }
.donut-chart-container { display: flex; align-items: center; gap: 2rem; }
.donut-chart { width: 160px; height: 160px; position: relative; }
.donut-chart svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-segment { fill: none; stroke-width: 18; stroke-linecap: round; transition: stroke-dasharray 1s cubic-bezier(0.4,0,0.2,1); }
.donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; }
.donut-value { font-family: 'JetBrains Mono', monospace; font-size: 1.5rem; font-weight: 700; color: var(--accent-primary); }
.donut-label { font-size: 0.7rem; color: var(--text-muted); }
.chart-legend { display: flex; flex-direction: column; gap: 0.75rem; }
.legend-item { display: flex; align-items: center; gap: 0.75rem; }
.legend-color { width: 12px; height: 12px; border-radius: 3px; }
.legend-text { font-size: 0.8rem; color: var(--text-secondary); }
.legend-value { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--text-primary); margin-left: auto; font-size: 0.85rem; }

/* Advanced Charts */
.advanced-charts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.radar-chart svg text { fill: var(--text-secondary); }
.sankey-container { padding: 1rem 0; }
.sankey-row { display: flex; align-items: center; margin-bottom: 0.75rem; }
.sankey-source { width: 100px; text-align: right; padding-right: 1rem; font-size: 0.75rem; color: var(--text-secondary); }
.sankey-flow { flex: 1; height: 30px; position: relative; }
.sankey-bar { height: 100%; border-radius: 4px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; transition: all 0.5s ease; }
.sankey-bar span { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: white; font-weight: 600; }
.sankey-bar.land { background: linear-gradient(90deg, var(--accent-success), #00d4aa); }
.sankey-bar.improvement { background: linear-gradient(90deg, var(--accent-secondary), var(--accent-tertiary)); }
.sankey-bar.other { background: linear-gradient(90deg, var(--accent-warning), #ff9f43); }
.sankey-target { width: 80px; padding-left: 1rem; font-size: 0.75rem; color: var(--text-secondary); }
.sankey-legend { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1rem; font-size: 0.75rem; }
.sankey-legend-item { display: flex; align-items: center; gap: 0.5rem; }
.sankey-legend-color { width: 16px; height: 16px; border-radius: 4px; }

/* Timeline */
.timeline-section { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 20px; padding: 1.5rem; margin-bottom: 2rem; }
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary)); }
.timeline-item { position: relative; padding-bottom: 1.5rem; opacity: 0; transform: translateX(-20px); animation: timelineIn 0.5s ease forwards; }
.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
@keyframes timelineIn { to { opacity: 1; transform: translateX(0); } }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -2.5rem; top: 0; width: 20px; height: 20px; background: var(--bg-secondary); border: 3px solid var(--accent-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.timeline-dot::after { content: ''; width: 6px; height: 6px; background: var(--accent-primary); border-radius: 50%; }
.timeline-date { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--accent-primary); margin-bottom: 0.2rem; }
.timeline-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.3rem; }
.timeline-desc { font-size: 0.8rem; color: var(--text-secondary); }

/* JSON Preview */
.json-preview { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; margin-bottom: 2rem; }
.json-preview-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-color); }
.json-preview-title { display: flex; align-items: center; gap: 0.75rem; font-size: 1rem; font-weight: 600; }
.json-action-btn { padding: 0.5rem 1rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 0.8rem; color: var(--text-secondary); margin-left: 0.5rem; transition: all 0.3s; }
.json-action-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--accent-primary); }
.json-preview-content { max-height: 300px; overflow: auto; padding: 1.5rem; }
.json-preview-content pre { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-secondary); line-height: 1.5; white-space: pre-wrap; word-break: break-all; }
.json-key { color: var(--accent-primary); }
.json-string { color: var(--accent-success); }
.json-number { color: var(--accent-warning); }
.json-boolean { color: var(--accent-tertiary); }
.json-null { color: var(--text-muted); }

/* Detail Panel */
.detail-panel { position: fixed; top: 0; right: -500px; width: 500px; height: 100vh; background: var(--bg-secondary); border-left: 1px solid var(--border-color); z-index: 100; transition: right 0.4s cubic-bezier(0.4,0,0.2,1); overflow-y: auto; box-shadow: -20px 0 60px rgba(0,0,0,0.5); }
.detail-panel.active { right: 0; }
.detail-panel-header { position: sticky; top: 0; background: var(--bg-secondary); padding: 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; z-index: 1; }
.detail-panel-title { font-size: 1.25rem; font-weight: 700; }
.close-panel { width: 40px; height: 40px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.close-panel:hover { background: var(--bg-card-hover); border-color: var(--accent-danger); }
.close-panel svg { width: 20px; height: 20px; color: var(--text-secondary); }
.detail-panel-content { padding: 1.5rem; }
.detail-section-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-primary); margin-bottom: 0.75rem; }
.detail-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 0.75rem; background: var(--bg-card); border-radius: 8px; margin-bottom: 0.5rem; }
.detail-item-label { font-size: 0.8rem; color: var(--text-secondary); }
.detail-item-value { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; font-weight: 600; text-align: right; max-width: 60%; word-break: break-all; }
.detail-array { margin-top: 0.5rem; padding-left: 1rem; border-left: 2px solid var(--border-color); }
.detail-array-item { padding: 0.4rem 0; border-bottom: 1px dashed var(--border-color); font-size: 0.75rem; }
.detail-array-item:last-child { border-bottom: none; }

/* Reset Button */
.reset-button { position: fixed; bottom: 2rem; right: 2rem; padding: 1rem 2rem; background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); border: none; border-radius: 100px; cursor: pointer; font-family: inherit; font-size: 1rem; font-weight: 600; color: white; box-shadow: 0 8px 30px rgba(0,240,255,0.3); z-index: 50; opacity: 0; pointer-events: none; transition: all 0.3s; }
.reset-button.visible { opacity: 1; pointer-events: all; }
.reset-button:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,240,255,0.4); }

/* Leaflet Custom Styles */
.leaflet-container { background: var(--bg-secondary); }
.leaflet-popup-content-wrapper { background: var(--bg-card); color: var(--text-primary); border-radius: 12px; border: 1px solid var(--border-color); }
.leaflet-popup-content { margin: 12px 14px; }
.leaflet-popup-tip { background: var(--bg-card); }
.popup-content h3 { color: var(--accent-primary); margin-bottom: 8px; font-size: 14px; }
.popup-content p { margin: 4px 0; color: var(--text-secondary); font-size: 12px; }
.popup-content .value { color: var(--accent-success); font-family: 'JetBrains Mono', monospace; font-weight: 600; }

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid, .charts-grid, .advanced-charts { grid-template-columns: 1fr 1fr; }
    .detail-panel { width: 100%; right: -100%; }
    .ai-insights { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .stats-grid, .charts-grid, .advanced-charts { grid-template-columns: 1fr; }
    .processor-grid { grid-template-columns: repeat(3, 1fr); }
    #map { height: 350px; }
    .donut-chart-container { flex-direction: column; }
    .ai-insights { grid-template-columns: 1fr; }
    .theme-toggle { top: auto; bottom: 5rem; }
}

/* Sample Data Styles */
.sample-data-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0 1rem;
    width: 100%;
    max-width: 300px;
}

.sample-data-divider::before,
.sample-data-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.sample-data-divider span {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.sample-data-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

.sample-data-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 240, 255, 0.4);
}

.sample-data-btn:active {
    transform: translateY(0);
}

.sample-data-btn svg {
    flex-shrink: 0;
}

.sample-data-hint {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.format-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
