* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1b1b 50%, #1a1a1a 100%);
    color: #ffffff;
    line-height: 1.5;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.dashboard-header {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #dc2626;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
    animation: rotate 20s infinite linear;
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #dc2626;
    color: white;
    border: 1px solid #dc2626;
}

.btn-primary:hover {
    background: #b91c1c;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid #dc2626;
}

.btn-secondary:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: #dc2626;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Quick Filters Header */
.quick-filters {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.95), rgba(185, 28, 28, 0.95));
    border-bottom: 2px solid #dc2626;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Ensure all text in quick-filters has proper contrast */
.quick-filters * {
    color: #ffffff;
}

.quick-filters-content {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
}

.quick-filters h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
}

.quick-filter-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group-inline label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.filter-select-compact {
    padding: 0.5rem 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    background: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1f2937;
    min-width: 140px;
    transition: all 0.3s ease;
}

.filter-select-compact:hover {
    border-color: #dc2626;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.3);
}

.filter-select-compact:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.5);
}

.filter-select-compact option {
    background: #ffffff;
    color: #1f2937;
}

.btn-clear {
    background: rgba(255, 255, 255, 0.9);
    color: #dc2626;
    border: 2px solid rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.btn-clear:hover {
    background: #ffffff;
    color: #b91c1c;
    border-color: #ffffff;
    transform: translateY(-1px);
}

.dashboard-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 350px;
    background: rgba(0, 0, 0, 0.85) !important;
    border-right: 2px solid #dc2626;
    z-index: 1020 !important;  /* Above weather layer and legend */
    position: relative;
    overflow-y: auto;
    flex-shrink: 0;
}

.stats-panel,
.disaster-types-panel,
.recent-panel {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(220, 38, 38, 0.3);
    background: transparent !important;
}

.stats-panel h3,
.disaster-types-panel h3,
.recent-panel h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Critical Alerts Panel */
.critical-alerts {
    max-height: 300px;
    overflow-y: auto;
}

