/* ===================================================================
   WEATHER WIDGET (Open-Meteo) — компактный с hover-попапом на неделю
   =================================================================== */

.weather-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    color: #86868B;
    font-size: 12px;
}

.weather-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #E5E5EA;
    border-top-color: #0A84FF;
    border-radius: 50%;
    animation: geoSpin 0.8s linear infinite;
}

.weather-error {
    padding: 8px 12px;
    background: rgba(255, 59, 48, 0.08);
    border-radius: 6px;
    color: #FF3B30;
    font-size: 12px;
}

/* === Основной компактный блок === */
.weather-wrap {
    position: relative;
    display: inline-block;
}

.weather-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #F0F6FF, #E8F0FE);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    user-select: none;
}

.weather-inline:hover {
    background: linear-gradient(135deg, #E0ECFF, #D0E0FE);
    box-shadow: 0 2px 8px rgba(10, 132, 255, 0.15);
}

.weather-icon {
    font-size: 20px;
    line-height: 1;
}

.weather-temp {
    font-size: 16px;
    font-weight: 700;
    color: #1D1D1F;
}

.weather-label {
    color: #6E6E73;
    font-size: 13px;
}

.weather-hint {
    font-size: 12px;
    color: #86868B;
    margin-left: 2px;
}

/* === Hover-попап с прогнозом === */
.weather-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 320px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 14px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease-out;
    z-index: 100;
    pointer-events: none;
}

.weather-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.weather-popup-header {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #E5E5EA;
}

.weather-popup-title {
    font-size: 13px;
    font-weight: 600;
    color: #1D1D1F;
    margin-bottom: 4px;
}

.weather-popup-current {
    font-size: 11.5px;
    color: #86868B;
}

.weather-popup-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.weather-popup-day {
    display: grid;
    grid-template-columns: 60px 28px 1fr 50px;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s;
}

.weather-popup-day:hover {
    background: #F5F5F7;
}

.weather-popup-day-info {
    display: flex;
    flex-direction: column;
}

.weather-popup-day-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #1D1D1F;
    line-height: 1.2;
}

.weather-popup-day-date {
    font-size: 11px;
    color: #86868B;
    line-height: 1.2;
}

.weather-popup-day-icon {
    font-size: 20px;
    text-align: center;
}

.weather-popup-day-temps {
    display: flex;
    gap: 4px;
    font-size: 13px;
}

.weather-popup-temp-max {
    color: #1D1D1F;
    font-weight: 600;
    min-width: 24px;
}

.weather-popup-temp-min {
    color: #86868B;
}

.weather-popup-rain {
    font-size: 11.5px;
    color: #0A84FF;
    font-weight: 500;
    text-align: right;
}

.weather-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #E5E5EA;
}

.weather-popup-refresh {
    background: none;
    border: none;
    color: #0A84FF;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 5px;
    transition: background 0.15s;
}

.weather-popup-refresh:hover {
    background: rgba(10, 132, 255, 0.08);
}

.weather-popup-source {
    font-size: 10px;
    color: #B5B5BA;
}

/* === Чип погоды в карточке (рядом с названием) === */
.weather-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: none;
    background: rgba(10, 132, 255, 0.08);
    color: #1D1D1F;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1.4;
}

.weather-chip:hover {
    background: rgba(10, 132, 255, 0.18);
}

/* === Предпросмотр (полный попап из карточки) === */
.weather-preview-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: adminFadeIn 0.2s ease-out;
    padding: 20px;
}

.weather-preview-inner {
    background: white;
    border-radius: 18px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.weather-preview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: none;
    background: #F5F5F7;
    border-radius: 50%;
    font-size: 18px;
    color: #6E6E73;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.weather-preview-title {
    margin: 0 0 18px 0;
    font-size: 17px;
    font-weight: 600;
    color: #1D1D1F;
    padding-right: 32px;
}

.weather-preview-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 12px 0;
}

.weather-preview-icon {
    font-size: 56px;
}

.weather-preview-temp {
    font-size: 48px;
    font-weight: 700;
    color: #1D1D1F;
    letter-spacing: -0.02em;
}

.weather-preview-label {
    text-align: center;
    font-size: 16px;
    color: #6E6E73;
    margin-bottom: 16px;
}

.weather-preview-details {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    background: #F5F5F7;
    border-radius: 10px;
    font-size: 13px;
    color: #1D1D1F;
}

.distance-badge {
    position: absolute;
    top: 44px;
    right: 16px;
    font-size: 12px;
    color: #0A84FF;
    font-weight: 600;
    background: rgba(10, 132, 255, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
}

@media (max-width: 600px) {
    .weather-popup {
        min-width: 280px;
        left: auto;
        right: 0;
    }
    .weather-preview-details {
        flex-direction: column;
        gap: 6px;
    }
}
