﻿/* =========================================================
   Weather Module
   ========================================================= */

.weather-section {
    margin-bottom: 30px;
}


/* =========================================================
   General Cards
   ========================================================= */

.weather-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.08);
}


/* =========================================================
   Current Weather
   ========================================================= */

.weather-current {
    width: 100%;
}

.weather-current-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 25px;
}

.weather-current-main {
    display: flex;
    align-items: center;
    gap: 20px;
}

.weather-icon {
    font-size: 64px;
    line-height: 1;
}

.weather-current-temperature {
    font-size: 48px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.weather-current-description {
    margin-top: 5px;
    color: #64748b;
    font-size: 18px;
}


/* =========================================================
   Current Weather Details
   ========================================================= */

.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.weather-detail {
    padding: 15px;
    border-radius: 10px;
    background: #f8fafc;
}

.weather-detail-label {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 13px;
}

.weather-detail-value {
    font-size: 18px;
    font-weight: 600;
}


/* =========================================================
   Astronomy
   ========================================================= */

.weather-astro-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.weather-astro-card {
    padding: 25px;
    text-align: center;
}

.weather-astro-icon {
    margin-bottom: 10px;
    font-size: 40px;
    line-height: 1;
}

.weather-astro-title {
    margin-bottom: 8px;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
}

.weather-astro-time {
    color: #0f172a;
    font-size: 22px;
    font-weight: 700;
}

.weather-moon-phase {
    margin-top: 10px;
    color: #64748b;
    font-size: 13px;
}


/* =========================================================
   Hourly Forecast
   ========================================================= */

/*
   The Razor contains:

   .weather-hourly
       .weather-loading
       div[data-bind="foreach: hourly"]
           .weather-hour-card
           .weather-hour-card
           ...

   Therefore the foreach wrapper is made into the
   horizontal scrolling container.
*/

.weather-hourly {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

    .weather-hourly > div[data-bind="foreach: hourly"] {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: stretch;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 5px 5px 15px;
        box-sizing: border-box;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #cbd5e1 #f1f5f9;
    }


/* Hourly cards */

.weather-hour-card {
    flex: 0 0 110px !important;
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    box-sizing: border-box;
    padding: 14px 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.06);
}

.weather-hour-time {
    color: #64748b;
    font-size: 13px;
    white-space: nowrap;
}

.weather-hour-icon {
    margin: 8px 0;
    font-size: 28px;
    line-height: 1;
}

.weather-hour-temperature {
    font-size: 19px;
    font-weight: 700;
}

.weather-hour-card .weather-forecast-rain {
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
}


/* Hourly scrollbar - Chrome / Edge / Safari */

.weather-hourly > div[data-bind="foreach: hourly"]::-webkit-scrollbar {
    height: 8px;
}

.weather-hourly > div[data-bind="foreach: hourly"]::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.weather-hourly > div[data-bind="foreach: hourly"]::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

    .weather-hourly > div[data-bind="foreach: hourly"]::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }


/* =========================================================
   Daily Forecast
   ========================================================= */

.weather-forecast {
    display: grid;
    gap: 12px;
}

.weather-forecast-card {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    align-items: center;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.06);
}

.weather-forecast-day {
    font-weight: 700;
}

.weather-forecast-weather {
    display: flex;
    align-items: center;
    gap: 10px;
}

.weather-forecast-icon {
    font-size: 30px;
    line-height: 1;
}

.weather-forecast-temperature {
    font-weight: 600;
}

.weather-forecast-rain {
    color: #64748b;
}


/* =========================================================
   Loading
   ========================================================= */

.weather-loading {
    padding: 30px;
    text-align: center;
    color: #64748b;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 14px;
}


/* =========================================================
   Error
   ========================================================= */

.weather-error {
    margin-bottom: 20px;
    padding: 15px 20px;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    font-size: 14px;
}

/* =========================================================
   Bootstrap Weather Tabs
   ========================================================= */

.weather-tabs {
    margin-bottom: 0;
}

    .weather-tabs .nav-link {
        color: #64748b;
        font-weight: 600;
        border-radius: 8px 8px 0 0;
        padding: 12px 18px;
    }

        .weather-tabs .nav-link:hover {
            color: #0f172a;
        }

        .weather-tabs .nav-link.active {
            color: #0f172a;
            font-weight: 700;
        }

.weather-tab-content {
    padding-top: 25px;
}

    .weather-tab-content .weather-section {
        margin-bottom: 0;
    }


/* Mobile tabs */

@media (max-width: 600px) {

    .weather-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        scrollbar-width: thin;
    }

        .weather-tabs .nav-item {
            flex: 0 0 auto;
        }

        .weather-tabs .nav-link {
            padding: 10px 13px;
            font-size: 14px;
        }

    .weather-tab-content {
        padding-top: 20px;
    }
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 800px) {

    .weather-astro-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .weather-current-card {
        grid-template-columns: 1fr;
    }

    .weather-forecast-card {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 500px) {

    .weather-astro-grid {
        grid-template-columns: 1fr 1fr;
    }

    .weather-astro-card {
        padding: 18px 10px;
    }

    .weather-astro-icon {
        font-size: 30px;
    }

    .weather-current-temperature {
        font-size: 40px;
    }

    .weather-current-main {
        gap: 12px;
    }

    .weather-icon {
        font-size: 52px;
    }

    .weather-details {
        gap: 10px;
    }

    .weather-detail {
        padding: 12px;
    }

    .weather-forecast-card {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .weather-hour-card {
        flex-basis: 105px !important;
        width: 105px;
        min-width: 105px;
        max-width: 105px;
    }
}