/* Force dark background for sidebar critical alerts */
.sidebar .recent-panel .critical-alert-item,
.critical-alert-item {
    background: rgba(0, 0, 0, 0.6) !important;
    border-left: 4px solid #dc2626;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.sidebar .recent-panel .critical-alert-item:hover,
.critical-alert-item:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.alert-severity-high {
    border-left-color: #f97316;
}

.sidebar .recent-panel .critical-alert-title,
.critical-alert-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff !important;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.sidebar .recent-panel .critical-alert-details,
.critical-alert-details {
    font-size: 0.8rem;
    color: #ffffff !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0.95;
}

.sidebar .recent-panel .critical-alert-location,
.critical-alert-location {
    font-size: 0.75rem;
    color: #fbbf24 !important;
    font-weight: 500;
}

.sidebar .recent-panel .critical-alert-time,
.critical-alert-time {
    font-size: 0.75rem;
    color: #fde68a !important;
    opacity: 1;
}

.sidebar .recent-panel .critical-alert-severity,
.critical-alert-severity {
    background: #dc2626 !important;
    color: white !important;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.alert-severity-high .critical-alert-severity {
    background: #f97316 !important;
}

.no-critical-alerts {
    text-align: center;
    color: #86efac;
    padding: 1rem;
    font-style: italic;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-weight: 500;
}

/* Disaster Types Panel */
.disaster-types-grid {
    display: grid;
    gap: 0.75rem;
}

.disaster-type-card {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    cursor: pointer;
}

.disaster-type-card:hover {
    border-color: #dc2626;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.disaster-type-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.disaster-type-icon {
    font-size: 1.2rem;
}

.disaster-type-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.disaster-type-count {
    background: #dc2626;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.stats-grid {
    display: grid;
    gap: 1rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-card.critical {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fee2e2, #fef2f2);
}

.stat-card.high {
    border-color: #f97316;
    background: linear-gradient(135deg, #fed7aa, #fff7ed);
}

.stat-card.medium {
    border-color: #eab308;
    background: linear-gradient(135deg, #fef3c7, #fefce8);
}

.stat-card.low {
    border-color: #22c55e;
    background: linear-gradient(135deg, #dcfce7, #f0fdf4);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.875rem;
    color: #374151;
    margin-top: 0.5rem;
    font-weight: 600;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.filter-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #374151;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 0.875rem;
    font-weight: 500;
    color: #1f2937;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: #dc2626;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.3);
}

.filter-select:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.5);
}

.filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.recent-events {
    max-height: 300px;
    overflow-y: auto;
}

.recent-event {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-event:hover {
    background: #f8fafc;
    border-color: #3b82f6;
}

.event-title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.event-meta {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
}

.severity-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.severity-critical {
    background: #fef2f2;
    color: #dc2626;
}

.severity-high {
    background: #fff7ed;
    color: #ea580c;
}

.severity-medium {
    background: #fefce8;
    color: #ca8a04;
}

.severity-low {
    background: #f0fdf4;
    color: #16a34a;
}

.map-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.map-header {
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dc2626;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Fix map controls background */
.map-controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1015 !important;  /* Above weather layer */
    position: relative;
}

.map-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
}

.map-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Ensure proper text visibility in map controls */
.map-controls label,
.map-controls span {
    color: #333333 !important;
    font-weight: 500;
}

.map-controls select,
.map-controls button {
    color: #333333 !important;
}

.map-center-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.map-center-buttons .btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.95);
    color: #374151 !important;
    border: 1px solid #d1d5db;
    font-weight: 500;
}

.map-center-buttons .btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

/* Map View Selector */
.map-view-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-view-selector label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

.map-view-select {
    padding: 0.4rem 0.6rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 0.8rem;
    font-weight: 500;
    color: #1f2937 !important;
    min-width: 130px;
    transition: all 0.3s ease;
}

.map-view-select:hover {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

.map-view-select:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Weather Radar Toggle */
/* Legacy container styles (now handled by .map-overlay-item) */

/* Legacy checkbox styles - replaced by toggle switches */

/* Modern Toggle Switch Styles */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    user-select: none;
}

.toggle-label {
    order: 1;
    white-space: nowrap;
}

.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    order: 2;
    position: relative;
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-slider {
    background: #22c55e;
}

.toggle-input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.toggle-switch:hover .toggle-slider {
    background: #94a3b8;
}

.toggle-switch:hover .toggle-input:checked + .toggle-slider {
    background: #16a34a;
}

/* Active state animation */
.toggle-slider:active::before {
    width: 24px;
}

.toggle-input:checked + .toggle-slider:active::before {
    transform: translateX(16px);
    width: 24px;
}

/* Disabled state */
.toggle-input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-input:disabled + .toggle-slider::before {
    box-shadow: none;
}

/* Mobile responsive toggle switches */
@media (max-width: 768px) {
    .toggle-switch {
        font-size: 0.8rem;
        gap: 8px;
    }
    
    .toggle-slider {
        width: 38px;
        height: 20px;
    }
    
    .toggle-slider::before {
        width: 16px;
        height: 16px;
        top: 2px;
        left: 2px;
    }
    
    .toggle-input:checked + .toggle-slider::before {
        transform: translateX(18px);
    }
    
    .toggle-slider:active::before {
        width: 20px;
    }
    
    .toggle-input:checked + .toggle-slider:active::before {
        transform: translateX(14px);
        width: 20px;
    }
}

@media (max-width: 480px) {
    .toggle-switch {
        font-size: 0.75rem;
        gap: 6px;
    }
    
    .toggle-slider {
        width: 34px;
        height: 18px;
    }
    
    .toggle-slider::before {
        width: 14px;
        height: 14px;
    }
    
    .toggle-input:checked + .toggle-slider::before {
        transform: translateX(16px);
    }
}

.checkmark {
    user-select: none;
    color: #333333 !important;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 0.5rem;
    text-shadow: none;
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: inline-block;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: rgba(255, 255, 255, 0.2);
}

.last-updated {
    font-size: 0.75rem;
    color: #d1d5db;
    font-weight: 500;
}

.disaster-map {
    flex: 1;
    z-index: 1;
}

.legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1010 !important;  /* Higher than weather layer */
    min-width: 150px;
}

.legend h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #374151;
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    text-align: center;
    color: #64748b;
    padding: 1rem;
}

