* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #14213d, #1f4068);
    color: white;
    min-height: 100vh;
    transition: background 1s ease;
}

.dashboard {
    width: 100%;
    min-height: 100vh;
    padding: 32px 48px 24px;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 18px;
}

.top-bar h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
}

.top-bar p {
    margin: 8px 0 0;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    opacity: 0.8;
}

.clock {
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: bold;
}

.current-weather {
    padding: 28px 0 30px;
}

.current-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.weather-icon img {
    width: clamp(130px, 14vw, 190px);
    height: clamp(130px, 14vw, 190px);
    object-fit: contain;
}

.temperature {
    font-size: clamp(5rem, 9vw, 8rem);
    font-weight: bold;
    line-height: 0.95;
}

.condition {
    font-size: clamp(1.5rem, 2.4vw, 2.3rem);
    margin-top: 12px;
    opacity: 0.9;
    text-transform: capitalize;
}

.today-range {
    display: flex;
    gap: 24px;
    margin-top: 14px;
    font-size: 1.1rem;
    opacity: 0.85;
}

.today-range strong {
    font-size: 1.2em;
}

.details {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-top: 30px;
}

.detail-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px 14px;
    border-radius: 16px;
    text-align: center;
    backdrop-filter: blur(4px);
}

.detail-label {
    display: block;
    font-size: 0.95rem;
    opacity: 0.7;
    margin-bottom: 8px;
}

.detail-value {
    font-size: clamp(1.2rem, 1.8vw, 1.7rem);
    font-weight: bold;
}


/* =========================================================
   Hourly Forecast
   ========================================================= */

.hourly-section {
    margin-bottom: 28px;
}

.hourly-section h2 {
    margin: 0 0 16px;
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.hourly-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 10px;
}

.hourly-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 14px 8px;
    text-align: center;
    min-width: 0;
    backdrop-filter: blur(4px);
}

.hourly-time {
    font-size: 1rem;
    font-weight: bold;
}

.hourly-icon {
    margin: 4px 0;
}

.hourly-icon img {
    width: clamp(50px, 5vw, 70px);
    height: clamp(50px, 5vw, 70px);
    object-fit: contain;
}

.hourly-temp {
    font-size: 1.25rem;
    font-weight: bold;
}

.hourly-precip {
    margin-top: 6px;
    font-size: 0.95rem;
    opacity: 0.8;
}

.hourly-precip.rain-likely {
    font-weight: bold;
    opacity: 1;
}

.forecast-section {
    flex: 1;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.forecast-section h2 {
    margin: 0 0 16px;
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.forecast-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 18px 12px;
    text-align: center;
    min-width: 0;
}

.forecast-card h3 {
    margin: 0;
    font-size: clamp(1rem, 1.5vw, 1.35rem);
}

.forecast-icon {
    margin: 8px 0;
}

.forecast-icon img {
    width: clamp(70px, 7vw, 100px);
    height: clamp(70px, 7vw, 100px);
    object-fit: contain;
}

.forecast-temp {
    font-size: clamp(1.1rem, 1.7vw, 1.5rem);
    font-weight: bold;
}

.forecast-condition {
    margin-top: 8px;
    opacity: 0.8;
    text-transform: capitalize;
    min-height: 2.4em;
}

.dashboard-footer {
    margin-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 12px;
}

.last-updated {
    text-align: right;
    font-size: 0.95rem;
    opacity: 0.65;
}

/* Weather-responsive backgrounds */
body.weather-clear {
    background: linear-gradient(135deg, #1565c0, #42a5f5);
}

body.weather-cloudy {
    background: linear-gradient(135deg, #455a64, #78909c);
}

body.weather-rain {
    background: linear-gradient(135deg, #263238, #455a64);
}

body.weather-storm {
    background: linear-gradient(135deg, #1a1a2e, #303f5b);
}

body.weather-snow {
    background: linear-gradient(135deg, #78909c, #cfd8dc);
}

body.weather-fog {
    background: linear-gradient(135deg, #607d8b, #90a4ae);
}

@media (max-width: 1100px) {
    .details {
        grid-template-columns: repeat(3, 1fr);
    }

    .hourly-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .forecast-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .dashboard {
        padding: 22px 20px;
    }

    .top-bar {
        align-items: flex-start;
        gap: 18px;
    }

    .current-main {
        gap: 15px;
    }

    .details {
        grid-template-columns: repeat(2, 1fr);
    }

    .hourly-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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