/* weather.css */
.page-title-box {
    text-align: center;
    margin: 2rem 0;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}
.page-title-box h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #111;
}
.page-title-box p {
    color: var(--text-muted);
    font-size: 15px;
}

.weather-section {
    margin-bottom: 3rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #111;
    border-left: 4px solid var(--primary);
    padding-left: 0.8rem;
}

.mb-0 { margin-bottom: 0 !important; }

/* Current Weather Grid */
.current-weather-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.current-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 0.8rem 0.5rem;
    text-align: center;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    min-width: 0;
}

.current-card .city-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.current-card .weather-icon {
    font-size: 28px;
    margin: 0.5rem 0;
}

.current-card .temp {
    font-size: 20px;
    font-weight: 900;
    color: #111;
}

.current-card .desc {
    font-size: 11px;
    color: #888;
    margin-top: 0.2rem;
}

.current-card .pop {
    font-size: 11px;
    color: #2980b9;
    margin-top: 0.2rem;
}

/* 7 Days Forecast & City Buttons */
.city-selector {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #eee;
}

.city-btn {
    padding: 0.4rem 0;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.city-btn:hover {
    background: #f1f3f5;
    border-color: #ccc;
}

.city-btn.active {
    background: var(--primary);
    color: #fff !important;
    border-color: var(--primary);
}

/* ════════════════════════════════════
   Hourly Forecast Table
   ════════════════════════════════════ */
.forecast-hourly-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.hourly-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.hourly-table th,
.hourly-table td {
    border: 1px solid #eee;
    text-align: center;
    vertical-align: middle;
}

/* Header */
.hourly-table thead th {
    background: #f8f9fa;
    padding: 0.8rem 0.3rem;
    font-weight: 700;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 2;
}

.hourly-table tr.today td {
    background: #e8f4fd;
}

.hourly-table td.sun .day-header, .hourly-table th.sun .day-header { color: #d32f2f; }
.hourly-table td.sat .day-header, .hourly-table th.sat .day-header { color: #1976d2; }

.day-header {
    font-size: 13px;
    font-weight: 700;
}
.day-header .day-name {
    font-size: 11px;
    font-weight: 500;
    margin-left: 2px;
    color: #888;
}
.hourly-table td.sun .day-header .day-name { color: #d32f2f; }
.hourly-table td.sat .day-header .day-name { color: #1976d2; }

.day-range {
    font-size: 11px;
    margin-top: 2px;
    font-weight: 600;
}
.day-range .hi { color: #d32f2f; }
.day-range .lo { color: #1976d2; }

/* Time column (Now Date column) */
.time-col {
    width: 85px;
    min-width: 85px;
    background: #f0f2f5 !important;
    font-weight: 700;
    padding: 0.8rem 0.3rem !important;
    position: sticky;
    left: 0;
    z-index: 3;
}

.slot-header {
    background: #f8f9fa;
}

.slot-label {
    font-size: 12px;
    font-weight: 700;
    color: #333;
}
.slot-hour {
    font-size: 10px;
    color: #999;
}

/* Data cells */
.data-cell {
    padding: 0.5rem 0.2rem;
    background: #fff;
    transition: background 0.15s;
}
.data-cell:hover {
    background: #f0f7ff;
}

.cell-temp {
    font-size: 14px;
    font-weight: 800;
    color: #222;
    margin-top: 2px;
}

.cell-pop {
    font-size: 10px;
    color: #2980b9;
    margin-top: 1px;
}

.loading-data {
    text-align: center;
    padding: 3rem;
    font-size: 16px;
    color: #666;
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 1024px) {
    .board-layout {
        padding: 1rem 0.5rem;
        gap: 1rem;
    }
    .weather-container {
        padding: 1.2rem;
    }
}

@media (max-width: 768px) {
    .current-weather-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    .city-selector {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding: 0.8rem 0.5rem;
        -webkit-overflow-scrolling: touch;
        background: #f1f3f5;
        scrollbar-width: none;
    }
    .city-selector::-webkit-scrollbar { display: none; }
    .city-btn {
        flex: 0 0 auto;
        padding: 0.4rem 1rem;
        font-size: 11px;
    }
    .hourly-table {
        font-size: 11px;
        min-width: 100%;
        table-layout: auto;
    }
    .time-col {
        width: 55px;
        min-width: 55px;
        font-size: 10px;
        box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    }
    .hourly-table thead th {
        padding: 0.5rem 0.1rem;
    }
    .data-cell {
        padding: 0.4rem 0.1rem;
    }
    .data-cell i {
        font-size: 15px;
    }
    .cell-temp {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .weather-container {
        padding: 0.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .page-title-box h2 {
        font-size: 18px;
    }
    .section-title {
        font-size: 14px;
    }
    .time-col {
        width: 50px;
        min-width: 50px;
    }
    .hourly-table {
        min-width: 100%;
    }
}