/* Custom Leaflet popup styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.disaster-popup {
    min-width: 200px;
}

.popup-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.popup-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.popup-description {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.popup-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.75rem;
}

.popup-link:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 1024px) {
    .sidebar {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .dashboard-main {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 300px;
        order: 2;
    }
    
    .map-container {
        order: 1;
        min-height: 400px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .legend {
        position: static;
        margin: 1rem;
    }
}

/* Responsive Design for Quick Filters */
@media (max-width: 768px) {
    .quick-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-group-inline {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .filter-select-compact {
        min-width: auto;
        width: 100%;
    }
    
    .dashboard-main {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 400px;
        border-right: none;
        border-bottom: 2px solid #dc2626;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .disaster-types-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-filters {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    /* Ensure map is visible on tablets */
    .dashboard-container {
        height: 100vh;
        height: 100dvh;
    }
    
    .map-container {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 400px !important;
    }
    
    .disaster-map {
        flex: 1 !important;
        min-height: 400px !important;
        height: 100% !important;
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        padding: 1rem;
    }
    
    .stats-panel,
    .disaster-types-panel,
    .recent-panel {
        padding: 1rem;
    }
    
    .map-header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-group-inline label {
        font-size: 0.8rem;
    }
    
    .filter-select-compact {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .map-view-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
    }
    
    .map-view-select {
        min-width: auto;
        width: 100%;
    }
    
    .map-center-buttons {
        justify-content: center;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .map-center-buttons .btn {
        flex: 1;
        min-width: 0;
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }
    
    /* Fix map height on mobile */
    .dashboard-container {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
    }
    
    .dashboard-main {
        flex: 1;
        min-height: 0; /* Allow flex shrinking */
    }
    
    .map-container {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 300px !important;
    }
    
    .disaster-map {
        flex: 1 !important;
        min-height: 300px !important;
        height: 100% !important;
    }
}

/* Alert Notification System */
.alert-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
    z-index: 10000;
    transform: translateX(450px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.alert-notification.show {
    transform: translateX(0);
}

.alert-notification.critical {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    animation: pulse-critical 2s infinite;
}

.alert-notification.high {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.alert-notification.medium {
    background: linear-gradient(135deg, #eab308, #d97706);
}

.alert-notification.low {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

@keyframes pulse-critical {
    0%, 100% { 
        box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
    }
    50% { 
        box-shadow: 0 8px 35px rgba(239, 68, 68, 0.8), 0 0 20px rgba(239, 68, 68, 0.6);
    }
}

.alert-header {
    padding: 1rem 1rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-severity-icon {
    font-size: 1.2rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

.alert-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.alert-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.alert-body {
    padding: 0 1rem 1rem;
}

.alert-location {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.alert-description {
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.alert-time {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.alert-actions {
    display: flex;
    gap: 0.75rem;
}

.alert-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.alert-btn-primary {
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
}

.alert-btn-primary:hover {
    background: white;
    transform: translateY(-1px);
}

.alert-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.alert-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Alert sound notification indicator */
.alert-sound-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background: #fbbf24;
    border-radius: 50%;
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

/* Alert Toggle Styles */
.alert-toggles {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-alert-toggle {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.btn-alert-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-alert-toggle.active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.btn-alert-toggle.active:hover {
    background: rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.btn-alert-toggle:not(.active) {
    background: rgba(239, 68, 68, 0.1);
    color: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-alert-toggle:not(.active):hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

.toggle-icon {
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.toggle-text {
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Responsive design for alert toggles */
@media (max-width: 768px) {
    .alert-toggles {
        order: -1;
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .btn-alert-toggle {
        flex: 1;
        justify-content: center;
        max-width: 120px;
    }
    
    .toggle-text {
        display: none;
    }
}

/* Enhanced Clickable Stat Cards */
.stat-card.clickable {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    user-select: none;
}

.stat-card.clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3);
}

.stat-card.clickable::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.stat-card.clickable:hover::before {
    left: 100%;
}

.stat-action {
    font-size: 0.75rem;
    font-weight: 600;
    color: #dc2626;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.stat-card.clickable:hover .stat-action {
    opacity: 1;
    transform: translateY(0);
}

.stat-card.active-filter {
    border-color: #dc2626 !important;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.5) !important;
    transform: translateY(-4px);
}

.stat-card.active-filter::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #dc2626;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Disaster Marker Highlight */
.disaster-marker-highlight {
    animation: markerPulse 2s ease-in-out;
    border: 3px solid #dc2626 !important;
    border-radius: 50% !important;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.8) !important;
}

@keyframes markerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.8);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 30px rgba(220, 38, 38, 1);
    }
}

/* Filter Notification */
.filter-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

.notification-content {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
}

.notification-icon {
    font-size: 1.2rem;
    animation: bounce 1s infinite;
}

.notification-text {
    font-weight: 600;
    flex: 1;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    margin-left: 0.5rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-8px);
    }
    70% {
        transform: translateY(-4px);
    }
    90% {
        transform: translateY(-2px);
    }
}

/* Enhanced hover states for severity cards */
.stat-card.critical.clickable:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.stat-card.high.clickable:hover {
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

.stat-card.medium.clickable:hover {
    box-shadow: 0 8px 25px rgba(234, 179, 8, 0.4);
}

.stat-card.low.clickable:hover {
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4);
}

/* Type card styles */
.stat-card.type-card {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
}

.stat-card.type-card.clickable:hover {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    border-color: #2563eb;
}

.stat-card.type-card .stat-number {
    color: #1e40af;
}

.stat-card.type-card .stat-label {
    color: #1e3a8a;
    font-weight: 600;
}

.stat-card.type-card .stat-action {
    color: #3b82f6;
}

/* Mobile responsiveness for notifications */
@media (max-width: 768px) {
    .filter-notification {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification-content {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .stat-action {
        font-size: 0.7rem;
    }
}
/* Weather Radar Layer Visibility - Completely rewritten */
.leaflet-tile-pane .weather-radar-layer {
    z-index: 500 !important;
    opacity: 0.9 !important;
    pointer-events: none;
}

.weather-radar-layer {
    position: relative !important;
    z-index: 500 !important;
}

/* Ensure Leaflet panes have correct z-index order */
.leaflet-map-pane .leaflet-tile-pane {
    z-index: 1 !important;
}

.leaflet-map-pane .leaflet-overlay-pane {
    z-index: 2 !important;
}

.leaflet-map-pane .leaflet-shadow-pane {
    z-index: 3 !important;
}

.leaflet-map-pane .leaflet-marker-pane {
    z-index: 4 !important;
}

.leaflet-map-pane .leaflet-tooltip-pane {
    z-index: 5 !important;
}

.leaflet-map-pane .leaflet-popup-pane {
    z-index: 6 !important;
}

/* Force weather radar tiles to be visible */
.leaflet-layer[style*="z-index: 500"] {
    z-index: 500 !important;
}

/* Debug: Add border to weather radar tiles */
.weather-radar-layer img {
    border: 1px solid rgba(255, 0, 0, 0.3) !important;
    opacity: 0.8 !important;
}

/* Map Overlay Controls */
.map-container-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Map Controls Panel - Slide In/Out Layout */
.map-controls-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 320px;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
}

.map-controls-panel.hidden {
    transform: translateX(calc(100% - 40px));
}

.panel-slide-toggle {
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-right: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 1001;
}

.panel-slide-toggle:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.15);
}

.toggle-icon {
    font-size: 0.9rem;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.map-controls-panel.hidden .toggle-icon {
    transform: rotate(180deg);
}

.panel-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px 12px 0 0;
}

.controls-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.controls-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.controls-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.controls-content {
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
}

.control-section {
    margin-bottom: 20px;
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section h5 {
    margin: 0 0 12px 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-row label:not(.toggle-switch) {
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    flex-shrink: 0;
}

.control-select {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.75rem;
    color: #374151;
    flex: 1;
    min-width: 120px;
    transition: border-color 0.2s ease;
}

.control-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.nav-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.nav-btn {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
}

.nav-btn:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-btn:active {
    transform: translateY(0);
}

/* Legend styles within control panel */
.legend-content {
    font-size: 0.8rem;
}

.legend-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #374151;
}

.legend-marker {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.legend-info {
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
    font-size: 0.7rem;
    color: #6b7280;
    line-height: 1.4;
}

.legend-info > div {
    margin-bottom: 4px;
}

.legend-tip {
    opacity: 0.7;
    font-style: italic;
}

.map-status {
    margin-top: 8px;
    font-size: 0.7rem;
    color: #64748b;
    text-align: center;
    padding: 6px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .map-controls-panel {
        top: 5px;
        right: 5px;
        width: calc(100vw - 50px);
        max-width: 300px;
    }
    
    .map-controls-panel.hidden {
        transform: translateX(calc(100% - 30px));
    }
    
    .panel-slide-toggle {
        left: -25px;
        width: 25px;
        height: 50px;
    }
    
    .controls-content {
        max-height: 400px;
    }
    
    .nav-buttons {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }
    
    .nav-btn {
        padding: 6px 8px;
        font-size: 0.65rem;
    }
    
    .control-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    .control-row label:not(.toggle-switch) {
        font-size: 0.75rem;
    }
    
    .legend-items {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .legend-item {
        font-size: 0.7rem;
    }
}

.map-view-select,
.weather-source-select {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8rem;
    color: #374151;
    min-width: 140px;
}

.map-center-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-overlay {
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-overlay:hover {
    background: rgba(59, 130, 246, 0.9);
    color: white;
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-overlay:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.2);
}

/* Mobile Responsive Overlay Controls */
@media (max-width: 768px) {
    .map-controls-group.top-right {
        top: 5px;
        right: 5px;
        gap: 5px;
    }
    
    .map-controls-group.top-left {
        top: 5px;
        left: 5px;
    }
    
    .map-controls-group.bottom-center {
        bottom: 5px;
        left: 5px;
        right: 5px;
        transform: none;
    }
    
    .map-overlay-item {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    
    .map-center-buttons {
        gap: 4px;
    }
    
    .btn-overlay {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    .map-view-select,
    .weather-source-select {
        min-width: 100px;
        font-size: 0.75rem;
    }
    
    /* Hide some controls on very small screens */
    .weather-source-selector {
        display: none;
    }
}

@media (max-width: 480px) {
    .map-controls-group.bottom-center .btn-overlay {
        padding: 3px 5px;
        font-size: 0.65rem;
    }
    
    .map-overlay-item {
        padding: 4px 6px;
    }
}
