:root {
    --accent-color: #38bdf8;
    --bg-dark: #020617;
}
* {margin: 0; padding: 0; box-sizing: border-box;}
@keyframes pulseBg {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
    100% { filter: brightness(1); }
}
body {
    font-family: "Jersey 10", cursive;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    overflow-y: auto;
    padding: 40px 20px;
    transition: background 1.5s ease;
}
/* DYNAMIC BACKGROUND LAYERS */
body::before, body::after {content: ""; position: absolute; inset: 0; z-index: -1; transition: opacity 1.5s ease-in-out;}
body::before { background: linear-gradient(135deg, #0f172a, #1e293b); opacity: 1; }
body::after { background: var(--next-bg); opacity: 0; }
body.fade::after { opacity: 1; }

#weather {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    border: 3px solid var(--accent-color);
    border-radius: 24px;
    padding: 30px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-color);
    transition: border-color 1s ease, box-shadow 1s ease;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    gap: 12px;
}

h1 {font-size: clamp(2.5rem, 8vw, 4rem); color: var(--accent-color); text-shadow: 0 0 15px var(--accent-color); margin-bottom: 20px; transition: color 1s ease;}
input {
    font-family: "Jersey 10", cursive;
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    background: var(--bg-dark);
    color: #e2e8f0;
    outline: none;
    font-size: 1.2rem;
    display: block;
}

