/* ============================================================
   Estacion Meteorologica - Dashboard Styles
   Responsive, professional weather UI
   Variables defined in themes.css
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.station-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.station-meta {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.station-meta a {
    color: var(--accent);
    text-decoration: none;
}

.station-meta a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.station-meta .sep {
    margin: 0 6px;
    opacity: 0.4;
}

.station-status {
    text-align: right;
    font-size: 0.85rem;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    margin-right: 6px;
    vertical-align: middle;
    transition: background 0.3s;
}

.status-dot.online { background: var(--green); box-shadow: 0 0 8px rgba(102,187,106,0.5); }
.status-dot.offline { background: var(--red); }

.last-update {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 2px;
}

/* Sections */
.section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* Cards Grid */
.current-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: var(--accent);
}

.card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Temperature Card */
.card-temp {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.temp-main {
    display: flex;
    align-items: flex-start;
}

.temp-value {
    font-size: 4rem;
    font-weight: 300;
    line-height: 1;
    color: var(--temp-color);
}

.temp-unit {
    font-size: 1.5rem;
    color: var(--text-dim);
    margin-top: 8px;
    margin-left: 4px;
}

.temp-feels {
    margin-top: 8px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Wind Compass */
.card-wind {
    grid-column: span 1;
}

.wind-display {
    display: flex;
    align-items: center;
    gap: 20px;
}

.wind-compass {
    position: relative;
    width: 130px;
    height: 130px;
    flex-shrink: 0;
}

.compass-ring {
    width: 100%;
    height: 100%;
    border: 2px solid var(--border);
    border-radius: 50%;
    position: relative;
}

.compass-label {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
}

.compass-label.n { top: 4px; left: 50%; transform: translateX(-50%); }
.compass-label.s { bottom: 4px; left: 50%; transform: translateX(-50%); }
.compass-label.e { right: 6px; top: 50%; transform: translateY(-50%); }
.compass-label.w { left: 6px; top: 50%; transform: translateY(-50%); }

.compass-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 50px;
    background: linear-gradient(to top, transparent, var(--accent));
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    transition: transform 0.8s ease;
    border-radius: 2px;
}

.compass-arrow::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid var(--accent);
}

.compass-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: var(--bg-card);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.compass-center span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--wind-color);
    line-height: 1;
}

.compass-center small {
    font-size: 0.6rem;
    color: var(--text-dim);
}

.wind-details {
    flex: 1;
}

.wind-detail {
    margin-bottom: 10px;
}

.wind-detail .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

.wind-detail .value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Gauge */
.gauge-container {
    text-align: center;
}

.gauge-value {
    font-size: 2rem;
    font-weight: 300;
}

.gauge-value small {
    font-size: 1rem;
    color: var(--text-dim);
}

.gauge-unit {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.gauge-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0 4px;
}

.gauge-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transition: width 0.8s ease;
    width: 0%;
}

.gauge-fill-humidity {
    background: linear-gradient(90deg, var(--accent), var(--rain-color));
}

.gauge-fill-solar {
    background: linear-gradient(90deg, var(--solar-color), var(--uv-color));
}

