/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid #475569;
}

/* Language Toggle Styles */
.language-toggle {
    display: flex;
    align-items: center;
}

.language-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    font-family: 'Inter', sans-serif;
}

.language-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

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

/* Adjust header layout for language toggle */
.header .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto auto;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.logo-section {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
}

.page-title {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    margin: 0;
    position: relative;
    z-index: 1;
}

.language-toggle {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin-left: 0;
}

.last-updated {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    color: #94a3b8;
    font-size: 0.9rem;
}

.dam-status-indicator {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.dam-status-indicator.status-loading {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.dam-status-indicator.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.dam-status-indicator.status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.dam-status-indicator.status-fallback {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header .container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        text-align: center;
        gap: 0.5rem;
    }
    
    .logo-section {
        grid-column: 1;
        grid-row: 1;
        justify-self: center;
    }
    
    .page-title {
        grid-column: 1;
        grid-row: 2;
        justify-self: center;
        position: static;
        z-index: auto;
    }
    
    .language-toggle {
        grid-column: 1;
        grid-row: 3;
        justify-self: center;
        margin-left: 0;
    }
    
    .last-updated {
        grid-column: 1;
        grid-row: 4;
        justify-self: center;
    }
    
    .dam-status-indicator {
        grid-row: 5;
    }
}

/* AwareAI Logo Styling */
.logo-section {
    margin-bottom: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-image {
    width: 120px;
    height: 48px;
    object-fit: contain;
}

.logo-icon {
    background: linear-gradient(135deg, #C53030 0%, #9B2C2C 100%);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 700;
}

.logo-brand {
    color: white;
}

.logo-ai {
    color: #FED7D7;
}

.system-title {
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0.9;
    color: #94a3b8;
}

.dam-status-indicator {
    font-size: 0.9rem;
    color: #fbbf24;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 0.5rem;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.dam-status-indicator.status-success {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.dam-status-indicator.status-warning {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.dam-status-indicator.status-loading {
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.3);
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.last-updated {
    font-size: 0.9rem;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
}

/* Main Content */
.main {
    padding: 2rem 0;
}

/* Status Card */
.status-card {
    background: #1e293b;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    border: 1px solid #475569;
}

.status-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #f1f5f9;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.status-item {
    text-align: center;
    padding: 1.5rem;
    background: #334155;
    border-radius: 0.75rem;
    border: 2px solid transparent;
    color: #e2e8f0;
    transition: all 0.3s ease;
}

.status-item.primary {
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
    border-color: #0ea5e9;
    color: #f1f5f9;
}

.status-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.status-label {
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.status-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #f1f5f9;
}

.status-trend {
    font-size: 0.875rem;
    font-weight: 500;
    color: #fbbf24;
}

.status-bank {
    font-size: 0.75rem;
    color: #cbd5e1;
    margin-top: 0.25rem;
}

.status-detail {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* Risk Level Colors */
.risk-normal { color: #10b981; }
.risk-moderate { color: #f59e0b; }
.risk-high { color: #ef4444; }
.risk-critical {
    color: #ef4444;
    animation: pulse 2s infinite;
}

/* Trend Colors */
.trend-rising { color: #ef4444; }
.trend-falling { color: #10b981; }
.trend-stable { color: #94a3b8; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Alert Status Colors */
.alert-green { color: #10b981; }
.alert-yellow { color: #fbbf24; }
.alert-red { color: #ef4444; }
.alert-blue { color: #3b82f6; }
.alert-gray { color: #9ca3af; }
.alert-red { color: #ef4444; }
.alert-gray { color: #64748b; }

/* Live Camera Feed */
.live-feed-section {
    background: #1e293b;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    border: 1px solid #475569;
}

.live-feed-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #f1f5f9;
}

.cameras-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .cameras-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.camera-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: #334155;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #475569;
}

.camera-container h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #f1f5f9;
    text-align: center;
}

.camera-feed {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    border: 2px solid #64748b;
    transition: transform 0.3s ease;
}

.camera-feed:hover {
    transform: scale(1.02);
}

.camera-info {
    text-align: center;
    color: #94a3b8;
    margin-top: 0.5rem;
}

.camera-info p {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

/* Flood Prediction System */
.flood-prediction-section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    border: 1px solid #475569;
}

.flood-prediction-section h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #f1f5f9;
    text-align: center;
}

.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2rem 0;
    padding: 1.5rem;
    background: #0f1419;
    border-radius: 0.75rem;
    border: 1px solid #374151;
}

.flow-station {
    flex: 1;
    text-align: center;
}

.flow-station.upstream {
    border-right: 2px solid #3b82f6;
    padding-right: 1rem;
}

.flow-station.downstream {
    border-left: 2px solid #ef4444;
    padding-left: 1rem;
}

.flow-station h3 {
    font-size: 1.1rem;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.current-level {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #10b981;
}

.station-time {
    font-size: 0.8rem;
    color: #94a3b8;
}

.flow-arrow {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0 1rem;
}

.arrow-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6 0%, #ef4444 100%);
    margin-bottom: 0.5rem;
}

.flow-time {
    text-align: center;
    margin-bottom: 0.5rem;
}

.time-label {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
}

.time-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f59e0b;
}

.arrow-head {
    font-size: 2rem;
    color: #ef4444;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.prediction-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.prediction-card {
    background: #334155;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #475569;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
}

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

.prediction-card.high-risk {
    border-color: #ef4444;
    background: linear-gradient(135deg, #334155 0%, #7f1d1d 20%);
}

.prediction-card.warning {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #334155 0%, #92400e 20%);
}

.prediction-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.prediction-content h4 {
    font-size: 1.1rem;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.risk-level, .warning-time, .trend-direction {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.risk-details, .warning-details, .trend-details {
    font-size: 0.9rem;
    color: #94a3b8;
}

.risk-level.low { color: #10b981; }
.risk-level.moderate { color: #f59e0b; }
.risk-level.high { color: #ef4444; }

.warning-time.active { color: #f59e0b; }
.trend-direction.rising { color: #ef4444; }
.trend-direction.falling { color: #10b981; }

@media (max-width: 768px) {
    .flow-diagram {
        flex-direction: column;
        gap: 1rem;
    }

    .flow-station.upstream, .flow-station.downstream {
        border: none;
        padding: 0;
    }

    .flow-arrow {
        flex: none;
        transform: rotate(90deg);
        margin: 1rem 0;
    }

    .prediction-cards {
        grid-template-columns: 1fr;
    }
}

/* Stations Overview */
.stations-overview {
    background: #1e293b;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    border: 1px solid #475569;
}

.stations-overview h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #f1f5f9;
}

.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.station-card {
    background: #334155;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

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

.station-card.active {
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
    border-color: #0ea5e9;
}

.station-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #f1f5f9;
}

.station-location {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.station-level {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    color: #f1f5f9;
    gap: 0.5rem;
}

.station-level a {
    color: #f1f5f9 !important;
    text-decoration: none;
}

.station-status {
    font-size: 0.875rem;
    color: #cbd5e1;
}

/* Map Section */
.map-section {
    background: #1e293b;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    border: 1px solid #475569;
}

.map-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #f1f5f9;
}

.map-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.map-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #475569;
    background: #334155;
    color: #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.map-btn:hover {
    border-color: #0ea5e9;
}

.map-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #0ea5e9;
}

.map-container {
    border-radius: 0.75rem;
    overflow: hidden;
    background: #475569;
    min-height: 400px;
    border: 1px solid #64748b;
}

.map {
    width: 100%;
    height: 400px;
    position: relative;
    z-index: 1;
}

.map-placeholder {
    text-align: center;
    color: #94a3b8;
    padding: 2rem;
}

.map-placeholder p {
    margin-bottom: 0.5rem;
}

/* Data Sources */
.data-sources {
    background: #1e293b;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    border: 1px solid #475569;
}

.data-sources h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #f1f5f9;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.source-item {
    padding: 1.5rem;
    background: #334155;
    border-radius: 0.75rem;
    border-left: 4px solid #3b82f6;
}

.source-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: #f1f5f9;
}

.source-item p {
    color: #94a3b8;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.source-link {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.source-link:hover {
    color: #0284c7;
}

.source-link.disabled {
    color: #64748b;
    cursor: not-allowed;
}

/* Historical Section */
.historical-section {
    background: #1e293b;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    border: 1px solid #475569;
}

.historical-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #f1f5f9;
}

.chart-container {
    position: relative;
    background: #334155;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid #475569;
}

.chart-scrollbar {
    margin-top: 1rem;
    padding: 0.5rem 0;
}

.scrollbar-track {
    width: 100%;
    height: 12px;
    background: #475569;
    border-radius: 6px;
    position: relative;
    cursor: pointer;
}

.scrollbar-thumb {
    height: 12px;
    background: #0ea5e9;
    border-radius: 6px;
    position: absolute;
    top: 0;
    right: 0;
    width: 66.67%; /* 24h out of 36h = 66.67% */
    cursor: grab;
    transition: background-color 0.2s ease;
}

.scrollbar-thumb:hover {
    background: #0284c7;
}

.scrollbar-thumb:active {
    cursor: grabbing;
    background: #0369a1;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 1.5rem;
}

.trend-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #475569;
}

.trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #334155;
    border-radius: 0.5rem;
}

.trend-label {
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 500;
}

.trend-value {
    font-weight: 600;
    color: #f1f5f9;
}

/* Alerts Section */
.alerts-section {
    background: #991b1b;
    border: 2px solid #ef4444;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.alerts-section h2 {
    color: #fecaca;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid;
    color: #f1f5f9;
}

.alert-critical {
    background: #7f1d1d;
    border-left-color: #ef4444;
}

.alert-high {
    background: #78350f;
    border-left-color: #fbbf24;
}

.alert-message {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #f1f5f9;
}

.alert-time {
    font-size: 0.875rem;
    color: #cbd5e1;
}

/* Dam Data Styling */
.dam-summary {
    margin: 1rem 0;
}

.dam-item {
    background: #475569;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    color: #f1f5f9;
}

.dam-item strong {
    color: #0ea5e9;
    display: block;
    margin-bottom: 0.25rem;
}

.dam-item small {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* Dam Visual Representation */
.dam-visual {
    margin-top: 1rem;
    padding: 1rem;
    background: #334155;
    border-radius: 0.75rem;
    border: 1px solid #475569;
}

.dam-visual h4 {
    color: #0ea5e9;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.dam-storage-container {
    margin-bottom: 1.5rem;
}

.dam-storage-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.dam-storage-bar {
    height: 20px;
    background: #1e293b;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #475569;
    position: relative;
}

.dam-storage-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #eab308 70%, #ef4444 90%);
    transition: width 0.8s ease;
    position: relative;
}

.dam-storage-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.dam-flow-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.dam-flow-item {
    text-align: center;
    padding: 0.75rem;
    background: #1e293b;
    border-radius: 0.5rem;
    border: 1px solid #475569;
}

.dam-flow-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.dam-flow-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.25rem;
}

.dam-flow-label {
    font-size: 0.8rem;
    color: #94a3b8;
}

.inflow-icon {
    color: #3b82f6;
}

.outflow-icon {
    color: #10b981;
}

/* Mae Ngat Section */
.mae-ngat-section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid #475569;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.mae-ngat-section h2 {
    color: #0ea5e9;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Rainfall Forecast Section */
.rainfall-forecast-section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid #475569;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.rainfall-forecast-section h2 {
    color: #0ea5e9;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.forecast-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.forecast-location-card {
    background: #334155;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #475569;
}

.forecast-location-card h3 {
    color: #f1f5f9;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.forecast-periods {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.forecast-period {
    background: #1e293b;
    border-radius: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #475569;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forecast-period-label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
}

.forecast-rain-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rain-indicator {
    font-size: 1.2rem;
}

.rain-light { color: #22c55e; }
.rain-moderate { color: #eab308; }
.rain-heavy { color: #f59e0b; }
.rain-extreme { color: #ef4444; }

.forecast-loading {
    text-align: center;
    color: #94a3b8;
    padding: 2rem;
    font-style: italic;
}

.forecast-summary {
    margin-top: 1.5rem;
}

.summary-card {
    background: #334155;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #475569;
    border-left: 4px solid #0ea5e9;
}

.summary-card h4 {
    color: #0ea5e9;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.risk-assessment {
    padding: 1rem;
    background: #1e293b;
    border-radius: 0.5rem;
    border: 1px solid #475569;
}

.risk-indicator {
    font-size: 0.95rem;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.risk-low { 
    background: linear-gradient(90deg, #22c55e20, #22c55e10);
    border-color: #22c55e;
}

.risk-moderate { 
    background: linear-gradient(90deg, #eab30820, #eab30810);
    border-color: #eab308;
}

.risk-high { 
    background: linear-gradient(90deg, #f59e0b20, #f59e0b10);
    border-color: #f59e0b;
}

.risk-extreme { 
    background: linear-gradient(90deg, #ef444420, #ef444410);
    border-color: #ef4444;
}

@media (max-width: 768px) {
    .forecast-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Footer */
.footer {
    background: #1f2937;
    color: #9ca3af;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-logo {
    margin-bottom: 1.5rem;
}

.footer-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.footer-logo-image {
    width: 80px;
    height: 32px;
    object-fit: contain;
}

.footer-logo-icon {
    background: linear-gradient(135deg, #C53030 0%, #9B2C2C 100%);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.footer-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
}

.footer-logo-brand {
    color: #e5e7eb;
}

.footer-logo-ai {
    color: #FED7D7;
}

.footer p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #fca5a5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .title {
        font-size: 2rem;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .sources-grid {
        grid-template-columns: 1fr;
    }

    .trend-info {
        grid-template-columns: 1fr;
    }

    .map-controls {
        justify-content: center;
    }

    .status-card,
    .map-section,
    .data-sources,
    .historical-section {
        padding: 1.5rem;
    }

    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.75rem;
        flex-direction: column;
    }

    .title-icon {
        font-size: 1.5rem;
    }

    .status-value {
        font-size: 1.5rem;
    }

    .map-btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.map-btn:focus,
.source-link:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Leaflet Map Dark Theme Overrides */
.leaflet-container {
    background: #475569 !important;
    border-radius: 0.75rem;
}

/* Apply filter only to tile layers, not markers */
.leaflet-tile-pane {
    filter: brightness(0.7) contrast(1.1) saturate(0.8);
}

.leaflet-control-container .leaflet-control {
    background: #334155 !important;
    border: 1px solid #64748b !important;
    border-radius: 0.5rem !important;
}

.leaflet-control-zoom a {
    background: #334155 !important;
    border: none !important;
    color: #e2e8f0 !important;
}

.leaflet-control-zoom a:hover {
    background: #475569 !important;
    color: #f1f5f9 !important;
}

.leaflet-control-attribution {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #94a3b8 !important;
    font-size: 10px !important;
}

.leaflet-control-attribution a {
    color: #3b82f6 !important;
}

/* Custom marker styles */
.custom-marker {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Leaflet popup styling */
.leaflet-popup-content-wrapper {
    background: #f8fafc !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-popup-tip {
    background: #f8fafc !important;
}