@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    --bs-body-font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --bs-body-bg: #ffffff;
    --bs-primary: #2563eb;
    --border-color: #e5e7eb;
    --text-muted: #6b7280;
}

body {
    font-family: var(--bs-body-font-family);
    -webkit-font-smoothing: antialiased;
    color: #1f2937;
    background-color: #f9fafb;
}

/* --- Loader --- */
.loader-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

/* --- Navigation --- */
.navbar {
    backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.nav-pills .nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}

.nav-pills .nav-link.active {
    background-color: #eff6ff;
    color: var(--bs-primary);
    font-weight: 600;
}

/* --- Map --- */
#mapContainer {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#map {
    height: 320px;
    width: 100%;
    z-index: 1;
    background: #f3f4f6;
    border-radius: 0.375rem;
}

/* --- Charts --- */
.chart-wrapper {
    position: relative;
    background: #fff;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px 0 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.u-legend {
    font-family: 'Inter', sans-serif !important;
    font-size: 12px !important;
}

/* --- Tables --- */
/* Ensure DataTables wrappers don't overflow */
.dataTables_wrapper {
    width: 100%;
    overflow: hidden;
    /* Let the internal scrollX handle scrolling */
}

.table {
    font-size: 0.8rem;
    margin-bottom: 0;
    width: 100% !important;
    /* Force 100% width inside DataTable */
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    background: #f9fafb;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    /* Keep headers on one line */
}

.table td {
    vertical-align: middle;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
    /* Prevent weird wrapping */
}

/* Scrollbars */
.simple-scrollbar::-webkit-scrollbar,
.dataTables_scrollBody::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.simple-scrollbar::-webkit-scrollbar-track,
.dataTables_scrollBody::-webkit-scrollbar-track {
    background: transparent;
}

.simple-scrollbar::-webkit-scrollbar-thumb,
.dataTables_scrollBody::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.simple-scrollbar::-webkit-scrollbar-thumb:hover,
.dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Utilities */
.animate-fade-in {
    animation: fadeIn 0.25s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}