:root {
    --primary-color: #2c5a9c;
    --secondary-color: #3e7ac2;
    --accent-color: #00aaff;
    --text-color: #f0f4f8;
    --bg-light: rgba(255, 255, 255, 0.15);
    --bg-hover: rgba(255, 255, 255, 0.25);
    --border-radius: 8px;
}

body {
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.weather-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    animation-duration: 10s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    opacity: 0.3;
}

.weather-background.sunny { animation-name: sunny; }
.weather-background.rainy { animation-name: rainy; }
.weather-background.cloudy { animation-name: cloudy; }
.weather-background.snowy { animation-name: snowy; }
.weather-background.thunderstorm { animation-name: thunderstorm; }

@keyframes slideDown {
    from { transform: translateY(-20px); }
    to { transform: translateY(0); }
}

@keyframes sunny {
    0% { background: linear-gradient(to bottom, #1e90ff, #87ceeb); }
    100% { background: linear-gradient(to bottom, #4169e1, #1e90ff); }
}

@keyframes rainy {
    0%, 100% { background: linear-gradient(to bottom, #4682b4, #708090); }
    50% { background: linear-gradient(to bottom, #708090, #4682b4); }
}

@keyframes cloudy {
    0% { background: linear-gradient(to bottom, #708090, #a9a9a9); }
    100% { background: linear-gradient(to bottom, #a9a9a9, #708090); }
}

@keyframes snowy {
    0%, 100% { background: linear-gradient(to bottom, #b0c4de, #f0f8ff); }
    50% { background: linear-gradient(to bottom, #f0f8ff, #b0c4de); }
}

@keyframes thunderstorm {
    0%, 100% { background: linear-gradient(to bottom, #2f4f4f, #483d8b); }
    50% { background: linear-gradient(to bottom, #483d8b, #2f4f4f); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 2s ease-in;
}

.hourly-container::-webkit-scrollbar {
    height: 8px;
}

.hourly-container::-webkit-scrollbar-track {
    background: var(--primary-color);
    border-radius: 10px;
}

.hourly-container::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 10px;
    border: 2px solid var(--primary-color);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none; /* Hidden by default */
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--accent-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.weather-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--bg-light);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s, background-color 0.3s;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.weather-item:hover {
    transform: translateY(-5px);
    background-color: var(--bg-hover);
}

.hour-card {
    flex: 0 0 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.hour-card.active,
.hour-card:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-color);
}

.hour-card .time {
    font-weight: 700;
}

.hour-card .temp {
    font-size: 1.2rem;
}

.suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    color: #333;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
}

.suggestion-item:hover {
    background-color: #f0f0f0;
}

/* --- THEME STYLES --- */

/* Default Day Theme Icon Colors */
#weather-icon .sun {
    fill: #FFD700; /* Gold */
    transition: fill 0.5s ease;
}
#weather-icon .cloud {
    stroke: #f0f4f8;
}
#weather-icon .rain, #weather-icon .lightning {
    stroke: var(--accent-color);
}
#weather-icon .snow {
    fill: #f0f4f8;
}


/* Night Theme Overrides */
body.night {
    --primary-color: #0d1b2a;
    --secondary-color: #1b263b;
    --accent-color: #93c5fd; /* Lighter blue for accent */
    --text-color: #e0e1dd;
    --bg-light: rgba(255, 255, 255, 0.08);
    --bg-hover: rgba(255, 255, 255, 0.15);
}

body.night .weather-background.sunny {
    animation-name: night-clear;
}

@keyframes night-clear {
    0%, 100% { background: linear-gradient(to bottom, #0d1b2a, #1b263b); }
    50% { background: linear-gradient(to bottom, #1b263b, #0d1b2a); }
}

/* Moon style for the sun icon at night */
body.night #weather-icon .sun {
    fill: #f0e68c; /* Pale Khaki, for a moon-like color */
}
