/* Погода — один экран, liquid glass, перетекания */
:root {
    --bg: #0f172a;
    --bg-glass: rgba(30, 41, 59, 0.6);
    --bg-glass-strong: rgba(30, 41, 59, 0.75);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-accent: rgba(96, 165, 250, 0.35);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #60a5fa;
    --accent-soft: rgba(96, 165, 250, 0.25);
    --weekend: #f87171;
    --success: #34d399;
    --radius: 16px;
    --radius-sm: 12px;
    --blur: 16px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: var(--text);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.page {
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Header — компактный */
.header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-glass);
    transition: border-color 0.25s var(--ease);
}

.header-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.title {
    margin: 0;
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.header-desc {
    display: none;
}

.header-meta {
    margin: 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
}

/* Pills — glass */
.pill {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    font-size: 0.75rem;
    color: var(--text-muted);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease);
}

.pill:hover {
    background: rgba(51, 65, 85, 0.5);
    border-color: rgba(255, 255, 255, 0.12);
}

.pill-link {
    color: var(--accent);
    border-color: var(--border-glass-accent);
    text-decoration: none;
    font-weight: 500;
}

.pill-link:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* Main — две колонки по контенту, без растягивания */
.main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    align-items: start;
}

@media (max-width: 700px) {
    .main {
        grid-template-columns: 1fr;
    }
}

.section-title {
    margin: 0 0 0.25rem 0;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

/* Колонки — liquid glass, высота по контенту */
.column {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 0.5rem 0.65rem;
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
    display: flex;
    flex-direction: column;
    align-self: start;
}

.column:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Левая колонка: время — плотно как в референсе */
.column-time {
    justify-content: flex-start;
}

.clock-wrap {
    margin-bottom: 0.1rem;
}

.clock {
    font-size: clamp(1.75rem, 3.5vw, 2.25rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    display: block;
    color: var(--text);
    line-height: 1.1;
    transition: opacity 0.3s var(--ease);
}

.timezone-note {
    margin: 0 0 0.35rem 0;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.calendar-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    margin-bottom: 0.3rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
    font-size: 0.58rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    font-size: 0.7rem;
    width: 100%;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.5);
    color: var(--text);
    border: 1px solid transparent;
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease);
}

.cal-day:not(.cal-empty):hover {
    background: rgba(51, 65, 85, 0.4);
    border-color: var(--border-glass);
}

.cal-day.cal-empty {
    background: transparent;
    border: none;
    visibility: hidden;
}

.cal-day.cal-weekend {
    color: var(--weekend);
}

.cal-day.cal-today {
    background: var(--accent);
    color: var(--text);
    font-weight: 700;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 1px var(--accent);
}

.today-line {
    margin: 0.15rem 0 0 0;
    font-size: 0.65rem;
    color: var(--text);
    line-height: 1.3;
}

.utc-line {
    margin: 0.05rem 0 0 0;
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* Правая колонка: погода — плотно, чипы в ряд как в референсе */
.column-weather {
    position: relative;
}

.weather-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.1rem;
}

.temp-main {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.temp-value {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.temp-arrow {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
}

.weather-badge {
    flex-shrink: 0;
    margin: 0;
    font-size: 0.65rem;
    padding: 0.2rem 0.45rem;
}

.temp-daynight {
    margin: 0 0 0.15rem 0;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.weather-now-desc {
    margin: 0 0 0.3rem 0;
    font-size: 0.7rem;
    color: var(--text);
    line-height: 1.35;
}

.pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.pills-row .pill {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-glass-accent);
}

.pills-row .pill:first-child {
    background: var(--accent-soft);
    border-color: var(--border-glass-accent);
    color: var(--text);
}

.uv-line {
    margin: 0 0 0.15rem 0;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.sun-times {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.weather-icon-wrap {
    margin: 0.2rem 0 0 0;
}

.weather-icon {
    width: 40px;
    height: 40px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='26' r='11' fill='%23fbbf24' opacity='0.95'/%3E%3Cellipse cx='32' cy='44' rx='22' ry='13' fill='%2394a3b8' opacity='0.85'/%3E%3C/svg%3E") center/contain no-repeat;
}

.recommendation-block {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.3rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border-glass);
}

.recommendation-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%2394a3b8' stroke-width='1.4'/%3E%3Cpath d='M24 10c-5 0-10 4-10 10v12c0 2 1.5 4 4 4h12c2.5 0 4-2 4-4V20c0-6-5-10-10-10z'/%3E%3Ccircle cx='24' cy='32' r='6'/%3E%3C/svg%3E") center/contain no-repeat;
}

.recommendation {
    margin: 0;
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.error-msg {
    color: var(--weekend);
    font-size: 0.8rem;
}

/* Блок прогноза — компактная полоса */
.forecast-section {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 0.4rem 0.65rem;
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.forecast-section:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}

.forecast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.35rem;
}

.forecast-header .section-title {
    margin: 0;
    font-size: 0.65rem;
}

.forecast-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
}

@media (max-width: 900px) {
    .forecast-cards {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

.forecast-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 0.35rem 0.45rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease);
}

.forecast-card:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.fc-day {
    font-weight: 600;
    font-size: 0.65rem;
    margin-bottom: 0.15rem;
    color: var(--text);
}

.fc-temps {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.15rem;
}

.fc-tmax {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
}

.fc-tmin {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.fc-desc {
    margin: 0 0 0.1rem 0;
    font-size: 0.6rem;
    color: var(--text);
    line-height: 1.25;
}

.fc-meta {
    margin: 0;
    font-size: 0.58rem;
    color: var(--text-muted);
}

.forecast-footer {
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid var(--border-glass);
    font-size: 0.6rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}

.muted {
    opacity: 0.9;
}

/* Плавное появление при загрузке */
@keyframes glass-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    animation: glass-in 0.4s var(--ease) both;
}

.main .column-time {
    animation: glass-in 0.45s var(--ease) 0.05s both;
}

.main .column-weather {
    animation: glass-in 0.45s var(--ease) 0.1s both;
}

.forecast-section {
    animation: glass-in 0.5s var(--ease) 0.15s both;
}
