/* ==============================
   RESET & BASE
   ============================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: linear-gradient(180deg, #e9f3ff 0%, #ffffff 60%),
        url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?ixlib=rb-4.0.3&auto=format&fit=crop&w=1470&q=80') center/cover no-repeat;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 60px;
}

.container {
    width: min(1100px, 95%);
    margin: 0 auto;
}

/* ==============================
   HEADER
   ============================== */
.site-header {
    backdrop-filter: blur(8px);
    padding: 14px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.tagline {
    color: #334155;
    font-size: 13px;
}

/* ==============================
   SEARCH
   ============================== */
.search-area {
    display: flex;
    gap: 8px;
    align-items: center;
}

.city-input {
    width: 320px;
    max-width: 60vw;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    outline: none;
    transition: box-shadow .15s ease, transform .12s ease;
}

.city-input:focus {
    box-shadow: 0 8px 20px rgba(51, 97, 237, 0.08);
    transform: translateY(-2px);
}

.search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: linear-gradient(180deg, #3361ed, #244bcc);
    color: #fff;
    font-weight: 600;
    transition: transform .12s ease, box-shadow .12s ease;
}

.search-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(36, 75, 204, 0.12);
}

/* ==============================
   MAIN SUMMARY
   ============================== */
.main-content {
    margin-top: 18px;
}

.top-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.7));
    border-radius: 8px;
}

.location-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.location-block h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1e3a8a;
}

.location-block p {
    font-size: 15px;
    color: #374151;
}

.main-weather-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.big-temp .temperature {
    font-size: 48px;
    font-weight: 800;
    color: #0f172a;
}

.condition {
    font-size: 16px;
    color: #475569;
}

/* ==============================
   WEATHER CARDS
   ============================== */
.cards-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(2, 6, 23, 0.04);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.06);
    background: #f6fbff;
}

.card-wide {
    grid-column: span 2;
}

.card.active {
    border: 2px solid #3b82f6;
    transform: scale(1.03);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    transition: all 0.2s ease;
}

.material-symbols-outlined {
    font-size: 26px;
    color: #3361ed;
}

.card-text .small {
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
}

.value {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

/* ==============================
   FORECAST (5-DAY)
   ============================== */
.forecast {
    margin-top: 3rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.forecast:hover {
    transform: translateY(-2px);
}

.section-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 1.5rem;
}

.forecast-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    justify-items: center;
}

.forecast-day-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(2, 6, 23, 0.04);
    border-radius: 12px;
    padding: 1rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.forecast-day-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(2, 6, 23, 0.07);
    border-color: rgba(59, 130, 246, 0.3);
}

.forecast-day-card.active {
    transform: translateY(-5px) scale(1.02);
    border: 2px solid #3b82f6;
    background: #f0f5ff;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

.forecast-day-card .day-name {
    font-weight: 600;
    color: #1e40af;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.forecast-day-card .temp-range {
    font-size: 1.2rem;
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.forecast-day-card .precipitation {
    font-size: 0.9rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 4px;
}

.forecast-day-card .precipitation .material-symbols-outlined {
    font-size: 20px;
    color: #3b82f6;
}

.forecast .empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
}

/* ==============================
   CHART PANEL
   ============================== */
.chart-panel {
    margin-top: 20px;
    padding: 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.06);
    transition: transform .15s ease, opacity .15s ease;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.close-chart {
    border: none;
    background: #3361ed;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

/* ==============================
   TOAST
   ============================== */
.toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    padding: 10px 16px;
    border-radius: 8px;
    background: #111827;
    color: white;
    opacity: 0.95;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width:720px) {
    .top-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .big-temp .temperature {
        font-size: 38px;
    }

    .city-input {
        width: 200px;
    }

    .card-wide {
        grid-column: 1 / -1;
    }
}