/* Enhanced Weather Station Dashboard - NJ Weather Style */

.ws-dashboard-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: rgba(245, 245, 245, 0.05);
    color: #2c3e50;
}

/* Dark mode override for main text */
@media (prefers-color-scheme: dark) {
    .ws-dashboard-wrapper {
        color: #e0e0e0;
    }
}

/* Header Section */
.ws-header-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ws-station-info h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 500;
}

.ws-location {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

.ws-update-time {
    text-align: right;
    font-size: 14px;
}

.ws-update-time .ws-label {
    opacity: 0.8;
}

#ws-last-update-time {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-top: 5px;
}

/* Main Current Conditions */
.ws-current-conditions-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Primary Data Card - Works in light and dark */
.ws-primary-data {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

@media (prefers-color-scheme: dark) {
    .ws-primary-data {
        background: rgba(40, 40, 40, 0.95);
        box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    }
}

.ws-temperature-display {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.ws-temp-current {
    font-size: 72px;
    font-weight: 300;
    color: #2c3e50;
    line-height: 1;
}

@media (prefers-color-scheme: dark) {
    .ws-temp-current {
        color: #4da6ff; /* Bright blue for better visibility */
    }
}

.ws-temp-unit {
    font-size: 36px;
    color: #7f8c8d;
}

@media (prefers-color-scheme: dark) {
    .ws-temp-unit {
        color: #66b3ff; /* Lighter blue */
    }
}

.ws-temp-feels-like {
    font-size: 14px;
    color: #7f8c8d;
    margin-top: 10px;
}

@media (prefers-color-scheme: dark) {
    .ws-temp-feels-like {
        color: #b0b0b0;
    }
}

.ws-conditions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.ws-condition-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ws-condition-item .ws-label {
    color: #7f8c8d;
    font-size: 14px;
}

.ws-condition-item .ws-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

@media (prefers-color-scheme: dark) {
    .ws-condition-item .ws-value {
        color: #66b3ff; /* Bright blue for values */
    }
}

/* Wind Section - Better contrast for dark mode */
.ws-wind-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

@media (prefers-color-scheme: dark) {
    .ws-wind-section {
        background: rgba(40, 40, 40, 0.95);
        box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    }
}

.ws-wind-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 500;
}

@media (prefers-color-scheme: dark) {
    .ws-wind-section h3 {
        color: #e0e0e0;
    }
}

.ws-wind-compass {
    text-align: center;
    margin-bottom: 15px;
}

.ws-wind-compass svg {
    max-width: 100%;
    height: auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

@media (prefers-color-scheme: dark) {
    .ws-wind-compass svg {
        background: rgba(0, 0, 0, 0.3);
    }
    
    .ws-wind-compass svg circle {
        stroke: #666 !important;
    }
}

.ws-compass-label {
    fill: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    .ws-compass-label {
        fill: #e0e0e0;
    }
}

.ws-wind-details {
    text-align: center;
}

.ws-wind-speed {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

@media (prefers-color-scheme: dark) {
    .ws-wind-speed {
        color: #66b3ff; /* Bright blue for wind speed */
    }
}

.ws-wind-direction {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

@media (prefers-color-scheme: dark) {
    .ws-wind-direction {
        color: #b0b0b0;
    }
}

.ws-wind-gust {
    font-size: 14px;
    color: #95a5a6;
}

@media (prefers-color-scheme: dark) {
    .ws-wind-gust {
        color: #999;
    }
}

/* Additional Conditions - Dark mode support */
.ws-additional-conditions {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

@media (prefers-color-scheme: dark) {
    .ws-additional-conditions {
        background: rgba(40, 40, 40, 0.95);
        box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    }
}

.ws-solar-rain-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 500;
}

@media (prefers-color-scheme: dark) {
    .ws-solar-rain-section h3 {
        color: #e0e0e0;
    }
}

.ws-data-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.ws-data-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ws-data-item:last-child {
    border-bottom: none;
}

.ws-data-item .ws-label {
    color: #7f8c8d;
    font-size: 14px;
}

.ws-data-item .ws-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

@media (prefers-color-scheme: dark) {
    .ws-data-item .ws-value {
        color: #66b3ff; /* Bright blue for solar/rain values */
    }
}

/* NEW: Rainfall Analysis Link */
.ws-rainfall-link-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    .ws-rainfall-link-container {
        border-top-color: #555;
    }
}

.ws-rainfall-analysis-link {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ws-rainfall-analysis-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    color: white;
}

.ws-rainfall-analysis-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (prefers-color-scheme: dark) {
    .ws-rainfall-analysis-link {
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    
    .ws-rainfall-analysis-link:hover {
        box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    }
}

/* Charts Section - Better dark mode support */
.ws-charts-section {
    margin-bottom: 30px;
}

.ws-charts-section h2 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 20px;
}

@media (prefers-color-scheme: dark) {
    .ws-charts-section h2 {
        color: #e0e0e0;
    }
}

.ws-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
}

.ws-chart-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    height: 300px;
    position: relative;
    overflow: hidden; /* Prevent chart overflow */
}

.ws-chart-container canvas {
    max-height: 260px !important;
    max-width: 100% !important; /* Ensure canvas doesn't exceed container */
}

@media (prefers-color-scheme: dark) {
    .ws-chart-container {
        background: rgba(40, 40, 40, 0.95);
        box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    }
}

/* Weather Forecast Section - Dark mode compatibility */
.ws-forecast-section {
    margin-bottom: 30px;
}

.ws-forecast-section h2 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 20px;
}

