/* =====================================================
   GEOGRAPHIC INTELLIGENCE PAGE - ENHANCED STYLES
   Version: 1.0
   Description: Modern styling for Geographic Intelligence Dashboard
   ===================================================== */

/* ===================================================== 
   1. HERO SECTION
   ===================================================== */
.geo-hero {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 25%, #1e3a8a 50%, #172554 100%);
    padding: 5rem 0 6rem;
    margin: -1.5rem -15px 3rem;
    position: relative;
    overflow: hidden;
}

.geo-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 120%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, rgb(59 130 246 / 30%) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgb(37 99 235 / 30%) 0%, transparent 50%);
    animation: float-slow 30s ease-in-out infinite;
}

.geo-hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 120px;
    background: #f8fafc;
    clip-path: polygon(0 40%, 100% 0, 100% 100%, 0% 100%);
}

.geo-hero-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.geo-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgb(255 255 255 / 20%);
    backdrop-filter: blur(10px);
    border: 1px solid rgb(255 255 255 / 30%);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: white;
    font-weight: 600;
}

.geo-hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.geo-hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgb(0 0 0 / 10%);
    animation: slideInUp 0.8s ease-out;
}

.geo-hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto;
    animation: slideInUp 0.8s ease-out 0.2s backwards;
}

/* ===================================================== 
   2. UNDERSTANDING PANEL
   ===================================================== */
.geo-understanding-panel {
    margin-top: -80px;
    position: relative;
    z-index: 10;
    margin-bottom: 2rem;
}

.geo-understanding-card {
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 15px 40px rgb(0 0 0 / 10%);
    border: 1px solid rgb(0 0 0 / 5%);
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.geo-understanding-card h6 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #15803d;
    margin-bottom: 1rem;
}

.geo-understanding-card p {
    color: #166534;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.geo-help-btn {
    background: white;
    color: #15803d;
    border: 2px solid #15803d;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.geo-help-btn:hover {
    background: #15803d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgb(21 128 61 / 30%);
}

/* ===================================================== 
   3. CONTROL PANEL
   ===================================================== */
.geo-control-panel {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgb(0 0 0 / 8%);
    border: 1px solid rgb(0 0 0 / 5%);
    margin-bottom: 2rem;
}

.geo-control-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.geo-control-label i {
    color: #3b82f6;
    font-size: 0.75rem;
}

.geo-control-select {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background-color: #f9fafb;
}

.geo-control-select:focus {
    border-color: #3b82f6;
    background-color: white;
    box-shadow: 0 0 0 4px rgb(59 130 246 / 10%);
}

.geo-apply-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgb(59 130 246 / 30%);
}

.geo-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgb(59 130 246 / 40%);
}

/* ===================================================== 
   4. MAP SECTION
   ===================================================== */
.geo-map-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 8%);
    border: 1px solid rgb(0 0 0 / 5%);
    overflow: hidden;
    height: 100%;
}

.geo-map-header {
    background: linear-gradient(to bottom, rgb(249 250 251 / 80%), transparent);
    padding: 1.5rem;
    border-bottom: 1px solid rgb(0 0 0 / 5%);
}

.geo-map-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.geo-map-body {
    padding: 0;
    position: relative;
}

#main-map {
    height: 600px;
    background: #f0f9ff;
    position: relative;
}

/* Leaflet map styling */
.leaflet-container {
    height: 100%;
    width: 100%;
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
}

.leaflet-popup-content {
    margin: 1rem;
    font-size: 0.875rem;
}

/* Map placeholder */
.map-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.map-placeholder i {
    font-size: 4rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.map-placeholder p {
    color: #64748b;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

/* Map Legend */
.geo-map-legend {
    padding: 1.5rem;
    background: rgb(248 250 252 / 80%);
    border-top: 1px solid rgb(0 0 0 / 5%);
}

.geo-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.geo-legend-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.geo-legend-badge.critical { background: #dc2626; }
.geo-legend-badge.warning { background: #f59e0b; }
.geo-legend-badge.safe { background: #10b981; }
.geo-legend-badge.monitor { background: #3b82f6; }

/* ===================================================== 
   5. KEY METRICS SIDEBAR
   ===================================================== */
.geo-metrics-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 8%);
    border: 1px solid rgb(0 0 0 / 5%);
    overflow: hidden;
}

.geo-metrics-header {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 1.5rem;
}

.geo-metrics-header h5 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.geo-metrics-header small {
    opacity: 0.9;
}

.geo-metrics-body {
    padding: 1.5rem;
}

.geo-metric-item {
    margin-bottom: 1.75rem;
    position: relative;
}

.geo-metric-item:last-child {
    margin-bottom: 0;
}

.geo-metric-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.geo-metric-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

/* ===================================================== 
   6. QUICK ACTIONS
   ===================================================== */
.geo-actions-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 8%);
    border: 1px solid rgb(0 0 0 / 5%);
    overflow: hidden;
}

.geo-actions-header {
    background: linear-gradient(to bottom, rgb(249 250 251 / 80%), transparent);
    padding: 1.5rem;
    border-bottom: 1px solid rgb(0 0 0 / 5%);
}

.geo-actions-body {
    padding: 1.5rem;
}

.geo-action-btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.geo-action-btn:last-child {
    margin-bottom: 0;
}

.geo-action-btn.primary {
    background: rgb(59 130 246 / 10%);
    color: #3b82f6;
    border: 2px solid #3b82f6;
}

.geo-action-btn.primary:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(59 130 246 / 30%);
}

.geo-action-btn.info {
    background: rgb(6 182 212 / 10%);
    color: #06b6d4;
    border: 2px solid #06b6d4;
}

.geo-action-btn.info:hover {
    background: #06b6d4;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(6 182 212 / 30%);
}

.geo-action-btn.warning {
    background: rgb(245 158 11 / 10%);
    color: #f59e0b;
    border: 2px solid #f59e0b;
}

.geo-action-btn.warning:hover {
    background: #f59e0b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(245 158 11 / 30%);
}

/* ===================================================== 
   7. ANALYSIS TABS
   ===================================================== */
.geo-analysis-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 8%);
    border: 1px solid rgb(0 0 0 / 5%);
    overflow: hidden;
    margin-top: 2rem;
}

