﻿/* ================================================
   Weather Widget - Clean & Artistic
   ================================================ */

.weather-widget-container {
    width: 100%;
    margin-bottom: 1rem;
}

.weather-widget-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    min-height: 170px;
    transition: all 0.3s ease;
}

    .weather-widget-card.card-hover-effect {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

        .weather-widget-card.card-hover-effect:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        }

    /* ================================================
   Sky Themes
   ================================================ */

    .weather-widget-card.clear-day {
        background: linear-gradient(180deg, #2563eb 0%, #60a5fa 50%, #93c5fd 100%);
    }

    .weather-widget-card.clear-night {
        background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    }

    .weather-widget-card.cloudy-day {
        background: linear-gradient(180deg, #64748b 0%, #94a3b8 50%, #cbd5e1 100%);
    }

    .weather-widget-card.cloudy-night {
        background: linear-gradient(180deg, #1e293b 0%, #334155 50%, #475569 100%);
    }

    .weather-widget-card.rainy-day,
    .weather-widget-card.rainy-night {
        background: linear-gradient(180deg, #475569 0%, #64748b 50%, #94a3b8 100%);
    }

    .weather-widget-card.foggy-day {
        background: linear-gradient(180deg, #9ca3af 0%, #d1d5db 50%, #e5e7eb 100%);
    }

    .weather-widget-card.foggy-night {
        background: linear-gradient(180deg, #374151 0%, #4b5563 50%, #6b7280 100%);
    }

/* ================================================
   Sky Background
   ================================================ */

.sky-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

/* Celestial Bodies */
.celestial-body {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 2;
}

/* Sun */
.sun {
    position: relative;
    width: 45px;
    height: 45px;
    background: radial-gradient(circle, #fef08a 0%, #fde047 50%, #facc15 100%);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(253, 224, 71, 0.6);
    animation: sunPulse 4s ease-in-out infinite;
}

.sun-ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #fde047, transparent);
    transform-origin: 0 50%;
    transform: translate(-50%, -50%) rotate(calc(var(--ray) * 45deg));
    animation: rayRotate 15s linear infinite;
}

/* Moon */
.moon {
    position: relative;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at 35% 35%, #fef3c7 0%, #fde68a 50%, #fcd34d 100%);
    border-radius: 50%;
    box-shadow: inset -5px -5px 10px rgba(0, 0, 0, 0.1);
}

.moon-glow {
    position: absolute;
    inset: -10px;
    background: radial-gradient(circle, rgba(254, 243, 199, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: moonGlow 3s ease-in-out infinite;
}

/* Stars */
.stars {
    position: absolute;
    inset: 0;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    left: var(--x);
    top: var(--y);
    animation: twinkle 3s ease-in-out infinite;
    animation-delay: var(--delay);
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

/* Clouds */
.clouds {
    position: absolute;
    inset: 0;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 100px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

    .cloud::before,
    .cloud::after {
        content: '';
        position: absolute;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 100px;
    }

.cloud-1 {
    width: 70px;
    height: 25px;
    top: 20%;
    left: 15%;
    animation: cloudFloat 20s linear infinite;
}

    .cloud-1::before {
        width: 35px;
        height: 35px;
        top: -18px;
        left: 12px;
    }

    .cloud-1::after {
        width: 40px;
        height: 30px;
        top: -12px;
        right: 8px;
    }

.cloud-2 {
    width: 60px;
    height: 20px;
    top: 40%;
    right: 20%;
    animation: cloudFloat 25s linear infinite reverse;
}

.cloud-3 {
    width: 50px;
    height: 18px;
    top: 55%;
    left: 25%;
    animation: cloudFloat 22s linear infinite;
}

/* Rain */
.rain {
    position: absolute;
    inset: 0;
}

.drop {
    position: absolute;
    left: var(--x);
    top: -20px;
    width: 2px;
    height: 20px;
    background: linear-gradient(transparent, rgba(174, 194, 224, 0.8));
    animation: rainFall 1s linear infinite;
    animation-delay: var(--delay);
}

/* ================================================
   Content Area
   ================================================ */

.weather-content {
    position: relative;
    z-index: 10;
    padding: 1rem;
}

/* Current Weather */
.current-weather {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.weather-icon {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.weather-info {
    flex: 1;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.temp {
    display: flex;
    align-items: baseline;
    line-height: 1;
}

.temp-num {
    font-size: 2rem;
    font-weight: 700;
}

.temp-unit {
    font-size: 0.9rem;
    margin-left: 0.2rem;
}

.condition {
    font-size: 0.9rem;
    margin: 0.2rem 0;
}

.location {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    opacity: 0.95;
}

.update {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    color: white;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    backdrop-filter: blur(5px);
}

/* ================================================
   Forecast Sections
   ================================================ */

.forecast-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.forecast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem;
}

    .forecast-header .title {
        color: white;
        font-size: 0.85rem;
        font-weight: 600;
    }

.btn-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-toggle:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
    }

.forecast-list {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

    .forecast-list::-webkit-scrollbar {
        height: 4px;
    }

    .forecast-list::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }

.forecast-item {
    flex: 0 0 auto;
    min-width: 55px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
    color: white;
    transition: all 0.2s;
}

    .forecast-item:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
    }

    .forecast-item img {
        width: 30px;
        height: 30px;
        margin: 0.25rem 0;
    }

    .forecast-item .time,
    .forecast-item .day {
        font-size: 0.7rem;
        display: block;
        margin-bottom: 0.2rem;
    }

    .forecast-item .temp {
        font-size: 0.8rem;
        font-weight: 600;
    }

    .forecast-item.daily {
        min-width: 70px;
    }

.temps {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    margin-top: 0.2rem;
}

    .temps .max {
        font-weight: 600;
    }

    .temps .min {
        opacity: 0.7;
    }

/* ================================================
   Animations
   ================================================ */

@keyframes sunPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes moonGlow {
    0%, 100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes rayRotate {
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

@keyframes cloudFloat {
    0%, 100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(15px);
    }
}

@keyframes rainFall {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    100% {
        transform: translateY(200px);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .temp-num {
        font-size: 1.75rem;
    }

    .weather-icon {
        width: 45px;
        height: 45px;
    }
}
