/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #e2e8f0;
    background-color: #0f172a;
    line-height: 1.6;
    overflow-x: hidden;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    gap: 20px;
}

/* Header */
.header {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-title p {
    font-size: 0.9rem;
    color: #94a3b8;
}

.controls {
    display: flex;
    gap: 15px;
}

.toggle-group {
    display: flex;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: #38bdf8;
    color: #fff;
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.3);
}

/* Main Content Area */
.main-content {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

/* Map Section */
.map-section {
    flex: 2;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #0f172a;
}

/* Legend Overlay */
.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    z-index: 1000;
    color: #fff;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.legend-bar {
    width: 100%;
    height: 10px;
    background: linear-gradient(to right, #60a5fa, #e2e8f0, #f87171);
    border-radius: 5px;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #cbd5e1;
}

/* Insights Section */
.insights-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 320px;
}

.insight-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8fafc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: #38bdf8;
}

.insight-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s;
}

.insight-stat:hover {
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.8);
}

.stat-label {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #38bdf8;
}

.stat-value.negative {
    color: #f87171;
}

.insight-text {
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin-top: 10px;
    background: rgba(15, 23, 42, 0.4);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #818cf8;
}

/* Tooltip Styles */
.custom-tooltip {
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
    padding: 12px !important;
    font-family: 'Inter', sans-serif !important;
}

.tooltip-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 4px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.85rem;
    gap: 15px;
}

.tooltip-row .label {
    color: #94a3b8;
}

.tooltip-row .value {
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    .map-section {
        min-height: 500px;
    }
}