.geo-tabs-container {
    background: linear-gradient(to bottom, rgb(249 250 251 / 80%), transparent);
    padding: 0.5rem;
    border-bottom: 1px solid rgb(0 0 0 / 5%);
}

.geo-tabs {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.geo-tabs .nav-item {
    flex: 1;
}

.geo-tabs .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    transition: all 0.3s ease;
}

.geo-tabs .nav-link:hover {
    color: #3b82f6;
    background: rgb(59 130 246 / 5%);
}

.geo-tabs .nav-link.active {
    color: white;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 12px rgb(59 130 246 / 30%);
}

.geo-tab-content {
    padding: 2rem;
}

/* ===================================================== 
   8. MUNICIPAL COMPARISON
   ===================================================== */
.municipal-chart-container {
    background: rgb(248 250 252 / 50%);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.top-municipalities-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    border-radius: 16px;
    padding: 1.5rem;
}

.top-municipalities-card h6 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

.municipality-item {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    border: 1px solid rgb(0 0 0 / 5%);
    cursor: pointer;
}

.municipality-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
    border-color: #3b82f6;
}

.municipality-rank {
    font-size: 1.25rem;
    font-weight: 900;
    color: #3b82f6;
    margin-right: 0.5rem;
}

.municipality-score {
    font-size: 1.5rem;
    font-weight: 800;
    color: #10b981;
}

/* ===================================================== 
   9. ADMINISTRATIVE POSTS TABLE
   ===================================================== */
.geo-posts-table {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgb(0 0 0 / 8%);
}

.geo-posts-table thead {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.geo-posts-table thead th {
    color: white;
    font-weight: 700;
    padding: 1.25rem;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

.geo-posts-table tbody td {
    padding: 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.geo-posts-table tbody tr:last-child td {
    border-bottom: none;
}

.geo-posts-table tbody tr {
    transition: all 0.3s ease;
}

.geo-posts-table tbody tr:hover {
    background: rgb(59 130 246 / 5%);
}

.safety-progress {
    width: 120px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.safety-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 8px;
    font-size: 0.75rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* ===================================================== 
   10. CLUSTER ANALYSIS
   ===================================================== */
.cluster-list-container {
    max-height: 500px;
    overflow-y: auto;
}

.cluster-item {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cluster-item:hover {
    border-color: #3b82f6;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgb(59 130 246 / 15%);
}

.cluster-item.active {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
}

.cluster-details-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    border-radius: 16px;
    padding: 1.5rem;
    min-height: 300px;
}

/* ===================================================== 
   11. RESOURCE ALLOCATION
   ===================================================== */
.resource-matrix-table {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgb(0 0 0 / 8%);
}

.resource-matrix-table thead {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.resource-matrix-table thead th {
    color: white;
    font-weight: 700;
    padding: 1rem;
    border: none;
    font-size: 0.875rem;
}

.resource-matrix-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.priority-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.priority-badge.high {
    background: #dc2626;
    color: white;
}

.priority-badge.medium {
    background: #f59e0b;
    color: white;
}

.priority-badge.low {
    background: #10b981;
    color: white;
}

.allocation-summary-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    border-radius: 16px;
    padding: 1.5rem;
}

.allocation-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgb(0 0 0 / 5%);
}

.allocation-metric:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.allocation-metric strong {
    color: #3b82f6;
    font-size: 1.125rem;
}

/* ===================================================== 
   12. ANIMATIONS
   ===================================================== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float-slow {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* ===================================================== 
   13. LOADING STATES
   ===================================================== */
.geo-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #64748b;
}

.geo-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================================== 
   14. RESPONSIVE DESIGN
   ===================================================== */
@media (width <= 1200px) {
    .geo-tabs {
        flex-wrap: wrap;
    }
    
    .geo-tabs .nav-item {
        flex: 1 1 50%;
    }
}

@media (width <= 768px) {
    .geo-hero {
        padding: 3rem 0 4rem;
    }
    
    .geo-hero-title {
        font-size: 2.5rem;
    }
    
    .geo-hero-subtitle {
        font-size: 1.125rem;
    }
    
    #main-map {
        height: 400px;
    }
    
    .geo-tabs .nav-item {
        flex: 1 1 100%;
    }
    
    .geo-control-panel .row > div {
        margin-bottom: 1rem;
    }
}

@media (width <= 480px) {
    .geo-hero-title {
        font-size: 2rem;
    }
    
    .geo-metric-value {
        font-size: 1.5rem;
    }
    
    #main-map {
        height: 300px;
    }
}

/* ===================================================== 
   15. DARK MODE SUPPORT
   ===================================================== */









