﻿
/* BASE STYLES AND LAYOUT */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f3f7; /* Very light gray background */
    color: #333;
    overflow-y: auto;
    min-height: 100vh;
}

/* --- Top Navigation Bar (Updated) --- */
#top-header {
    background-color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 10px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    min-height: 60px; /* Ensure a minimum height for aesthetics */
}

#logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#logo-icon {
    /* Placeholder styling to mimic the blue globe icon from the image */
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #3498db, #2980b9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 0.9em;
}

#logo-text {
    line-height: 1.2;
    font-size: 0.85em;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
}

/* Menu Links */
#main-nav-menu {
    display: flex;
    align-items: center;
    gap: 25px;
    font-size: 0.9em;
    font-weight: 500;
    text-transform: uppercase;
}

.nav-link {
    color: #333;
    text-decoration: none;
    padding: 5px 0;
    transition: color 0.2s;
}

    .nav-link:hover {
        color: #3498db;
    }

/* Highlighted Login Button */
#login-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
}

    #login-btn:hover {
        background-color: #2980b9;
        transform: translateY(-1px);
    }

/* --- Main Content Area --- */
#main-content {
    padding: 0 20px 20px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

/* --- KPI/Stats Row --- */
#stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    height: 100px;
}

.stat-card {
    flex: 1;
    text-align: center;
    padding: 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 2.5em;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #7f8c8d;
    font-weight: 500;
}

/* --- Content Layout (Full-Width Map, then Fluid Charts) --- */

/* Map Card (Full width, fixed height) */
.map-card {
    height: 500px;
    padding: 0;
    overflow: hidden;
    margin-bottom: 30px;
}

#mapid {
    height: 100%;
    border-radius: 12px;
}

/* Charts and Analysis (Fluid responsive grid below map) */
#charts-and-analysis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* FIX: Set fixed height for Charts and minimum height for Analysis */
.chart-card {
    height: 350px;
    display: flex;
    flex-direction: column;
}

    .chart-card canvas {
        flex-grow: 1;
    }

#analysis-card {
    min-height: 350px;
}

    /* Individual Chart/Analysis Styles */
    .chart-card h4, #analysis-card h4 {
        color: #2c3e50;
        font-size: 1.2em;
        margin-top: 0;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 2px solid #ecf0f1;
        flex-shrink: 0;
    }

/* --- LLM Analysis Section Styles --- */
#analysis-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.analysis-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

    .analysis-btn:hover {
        background-color: #2980b9;
    }

    .analysis-btn:disabled {
        background-color: #bdc3c7;
        cursor: not-allowed;
    }

#analysis-output {
    background-color: #f7f9fb;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 8px;
    min-height: 100px;
    font-size: 0.9em;
    white-space: pre-wrap;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.loader {
    text-align: center;
    padding: 20px;
    color: #3498db;
    font-weight: 500;
}

/* --- Responsive Design (Mobile View) --- */
@media (max-width: 1024px) {
    #top-header {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
    }

    #main-nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    #login-btn {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }

    #main-content {
        padding: 10px;
    }

    #stats-row {
        flex-direction: column;
        gap: 10px;
    }

    .map-card {
        height: 350px;
    }

    #charts-and-analysis {
        gap: 10px;
    }
}