button {
    font-family: "Jersey 10", cursive;
    width: 100%;
    padding: 12px;
    background: var(--accent-color);
    border: none;
    border-radius: 12px;
    color: var(--bg-dark);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
}
/*BUTTON HOVER*/
button:hover { filter: brightness(1.2); transform: scale(1.02); box-shadow: 0 0 20px var(--accent-color);}
/*ELEMENTS*/
#cityName {font-size: 2rem; margin-top: 10px; color: #facc15;  text-shadow: 0 0 10px rgba(250, 204, 21, 0.5);}
#temperature {font-size: 1.5rem; margin-top: 10px;}
#description {font-size: 1.3rem; margin-top: 5px; text-transform: capitalize;}
#error {margin-top: 10px; font-size: 1.2rem; color: #ef4444; text-shadow: 0 0 5px #ef4444;}
/*DETAILS*/
.weather-details {display: flex; justify-content: space-around; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--accent-color); font-size: 1.1rem;  opacity: 0.8;}
.weather-details.secondary {border-top: none; margin-top: 0; padding-top: 5px; font-size: 1rem; color: #94a3b8;}
#uvIndex {color: #fbbf24;}
#feelsLike {font-size: 1.2rem; color: #94a3b8; margin-bottom: 5px;}
.weather-details.tertiary {border-top: 1px solid rgba(56, 189, 248, 0.2); padding-top: 10px; font-size: 0.95rem;}
.sun-times {display: flex; justify-content: space-between; width: 100%; color: #fda4af;}

#aqi {color: #4ade80;}
/*ICONS*/
#weatherIcon {image-rendering: crisp-edges; width: 100px; height: 100px; filter: invert(100%); margin: -10px auto; filter: drop-shadow(0 0 15px var(--accent-color));}

/* FORECAST STYLES */
#forecastContainer {margin-top: 20px; border-top: 2px dashed rgba(56, 189, 248, 0.4); padding-top: 15px; width: 100%;}
.forecast-title {font-size: 1.5rem; color: var(--accent-color); margin: 10px 0; text-align: left;}

.hourly-scroll {display: flex; overflow-x: auto; gap: 10px; padding-bottom: 10px; scrollbar-width: thin; scrollbar-color: #38bdf8 transparent;}
.hourly-scroll::-webkit-scrollbar {height: 6px;}
.hourly-scroll::-webkit-scrollbar-thumb {background: var(--accent-color); border-radius: 10px;}
.hourly-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    min-width: 80px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hourly-card img {width: 40px; height: 40px; filter: invert(100%);}

/* 5-DAY VERTICAL CARDS */
.daily-grid {display: flex;flex-direction: column;gap: 8px;}

.daily-card {
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid #94a3b8;
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
}

.daily-card img {width: 40px; height: 40px; filter: invert(100%);}
.daily-temp-range {color: #38bdf8;}

/* CHART STYLES */
.chart-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 15px;
    width: 100%;
    position: relative;
}

/* INPUT & BUTTON LAYOUT */
.button-row {display: flex; gap: 10px; margin-bottom: 15px;}
#locationBtn {width: 60px; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--accent-color); color: var(--accent-color);}

/* CITY LISTS */
#cityLists {display: flex; flex-direction: column; gap: 15px; margin-bottom: 10px; text-align: left;}
.list-section h4 {\font-size: 1rem; color: #94a3b8; margin-bottom: 5px; display: flex; justify-content: space-between;}
#addFavorite {cursor: pointer; transition: transform 0.2s;}
#addFavorite:hover { transform: scale(1.2); }
.chip-container {display: flex; flex-wrap: wrap; gap: 8px;}

.city-chip {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.city-chip:hover {background: var(--accent-color); color: var(--bg-dark);}

/* COMPARISON GRID */
.comparison-grid {display: grid;grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 10px;}

.compare-card {background: rgba(15, 23, 42, 0.8); border: 1px solid var(--accent-color); border-radius: 12px; padding: 10px; text-align: center; transition: transform 0.3s ease;}

.compare-card:hover { transform: translateY(-5px); }
.compare-card h5 { color: #facc15; font-size: 1.1rem; margin-bottom: 5px; }
.compare-card .comp-temp { font-size: 1.4rem; color: #fff; }
.compare-card .comp-desc { font-size: 0.8rem; color: #94a3b8; text-transform: capitalize; }


/* LIGHT MODE OVERRIDES */
body.light-mode {--bg-dark: #f1f5f9; color: #1e293b;}
body.light-mode #weather {background: rgba(255, 255, 255, 0.8); border-color: var(--accent-color); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);}

/* THEME TOGGLE STYLING */
body, #weather, h1, h2, p, input, button, .city-chip, .hourly-card, .daily-card, .compare-card, .list-section h4 {
    transition: background-color 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.6s ease,
                border-color 0.8s ease,
                box-shadow 0.8s ease;
}

/* BETTER POSITIONING */
.theme-switch {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    cursor: pointer;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s, border-color 0.8s ease;
}
.theme-switch:hover {transform: scale(1.15) rotate(15deg); background: rgba(255, 255, 255, 0.25);}
.theme-switch span {transition: transform 0.5s ease; display: inline-block;}
.theme-switch.active span {transform: rotate(360deg);}
/* LIGHT MODE ADJUSTMENTS */
body.light-mode {--bg-dark: #ffffff; background-color: #f0f2f5; color: #1e293b;}

body.light-mode::before, body.light-mode::after { opacity: 0.2 !important;}

body.light-mode #weather {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--accent-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

body.light-mode input {
    background: #fff;
    color: #1e293b;
}

/* CLEAR BUTTONS */
.clear-btn {
    font-family: "Jersey 10", cursive;
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 10px;
    width: auto;
    display: inline-block;
}

/* WEATHER ANIMATIONS CONTAINER */
#weather-effects {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
    border-radius: 24px;
}

/* RAIN DROP ANIMATION */
.rain {
    position: absolute;
    background: var(--accent-color);
    width: 2px;
    top: -50px;
    opacity: 0;
    border-radius: 2px;
    box-shadow: 0 0 5px var(--accent-color);
    animation: fall-rain linear infinite;
}

@keyframes fall-rain {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 0.7; }
    80% { opacity: 0.7; }
    100% { transform: translateY(1000px) translateX(50px); opacity: 0; }
}
/* SNOWFLAKE ANIMATION */
.snow {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    top: -30px;
    opacity: 0;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    animation: fall-snow linear infinite, sway ease-in-out infinite alternate;
}

@keyframes fall-snow {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(1000px); opacity: 0; }
}

@keyframes sway {
    0% { margin-left: -20px; }
    100% { margin-left: 20px; }
}


#weather {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-color);
}

.hourly-card, .daily-card, .chart-wrapper, .compare-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

body.light-mode #weather {
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    border-left: 1px solid rgba(255, 255, 255, 0.8);
}

/* SKELETON LOADING UI */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    color: transparent !important;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 6px;
    min-height: 1.2em;
    display: inline-block;
    width: 70%;
    margin: 4px 0;
}

body.light-mode .skeleton { background: linear-gradient(90deg, rgba(0,0,0,0.05) 25%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.05) 75%); background-size: 1000px 100%; }

/* RESPONSIVE DASHBOARD (Desktop Grid)*/
.current-weather-wrapper, .extended-weather-wrapper { width: 100%; }

@media (min-width: 900px) {
    #weather { max-width: 950px; display: flex; flex-wrap: wrap; align-items: flex-start; text-align: left; }

    .input-group, #cityLists { width: 100%; }
    .current-weather-wrapper { width: 35%; padding-right: 20px; border-right: 1px solid rgba(255,255,255,0.1); }
    .extended-weather-wrapper { width: 65%; padding-left: 20px; }

    #weatherIcon { margin: 0 !important; }
}

/* CUSTOM CURSOR */
body, button, input, .city-chip, .theme-switch, .clear-btn { cursor: none !important; }

.cursor-dot, .cursor-outline {
    position: fixed;
    top: 0; left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot { width: 8px; height: 8px; background-color: var(--accent-color);}

.cursor-outline { width: 40px; height: 40px; border: 2px solid var(--accent-color); transition: width 0.2s, height 0.2s, background-color 0.2s; }

/* CURSOR HOVER EFFECT */
.cursor-hovered {width: 60px; height: 60px; background-color: rgba(56, 189, 248, 0.2); border: 1px solid transparent;}

/* DISABLE CUSTOM CURSOR ON MOBILE (touchscreens) */
@media (max-width: 768px) {
    .cursor-dot, .cursor-outline { display: none; }
    body, button, input, .city-chip, .theme-switch, .clear-btn { cursor: auto !important; }
    button, .city-chip, .theme-switch { cursor: pointer !important; }
}
