/* footer วิดเจ็ต: สภาพอากาศ/ค่าฝุ่น + ป๊อปอัปรายละเอียด — โหลดหลังแชตบอต/ปุ่มแปลภาษา (ตำแหน่งเดิม) */

/* AQI Detail Popup */
.aqi-detail-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: aqiPopupBgIn 0.3s ease;
}

.aqi-detail-popup.show {
    display: flex;
}

@keyframes aqiPopupBgIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.aqi-detail-card {
    background: linear-gradient(145deg, #0d1b2a 0%, #1b2838 100%);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 24px;
    width: 360px;
    max-width: 90vw;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.05);
    overflow: hidden;
    position: relative;
    animation: aqiCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes aqiCardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.aqi-detail-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
    line-height: 1;
}

.aqi-detail-close:hover {
    color: #fff;
}

.aqi-detail-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 28px 24px 20px;
}

.aqi-detail-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 3px solid currentColor;
    transition: all 0.4s ease;
}

.aqi-detail-pm-label {
    font-size: 0.55rem;
    font-weight: 700;
    opacity: 0.7;
    letter-spacing: 1px;
}

.aqi-detail-pm-value {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    line-height: 1;
}

.aqi-detail-pm-unit {
    font-size: 0.5rem;
    opacity: 0.6;
    margin-top: 2px;
}

.aqi-detail-title h5 {
    margin: 0 0 4px;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
}

.aqi-detail-location {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.aqi-detail-location i {
    margin-right: 4px;
    color: rgba(255, 215, 0, 0.6);
}

.aqi-detail-body {
    padding: 0 24px 20px;
}

.aqi-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.aqi-detail-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.aqi-detail-value {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
}

.aqi-detail-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.15), transparent);
    margin: 6px 0 14px;
}

.aqi-detail-rec {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.aqi-detail-rec i {
    color: #ffd700;
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.aqi-detail-rec span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    line-height: 1.5;
}

.aqi-detail-footer {
    padding: 12px 24px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.aqi-detail-footer small {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.7rem;
}

/* Bottom Right Widgets Wrapper */
.bottom-right-widgets {
    position: fixed;
    bottom: 30px;
    right: 120px;
    display: flex;
    flex-direction: row-reverse;
    gap: 20px;
    z-index: 1040;
}

/* Premium Weather Widget */
.premium-weather-widget {
    position: relative;
    cursor: pointer;
    border-radius: 50px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4) 0%, rgba(255, 140, 0, 0.4) 100%);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.weather-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(8, 15, 30, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 50px;
    padding: 6px 18px 6px 8px;
    position: relative;
    z-index: 2;
}

.weather-glow-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(255, 215, 0, 0.6) 25%, transparent 50%, rgba(255, 215, 0, 0.6) 75%, transparent 100%);
    animation: rotateGlow 4s linear infinite;
    transform-origin: center;
    z-index: 1;
}

@keyframes rotateGlow {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.premium-weather-widget:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.3);
}

.weather-icon-wrapper {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), transparent);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.weather-icon {
    font-size: 1.4rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.weather-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.weather-temp {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #ffd700;
    font-size: 1.05rem;
    line-height: 1.1;
    letter-spacing: 0.5px;
}

.weather-desc {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.2;
    margin-top: 2px;
    white-space: nowrap;
}

/* ปุ่มรวม สภาพอากาศ/ค่าฝุ่น */
.env-widgets {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 12px;
}
.env-widgets-panel {
    display: none;
    flex-direction: row-reverse;
    gap: 12px;
}
.env-widgets.open .env-widgets-panel {
    display: flex;
    animation: envSlideIn 0.3s ease;
}
@keyframes envSlideIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: none; }
}
.env-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 46px;
    min-width: 46px;
    padding: 0 14px;
    border-radius: 50px;
    border: 2px solid rgba(255, 215, 0, 0.45);
    background: rgba(8, 15, 30, 0.95);
    color: #ffd700;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
    align-self: center;
}
.env-toggle:hover {
    transform: translateY(-3px);
}
.env-toggle:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}
.env-widgets.open .env-toggle .fa-cloud-sun::before {
    content: "\f00d"; /* fa-times */
}
.env-widgets.open .env-toggle-temp {
    display: none;
}

@media (max-width: 768px) {
    .bottom-right-widgets {
        bottom: 20px;
        right: 90px;
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
    }
    .env-widgets,
    .env-widgets-panel {
        flex-direction: column-reverse;
        align-items: flex-end;
    }

    .weather-desc {
        display: none;
    }

    .weather-content {
        padding: 6px 14px 6px 6px;
        gap: 8px;
    }

    .weather-icon-wrapper {
        width: 32px;
        height: 32px;
    }

    .weather-icon {
        font-size: 1.2rem;
    }
}
