/* ============================================
   Climate Dashboard Styles
   ============================================ */

:root {
    --primary: #2E86AB;
    --secondary: #A23B72;
    --accent: #F18F01;
    --positive: #E84855;
    --negative: #4A90D9;
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --bg-hover: #1f3460;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --border: #2d4a6f;
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #0f0f23 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    padding: 1.5rem 2rem;
    background: rgba(22, 33, 62, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Main Dashboard Grid */
main {
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Chart Containers */
.chart-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.chart-header h2 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.chart-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(46, 134, 171, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.chart {
    width: 100%;
    height: 280px;
    position: relative;
}

/* Info Panel */
.info-panel {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1rem 2rem;
    border: 1px solid var(--border);
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1.5rem;
    border-right: 1px solid var(--border);
}

.stat-box:last-of-type {
    border-right: none;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 0.25rem;
}

#reset-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

#reset-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

/* D3 Specific Styles */
.axis text {
    fill: var(--text-secondary);
    font-size: 10px;
}

.axis path,
.axis line {
    stroke: var(--border);
}

.grid line {
    stroke: var(--border);
    stroke-opacity: 0.3;
}

.grid path {
    stroke-width: 0;
}

.brush .selection {
    fill: var(--primary);
    fill-opacity: 0.3;
    stroke: var(--primary);
    stroke-width: 1;
}

.data-point {
    cursor: pointer;
    transition: opacity 0.2s;
}

.data-point.dimmed {
    opacity: 0.15;
}

.data-point.highlighted {
    stroke: white;
    stroke-width: 2;
}

.line-path {
    fill: none;
    stroke-width: 2;
}

.line-path.dimmed {
    opacity: 0.2;
}

.area-path {
    opacity: 0.3;
}

.bar {
    cursor: pointer;
    transition: opacity 0.2s;
}

.bar:hover {
    opacity: 0.8;
}

.bar.selected {
    stroke: white;
    stroke-width: 2;
}

.bar.dimmed {
    opacity: 0.3;
}

.tooltip {
    position: absolute;
    background: rgba(22, 33, 62, 0.95);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tooltip-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--accent);
}

.tooltip-value {
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .chart {
        height: 250px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .info-panel {
        flex-wrap: wrap;
    }
    
    .stat-box {
        border-right: none;
        padding: 0.5rem 1rem;
    }
}