.gauge-range {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.sub-value {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Precipitation */
.precip-data {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.precip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.precip-item .label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.precip-item .value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--rain-color);
}

/* UV Display */
.uv-display {
    text-align: center;
}

.uv-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.uv-risk {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 4px 0 12px;
    padding: 2px 12px;
    border-radius: 12px;
    display: inline-block;
}

.uv-risk.low { background: var(--green); color: #000; }
.uv-risk.moderate { background: var(--uv-color); color: #000; }
.uv-risk.high { background: var(--orange); color: #000; }
.uv-risk.very-high { background: var(--red); color: #fff; }
.uv-risk.extreme { background: var(--purple); color: #fff; }

.uv-bar {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, #66bb6a, #ffee58, #ffa726, #ef5350, #ab47bc);
    position: relative;
    margin: 8px 0 4px;
}

.uv-fill {
    display: none;
}

.uv-marker {
    position: absolute;
    top: -3px;
    width: 4px;
    height: 16px;
    background: #fff;
    border-radius: 2px;
    transition: left 0.8s ease;
    left: 0%;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.uv-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Map */
.card-map {
    grid-column: span 1;
    min-height: 200px;
}

#map {
    height: 180px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

/* History Navigation */
.history-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.date-controls {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border);
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.mode-btn.active {
    background: var(--accent);
    color: var(--btn-primary-text);
    font-weight: 600;
}

.date-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color-scheme: var(--date-input-scheme);
}

/* Summary Tables */
.summary-table-wrap {
    margin-bottom: 20px;
}

.summary-date {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.summary-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.summary-table th {
    background: var(--table-header-bg);
    padding: 8px 12px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
}

.summary-table td {
    padding: 8px 12px;
    text-align: center;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.summary-table .row-label {
    text-align: left;
    color: var(--text-dim);
    font-weight: 500;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 3px;
    display: inline-flex;
    border: 1px solid var(--border);
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--accent);
    color: var(--btn-primary-text);
    font-weight: 600;
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.chart-card h4 {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 8px;
    font-weight: 600;
}

.chart-card canvas {
    width: 100% !important;
    max-height: 220px;
}

/* Data Table */
.data-table-wrap {
    overflow-x: auto;
}

.table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-size: 0.85rem;
    border: 1px solid var(--border);
}

.data-table th {
    background: var(--table-header-bg);
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
    background: var(--table-row-hover);
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px;
    margin-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.85rem;
}

.footer-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 900px) {
    .summary-tables {
        grid-template-columns: 1fr;
    }
    .current-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 600px) {
    .header { padding: 12px 16px; }
    .header-inner { flex-direction: column; align-items: flex-start; }
    .station-status { text-align: left; }
    .station-info h1 { font-size: 1.2rem; }
    .section { padding: 16px; }
    .temp-value { font-size: 3rem; }
    .current-grid { grid-template-columns: 1fr; }
    .wind-display { flex-direction: column; }
    .history-nav { flex-direction: column; align-items: stretch; }
    .date-controls { justify-content: center; }
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading .gauge-value,
.loading .temp-value {
    animation: pulse 1.5s ease infinite;
    color: var(--text-muted);
}

/* Leaflet dark tiles fix */
.leaflet-tile-pane { filter: var(--leaflet-filter); }

/* ============================================================
   SMN WEATHER ALERTS - Station Dashboard
   ============================================================ */

/* Alert Button in Header */
.alerts-btn-header {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    transition: border-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.alerts-btn-header:hover {
    border-color: var(--accent);
    color: var(--text);
}

.alerts-btn-header.has-alerts {
    border-color: var(--orange);
    color: var(--text);
}

.alerts-btn-header svg {
    flex-shrink: 0;
}

.alerts-btn-header-text {
    display: inline;
}

/* Badge */
.alerts-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    background: var(--orange);
}

.alerts-badge--danger {
    background: var(--red);
    color: #fff;
    animation: alertPulse 2s ease-in-out infinite;
}

.alerts-badge--warning {
    background: var(--orange);
    color: #000;
    animation: alertPulse 2s ease-in-out infinite;
}

.alerts-badge--advisory {
    background: var(--yellow);
    color: #000;
}

.alerts-badge--info {
    background: var(--green);
    color: #000;
}

@keyframes alertPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Modal Overlay */
.alerts-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-y: auto;
}

.alerts-modal-overlay.active {
    display: flex;
}

/* Modal */
.alerts-modal {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 700px;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.alerts-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.alerts-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.alerts-modal-title svg {
    color: var(--orange);
    flex-shrink: 0;
}

.alerts-modal-close {
    background: none;
    border: 1px solid transparent;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
}

.alerts-modal-close:hover {
    color: var(--text);
    border-color: var(--border);
}

.alerts-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 120px;
}

.alerts-modal-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.alerts-source {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Empty State */
.alerts-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
}

.alerts-empty svg {
    margin-bottom: 16px;
    color: var(--green);
    opacity: 0.6;
}

.alerts-empty p {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.alerts-empty-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Alert Groups */
.alerts-group {
    margin-bottom: 24px;
}

.alerts-group:last-child {
    margin-bottom: 0;
}

.alerts-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alerts-group-title--al {
    background: rgba(239, 83, 80, 0.12);
    color: var(--red);
    border-left: 3px solid var(--red);
}

.alerts-group-title--ac {
    background: rgba(255, 167, 38, 0.12);
    color: var(--orange);
    border-left: 3px solid var(--orange);
}

.alerts-group-title--ie {
    background: rgba(79, 195, 247, 0.12);
    color: var(--accent);
    border-left: 3px solid var(--accent);
}

/* Alert Cards */
.alert-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.alert-card:last-child {
    margin-bottom: 0;
}

.alert-card:hover {
    border-color: rgba(79, 195, 247, 0.3);
}

.alert-card--danger {
    border-left: 3px solid var(--red);
}

.alert-card--warning {
    border-left: 3px solid var(--orange);
}

.alert-card--advisory {
    border-left: 3px solid var(--yellow);
}

.alert-card--info {
    border-left: 3px solid var(--green);
}

.alert-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
}

.alert-card-severity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 50px;
    flex-shrink: 0;
}

.alert-severity-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
}

.alert-severity-dot--danger {
    background: var(--red);
    box-shadow: 0 0 8px rgba(239, 83, 80, 0.5);
}

.alert-severity-dot--warning {
    background: var(--orange);
    box-shadow: 0 0 8px rgba(255, 167, 38, 0.5);
}

.alert-severity-dot--advisory {
    background: var(--yellow);
    box-shadow: 0 0 6px rgba(255, 238, 88, 0.4);
}

.alert-severity-dot--info {
    background: var(--green);
}

.alert-severity-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.alert-card-info {
    flex: 1;
    min-width: 0;
}

.alert-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 4px;
}

.alert-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.alert-type-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.alert-type-badge--al {
    background: rgba(239, 83, 80, 0.15);
    color: var(--red);
}

.alert-type-badge--ac {
    background: rgba(255, 167, 38, 0.15);
    color: var(--orange);
}

.alert-type-badge--ie {
    background: rgba(79, 195, 247, 0.15);
    color: var(--accent);
}

.alert-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.alert-card-expand {
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
    padding: 4px;
}

.alert-card.expanded .alert-card-expand {
    transform: rotate(180deg);
}

.alert-card-details {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid var(--border);
}

.alert-card.expanded .alert-card-details {
    display: block;
}

.alert-card-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-top: 12px;
    white-space: pre-wrap;
}

.alert-card-zones {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(79, 195, 247, 0.05);
    border-radius: 6px;
    line-height: 1.6;
}

.alert-card-zones strong {
    color: var(--text-dim);
}

.alerts-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Responsive - Alerts in dashboard */
@media (max-width: 600px) {
    .alerts-btn-header-text {
        display: none;
    }

    .alerts-btn-header {
        padding: 6px 8px;
    }

    .alerts-modal-overlay {
        padding: 16px 8px;
    }

    .alerts-modal {
        max-height: calc(100vh - 32px);
    }

    .alerts-modal-header,
    .alerts-modal-body {
        padding: 14px;
    }

    .alert-card-main {
        padding: 10px 12px;
    }

    .alert-card-severity {
        min-width: 36px;
    }
}

/* ============================================================
   SKY ICON & TRENDS (card-temp enhancements)
   ============================================================ */

.sky-icon {
    margin-bottom: 4px;
    line-height: 0;
}

.sky-desc {
    font-size: 0.85rem;
    color: var(--accent);
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.trend-arrow {
    font-size: 1.2rem;
    margin-left: 6px;
    font-weight: 600;
    transition: color 0.3s;
    vertical-align: middle;
}

.trend-arrow.rising {
    color: #ef5350;
}

.trend-arrow.falling {
    color: #42a5f5;
}

.trend-arrow.stable {
    color: var(--text-dim);
}

h3 .trend-arrow {
    font-size: 0.9rem;
    margin-left: 4px;
}

/* ============================================================
   FORECAST SECTION
   ============================================================ */

/* Hourly Forecast - Horizontal scrollable */
.forecast-hourly-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.forecast-hourly-wrap::-webkit-scrollbar {
    height: 6px;
}

.forecast-hourly-wrap::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.forecast-hourly {
    display: flex;
    gap: 2px;
    padding: 4px 0;
    min-width: max-content;
}

.fh-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 72px;
    transition: background 0.15s;
}

.fh-item:hover {
    background: var(--bg-header);
}

.fh-item.fh-now {
    border-color: var(--accent);
    background: rgba(79, 195, 247, 0.08);
}

.fh-hour {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 500;
}

.fh-now .fh-hour {
    color: var(--accent);
    font-weight: 700;
}

.fh-icon {
    line-height: 0;
}

.fh-temp {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.fh-rain {
    font-size: 0.7rem;
    color: #4FC3F7;
    font-weight: 500;
}

/* 7-Day Forecast Grid */
.forecast-daily {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.fd-row {
    display: grid;
    grid-template-columns: 70px 40px 1fr 90px;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.fd-row:last-child {
    border-bottom: none;
}

.fd-row:hover {
    background: rgba(79, 195, 247, 0.04);
}

.fd-day {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.fd-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.fd-temps {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fd-min {
    font-size: 0.85rem;
    color: var(--text-dim);
    min-width: 30px;
    text-align: right;
}

.fd-max {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    min-width: 30px;
}

.fd-bar {
    flex: 1;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.fd-bar-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #42a5f5, #ffb300, #ef5350);
    border-radius: 3px;
}

.fd-detail {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.fd-rain {
    font-size: 0.75rem;
    color: #4FC3F7;
    font-weight: 500;
}

.fd-wind {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Forecast responsive */
@media (max-width: 600px) {
    .fh-item {
        padding: 10px 10px;
        min-width: 62px;
    }

    .fd-row {
        grid-template-columns: 55px 32px 1fr 70px;
        padding: 10px 12px;
        gap: 6px;
    }

    .fd-day {
        font-size: 0.78rem;
    }

    .fd-detail {
        flex-direction: column;
        gap: 2px;
    }
}

/* ============================================================
   MONTHLY/YEARLY VIEWS
   ============================================================ */

/* Month/Year Navigation */
.month-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-export {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-export:hover {
    background: rgba(79, 195, 247, 0.1);
}

.btn-export svg {
    flex-shrink: 0;
}

/* Monthly Aggregate Cards */
.monthly-aggregate {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.agg-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    text-align: center;
    transition: border-color 0.2s;
}

.agg-card:hover {
    border-color: var(--accent);
}

.agg-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.agg-value {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
}

.agg-unit {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-left: 2px;
}

/* Wind Rose */
.windrose-section {
    margin-top: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.windrose-section h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.windrose-container {
    max-width: 400px;
    height: 300px;
    margin: 0 auto;
}

.windrose-calm {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 8px;
}

.windrose-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.wr-leg {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.wr-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* ============================================================
   STATION RECORDS
   ============================================================ */

.records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.record-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: border-color 0.2s, transform 0.15s;
}

.record-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.rec-icon {
    font-size: 1.8rem;
    line-height: 1;
    flex-shrink: 0;
}

.rec-info {
    flex: 1;
    min-width: 0;
}

.rec-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.rec-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.rec-unit {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-dim);
}

.rec-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Record card accent colors */
.rec-hot .rec-value { color: #ef5350; }
.rec-cold .rec-value { color: #42a5f5; }
.rec-wind .rec-value { color: var(--accent); }
.rec-rain .rec-value { color: var(--rain-color); }
.rec-pressure .rec-value { color: var(--pressure-color); }
.rec-uv .rec-value { color: var(--uv-color); }
.rec-solar .rec-value { color: var(--solar-color); }

/* ============================================================
   RESPONSIVE - Monthly/Yearly/Records
   ============================================================ */

@media (max-width: 600px) {
    .monthly-aggregate {
        grid-template-columns: repeat(2, 1fr);
    }

    .records-grid {
        grid-template-columns: 1fr;
    }

    .month-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .btn-export {
        margin-left: 0;
    }

    .windrose-container {
        height: 250px;
    }
}