@media (prefers-color-scheme: dark) {
    .ws-forecast-section h2 {
        color: #e0e0e0;
    }
}

.ws-forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

@media (prefers-color-scheme: dark) {
    .ws-forecast-grid {
        background: rgba(40, 40, 40, 0.95);
        box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    }
}

.ws-forecast-day {
    text-align: center;
    padding: 15px 10px;
    border-radius: 6px;
    background: rgba(248, 249, 250, 0.8);
    transition: transform 0.2s, box-shadow 0.2s;
}

@media (prefers-color-scheme: dark) {
    .ws-forecast-day {
        background: rgba(60, 60, 60, 0.8);
    }
    
    .ws-forecast-day:hover {
        background: rgba(80, 80, 80, 0.9);
    }
}

.ws-forecast-day:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ws-forecast-date {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 14px;
}

@media (prefers-color-scheme: dark) {
    .ws-forecast-date {
        color: #66b3ff; /* Bright blue for day names */
    }
}

.ws-forecast-icon {
    font-size: 36px;
    margin: 10px 0;
}

.ws-forecast-temps {
    margin: 10px 0;
}

.ws-forecast-temps .ws-temp-high {
    font-size: 20px;
    font-weight: 600;
    color: #e74c3c;
    margin-right: 8px;
}

.ws-forecast-temps .ws-temp-low {
    font-size: 18px;
    color: #3498db;
}

.ws-forecast-desc {
    font-size: 12px;
    color: #7f8c8d;
    margin: 8px 0;
    min-height: 32px;
}

.ws-forecast-wind {
    font-size: 11px;
    color: #95a5a6;
    margin: 4px 0;
}

.ws-forecast-precip {
    font-size: 11px;
    color: #3498db;
    margin: 4px 0;
}

.ws-forecast-loading,
.ws-forecast-error,
.ws-forecast-notice {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.ws-forecast-notice {
    font-size: 14px;
}

.ws-forecast-notice a {
    color: #3498db;
    text-decoration: none;
}

.ws-forecast-notice a:hover {
    text-decoration: underline;
}

/* Station Details - Dark mode support */
.ws-station-details {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

@media (prefers-color-scheme: dark) {
    .ws-station-details {
        background: rgba(40, 40, 40, 0.95);
        box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    }
}

.ws-station-details h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 500;
}

@media (prefers-color-scheme: dark) {
    .ws-station-details h3 {
        color: #e0e0e0;
    }
}

.ws-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    font-size: 14px;
    color: #7f8c8d;
}

@media (prefers-color-scheme: dark) {
    .ws-info-grid {
        color: #b0b0b0;
    }
}

.ws-info-grid div {
    padding: 5px 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ws-current-conditions-main {
        grid-template-columns: 1fr;
    }
    
    .ws-charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ws-header-section {
        flex-direction: column;
        text-align: center;
    }
    
    .ws-update-time {
        text-align: center;
        margin-top: 15px;
    }
    
    .ws-station-info h1 {
        font-size: 24px;
    }
    
    .ws-temp-current {
        font-size: 56px;
    }
    
    .ws-conditions-grid {
        grid-template-columns: 1fr;
    }
    
    .ws-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .ws-wind-compass svg {
        width: 150px;
        height: 150px;
    }
}

/* Loading State */
.ws-loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #7f8c8d;
}

/* Status Indicators */
.ws-status-good {
    color: #27ae60;
}

.ws-status-warning {
    color: #f39c12;
}

.ws-status-bad {
    color: #e74c3c;
}

/* UV Index Colors */
.uv-low {
    color: #27ae60;
}

.uv-moderate {
    color: #f39c12;
}

.uv-high {
    color: #e67e22;
}

.uv-very-high {
    color: #e74c3c;
}

.uv-extreme {
    color: #8e44ad;
}
