/* --------------------------- */
/* Base Layout + Global Text   */
/* --------------------------- */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #111827; /* dark text */
    font-size: clamp(13px, 1.4vw, 16px); /* responsive */
}

/* Map height */
#map {
    height: calc(100vh - 96px);
    position: relative;
}

/* Popup + Legend layering */
#info-panel,
#legend {
    position: fixed;
    z-index: 10000 !important;
    backdrop-filter: blur(4px);
}

/* Popup position + WIDER WIDTH */
#info-panel {
    bottom: 1rem;
    left: 1rem;
    width: 32rem; /* ⬅️ INCREASED POPUP WIDTH */
    color: #111827;
    font-size: clamp(12px, 1.3vw, 14px);
}

/* Legend position */
#legend {
    bottom: 1rem;
    right: 1rem;
}

/* Metrics chart */
#metrics-chart {
    width: 100% !important;
    max-width: 340px;
    height: 180px !important;
    display: block;
}

/* Popup header text */
#info-title {
    font-size: clamp(14px, 1.5vw, 18px);
    font-weight: 700;
    font-style: italic;
    color: #ffffff;
}

#info-subtitle {
    font-size: clamp(11px, 1.2vw, 14px);
    font-weight: 600;
    font-style: italic;
    color: #e5e7eb;
}

/* --------------------------- */
/* Info Table Styling          */
/* --------------------------- */
.info-table-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #ffffff;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(12px, 1.2vw, 15px);
}

.info-table th,
.info-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
    font-weight: 700; /* bold */
    font-style: italic;
}

.info-table tr:nth-child(even) {
    background-color: #f9fafb;
}

.info-table tr:last-child th,
.info-table tr:last-child td {
    border-bottom: none;
}

.info-table th {
    text-align: left;
    width: 40%;
    background-color: #f3f4f6;
}

.info-table td {
    background-color: #ffffff;
}

.info-value {
    font-weight: 800;
    font-style: italic;
    color: #000000;
}

/* --------------------------- */
/* Legend text improvements    */
/* --------------------------- */
#legend span,
#legend .font-semibold {
    color: #111827;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(11px, 1.2vw, 14px);
}

/* --------------------------- */
/* Filters – improved dropdown */
/* --------------------------- */
#filters {
    backdrop-filter: blur(4px);
}

#filters select {
    min-width: 140px;
    padding: 8px 14px;
    border-radius: 9999px; /* pill */
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    font-size: clamp(12px, 1.1vw, 15px);
    color: #111827;
    font-weight: 700;
    font-style: italic;
    outline: none;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%),
                      linear-gradient(135deg, #6b7280 50%, transparent 50%);
    background-position: calc(100% - 14px) 50%, calc(100% - 10px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 28px;
}

#filters select:hover {
    border-color: #9ca3af;
    background-color: #f9fafb;
}

#filters select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.25);
}

/* --------------------------- */
/* Responsive Adjustments      */
/* --------------------------- */
@media (max-width: 768px) {
    #filters {
        gap: 0.5rem;
    }

    #filters select {
        flex: 1 1 48%;
    }

    #info-panel {
        width: calc(100vw - 1.5rem); /* full width for mobile */
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        max-height: 60vh;
    }

    #legend {
        right: 0.75rem;
        bottom: 0.75rem;
    }

    #map {
        height: calc(100vh - 120px);
    }
}
