/* --- Стили для погоды --- */

/* Виджет на главной */
.weather-widget {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
    display: block;
}

.weather-widget:active {
    transform: scale(0.97);
    opacity: 0.8;
}

.weather-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.weather-widget-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.weather-widget-refresh {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    color: var(--accent);
    border-radius: 8px;
    transition: background 0.2s;
    line-height: 1;
}

.weather-widget-refresh:active {
    background: var(--bg-input);
}

.weather-widget-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.weather-widget-icon {
    font-size: 48px;
    line-height: 1;
    flex-shrink: 0;
}

.weather-widget-temp {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

.weather-widget-info {
    flex: 1;
    min-width: 0;
}

.weather-widget-city {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.weather-widget-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.weather-widget-meta {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--bg-primary);
    font-size: 12px;
    color: var(--text-secondary);
}

.weather-widget-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.weather-widget-error {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* --- Детальная страница погоды (weather.html) --- */
.weather-page .city-select-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.weather-page select {
    flex: 1;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 500;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-input);
    outline: none;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-card);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238e8e93' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.weather-page .btn-refresh {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: var(--radius-input);
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.weather-page .btn-refresh:active {
    transform: scale(0.92);
    opacity: 0.8;
}

.weather-page .btn-refresh.spinning {
    animation: spin 0.8s linear infinite;
}

/* --- Карточки метрик --- */
.weather-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.weather-metric-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 8px 0 4px 4px;
}

.weather-metric-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 16px 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 16px;
}

.weather-metric-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.weather-metric-body {
    flex: 1;
    min-width: 0;
}

.weather-metric-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.weather-metric-value {
    font-size: 20px;
    font-weight: 700;
}

.weather-metric-value .unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 4px;
}

/* Обновлено */
.weather-timestamp {
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 16px;
    padding: 8px;
}

/* Ошибка */
.weather-error {
    display: none;
    text-align: center;
    padding: 40px 20px;
    color: var(--danger);
}

.weather-error.show {
    display: block;
}

.weather-error-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.weather-error-text {
    font-size: 15px;
}

/* Загрузка */
.weather-loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.weather-loading.show {
    display: block;
}

/* Placeholder для виджета (если нет города) */
.weather-widget-placeholder {
    text-align: center;
    padding: 20px;
    opacity: 0.5;
}

.weather-widget-placeholder .placeholder-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.weather-widget-placeholder p {
    font-size: 13px;
    color: var(--text-secondary);
}