/* Montpelier Weather Plugin Styles */

/* Current Weather Widget */
.montpelier-weather-current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin-bottom: 10px; /* Tight spacing between widgets */
}

.weather-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    color: #ffffff;
}

.weather-main {
    text-align: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 15px;
}

.weather-icon {
    font-size: 48px;
    margin-bottom: 10px;
    line-height: 1;
}

.weather-temp {
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.weather-description {
    font-size: 16px;
    opacity: 0.95;
    font-weight: 500;
}

.weather-wind-section {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    padding: 15px 0;
    text-align: center;
}

.wind-speed,
.wind-chill {
    flex: 1;
}

.wind-label,
.windchill-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wind-value,
.windchill-value {
    font-size: 28px;
    font-weight: 700;
}

.weather-footer {
    margin-top: 0;  /* No margin needed - wind section has no bottom padding */
    padding-top: 5px; /* Tight spacing - 5px below horizontal line */
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.weather-footer small {
    display: block;
    margin: 0;
    padding: 0;
    opacity: 0.8;
    font-size: 12px;
    line-height: 1.4; /* Tight line spacing between updated time and station */
}

/* Overnight Forecast Table */
.montpelier-weather-overnight {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.montpelier-weather-overnight h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 600;
}

.forecast-subtitle {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 10px;
    font-style: italic;
}

.table-scroll-wrapper {
    overflow-x: auto;
    margin-bottom: 10px;
}

/* Desktop: no scroll needed */
@media (min-width: 1024px) {
    .table-scroll-wrapper {
        overflow-x: visible;
    }
}

.overnight-forecast-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* Mobile: enable scrolling */
@media (max-width: 1023px) {
    .overnight-forecast-table {
        min-width: 1200px;
    }
}

.overnight-forecast-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.overnight-forecast-table th {
    padding: 5px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.overnight-forecast-table th:first-child {
    text-align: left;
    padding-left: 8px;
    min-width: 80px;
}

.overnight-forecast-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s ease;
    background-color: #ffffff;
}

.overnight-forecast-table tbody tr:hover {
    background-color: #f8f9fa;
}

.overnight-forecast-table tbody tr:last-child {
    border-bottom: none;
}

.overnight-forecast-table td {
    padding: 5px;
    font-size: 12px;
    text-align: center;
}

.date-cell {
    font-weight: 600;
    color: #2c3e50;
    text-align: left !important;
    padding-left: 8px !important;
    font-size: 13px;
}

.hourly-cell {
    min-width: 40px;
    padding: 5px 3px;
}

.hourly-cell .temp-value {
    color: #e74c3c;
    font-weight: 600;
    font-size: 13px;
}

.hourly-cell .wc-value {
    color: #3498db;
    font-weight: 600;
    font-size: 12px;
    margin-top: 1px;
}

.hourly-cell.hour-danger {
    background-color: #fff5f5;
}

.hourly-cell.hour-danger .temp-value,
.hourly-cell.hour-danger .wc-value {
    font-weight: 700;
}

.hourly-cell.empty-cell {
    color: #bdc3c7;
}

.temp-cell {
    text-align: center;
    font-weight: 600;
    color: #3498db;
}

.windchill-cell {
    text-align: center;
    font-weight: 600;
}

.avg-cell {
    background-color: #f8f9fa;
    border-left: 2px solid #ddd;
    padding: 5px;
    min-width: 45px;
}

.avg-cell .temp-value {
    color: #2c3e50;
    font-weight: 600;
    font-size: 13px;
}

.avg-cell .wc-value {
    color: #2c3e50;
    font-weight: 600;
    font-size: 12px;
    margin-top: 1px;
}

.avg-cell .temp-value.danger-avg,
.avg-cell .wc-value.danger-avg {
    color: #e74c3c;
    font-weight: 700;
    font-size: 14px;
}

.hours-cell {
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.hours-cell.danger-hours {
    color: #e74c3c;
    font-weight: 700;
    font-size: 17px;
    background-color: #fee;
}

.hours-summary-cell {
    text-align: center;
    font-weight: 700;
    color: #2c3e50;
    font-size: 15px;
    border-left: 2px solid #ddd;
    min-width: 40px;
}

.hours-summary-cell.danger-hours {
    color: #e74c3c;
    font-size: 16px;
    background-color: #fee;
}

.shelter-cell {
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    border-left: 2px solid #ddd;
}

.shelter-cell.shelter-yes {
    color: #ffffff;
    background-color: #e74c3c;
    font-size: 18px;
    letter-spacing: 1px;
}

.shelter-cell.shelter-no {
    color: #95a5a6;
}

.threshold-cell {
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    border-left: 2px solid #ddd;
}

.threshold-cell.threshold-met {
    color: #ffffff;
    background-color: #e74c3c;
    font-size: 16px;
    letter-spacing: 1px;
}

.threshold-cell.threshold-not-met {
    color: #95a5a6;
    font-size: 13px;
}

.shelter-needed-row {
    background-color: #fff5f5 !important;
}

.shelter-needed-row:hover {
    background-color: #ffebeb !important;
}

.forecast-criteria {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin: 10px 0 20px 0;
    border-radius: 4px;
    font-size: 14px;
}

.table-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 10px 0;
    font-size: 13px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.temp-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: #e74c3c;
    border-radius: 2px;
}

.wc-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: #3498db;
    border-radius: 2px;
}

/* Severity color coding */
.windchill-cell.severe-cold {
    color: #ffffff;
    background-color: #e74c3c;
    font-weight: 700;
}

.windchill-cell.very-cold {
    color: #ffffff;
    background-color: #e67e22;
    font-weight: 700;
}

.windchill-cell.cold {
    color: #ffffff;
    background-color: #3498db;
    font-weight: 700;
}

.forecast-footer {
    margin-top: 12px;
    text-align: center;
}

.forecast-footer small {
    color: #95a5a6;
    font-size: 14px;
}

/* Error messages */
.montpelier-weather-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .overnight-forecast-table {
        font-size: 12px;
    }
    
    .overnight-forecast-table th,
    .overnight-forecast-table td {
        padding: 10px 8px;
    }
    
    .weather-temp {
        font-size: 40px;
    }
}

/* Widget-specific adjustments */
.widget .montpelier-weather-current {
    margin-bottom: 15px;
    padding: 12px;
}

.widget .weather-title {
    font-size: 14px;
    margin-bottom: 8px;
}

.widget .weather-main {
    padding: 8px 0;
    margin-bottom: 8px;
}

.widget .weather-icon {
    font-size: 32px;
    margin-bottom: 6px;
}

.widget .weather-temp {
    font-size: 34px;
    margin-bottom: 4px;
}

.widget .weather-description {
    font-size: 12px;
}

.widget .weather-wind-section {
    padding: 8px 0 0 0;  /* Remove bottom padding */
    gap: 12px;
}

.widget .wind-label,
.widget .windchill-label {
    font-size: 10px;
    margin-bottom: 4px;
}

.widget .wind-value,
.widget .windchill-value {
    font-size: 18px;
}

/* Sidebar Widget Spacing Override */
/* Force tight spacing for weather widget in sidebar */
.sidebar .widget_montpelier_weather_widget,
.sidebar-primary .widget_montpelier_weather_widget {
    margin-bottom: 10px !important;
}

/* Also ensure no extra padding/margins on widget wrapper */
aside.widget_montpelier_weather_widget {
    margin-bottom: 10px !important;
    padding-bottom: 0 !important;
}
