:root {
    /* Day Theme */
    --bg-gradient: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);
    --text-primary: #1e3c72;
    --text-secondary: #5a6e8c;
    --accent: #2a5298;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --sidebar-width: 280px;
    --card-radius: 20px;
}

.dark-mode {
    /* Night Theme */
    --bg-gradient: linear-gradient(to right, #0f2027, #203a43, #2c5364);
    --glass-bg: rgba(16, 26, 38, 0.6);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --accent: #4facfe;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

/* Dynamic Backgrounds */
.bg-sunny {
    --bg-gradient: linear-gradient(120deg, #fceabb 0%, #f8b500 100%);
    --text-primary: #5a4a00;
}

.bg-cloudy {
    --bg-gradient: linear-gradient(to bottom, #bdc3c7, #2c3e50);
    --text-primary: #2c3e50;
}

.dark-mode.bg-cloudy {
    --text-primary: #f0f0f0;
}

.bg-rainy {
    --bg-gradient: linear-gradient(to bottom, #4b6cb7, #182848);
    --glass-bg: rgba(20, 30, 48, 0.6);
}

.bg-snowy {
    --bg-gradient: linear-gradient(to bottom, #E0EAFC, #CFDEF3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background: var(--bg-gradient);
    height: 100vh;
    overflow: hidden;
    color: var(--text-primary);
    transition: background 0.8s ease;
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    transition: transform 0.3s ease;
    z-index: 100;
}

.logo h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    font-weight: 700;
}

.highlight {
    color: var(--accent);
}

/* Search In Sidebar */
.search-wrapper {
    margin-bottom: 2rem;
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    border: var(--glass-border);
    border-radius: 12px;
    padding: 10px;
    transition: 0.3s;
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.search-icon {
    margin-right: 10px;
    color: var(--text-secondary);
}

#city-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
}

#city-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.icon-btn-small {
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 1rem;
}

.sidebar-btn {
    margin-top: 10px;
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-btn:hover {
    background: var(--accent);
    color: white;
}

/* Navigation Lists */
.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.nav-menu h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 1.5rem 0 0.8rem;
    letter-spacing: 1px;
}

.nav-list {
    list-style: none;
}

.nav-list li {
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    font-weight: 500;
    margin-bottom: 5px;
}

.nav-list li:hover {
    background: rgba(255, 255, 255, 0.15);
}

.placeholder-text {
    font-style: italic;
    color: var(--text-secondary);
    cursor: default !important;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 35px;
    height: 35px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

#user-name-display {
    font-weight: 600;
    font-size: 0.95rem;
}

.settings-row {
    display: flex;
    gap: 5px;
}

.settings-row .icon-btn {
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 5px;
}

.settings-row .icon-btn:hover {
    color: var(--accent);
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    position: relative;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

/* Glass Panels Generic */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: var(--glass-border);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: transform 0.3s;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    grid-template-rows: auto auto;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* 1. Hero Card */
.hero-card {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 3rem;
    position: relative;
    overflow: hidden;
}

.hero-header h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
}

.hero-header p {
    font-size: 1.5rem;
    opacity: 0.8;
    font-weight: 300;
}

.hero-header {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    justify-content: space-between;
}

.hero-body {
    display: flex;
    gap: 60px;
    align-items: center;
}

.hero-temp-group {
    display: flex;
    align-items: flex-start;
}

#temperature {
    font-size: 8rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -3px;
}

.degree {
    font-size: 4rem;
    margin-top: 15px;
    font-weight: 400;
}

.hero-icon-group {
    text-align: center;
}

.weather-icon-container {
    font-size: 5rem;
    margin-bottom: 10px;
    color: var(--accent);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
}

#condition {
    font-size: 1.8rem;
    font-weight: 500;
    text-transform: capitalize;
}

#feels-like {
    opacity: 0.8;
    font-size: 1rem;
}

/* 2. Highlights Grid */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    grid-row: 2;
    grid-column: 1 / 2;
}

.card-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100px;
}

.big-value {
    font-size: 2.2rem;
    font-weight: 600;
}

.unit {
    font-size: 1rem;
    opacity: 0.7;
}

/* Sun Cycle */
.sun-cycle {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
    justify-content: space-around;
}

.sun-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.sun-item i {
    font-size: 1.5rem;
    color: #f39c12;
}

.sun-item .down {
    color: #8e44ad;
}

.sun-item span {
    font-weight: 600;
}

.sun-item p {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Progress Bar */
.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 1s;
    box-shadow: 0 0 10px var(--accent);
}

/* 3. Forecast Column */
.forecast-column {
    grid-row: 2;
    grid-column: 2 / 3;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Lists */
.scroll-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

/* Scrollbar Styling */
.scroll-container::-webkit-scrollbar {
    height: 6px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.hourly-item {
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 12px;
}

.hourly-time {
    font-size: 0.85rem;
    margin-bottom: 5px;
    opacity: 0.8;
}

.hourly-icon {
    font-size: 1.4rem;
    color: var(--accent);
    margin: 5px 0;
}

.hourly-temp {
    font-weight: 700;
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.daily-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.daily-item:last-child {
    border-bottom: none;
}

.daily-day {
    width: 40%;
    font-weight: 500;
}

.daily-icon {
    width: 20%;
    text-align: center;
    color: var(--accent);
    font-size: 1.2rem;
}

.daily-temps {
    width: 40%;
    text-align: right;
}

/* Empty State */
.welcome-container {
    text-align: center;
    margin: auto;
    max-width: 500px;
    display: flex;
    /* Added flex to center content properly */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    /* Give it some height */
}

.welcome-icon {
    font-size: 6rem;
    color: var(--accent);
    margin-top: 2rem;
    opacity: 0.8;
}

/* Utils */
.hidden {
    display: none !important;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    width: 90%;
    max-width: 400px;
    text-align: center;
    background: white;
    color: #333;
}

.dark-mode .modal-content {
    background: #2c3e50;
    color: white;
}

.primary-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

input#username-input {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    width: 100%;
    margin-top: 10px;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #e74c3c;
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

/* Spinner */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1500;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .dashboard-container {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 1rem;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-menu {
        display: none;
        /* Hide lists on mobile for simplicity or put in drawer */
    }

    .logo {
        margin-bottom: 0;
        margin-right: auto;
    }

    .search-wrapper {
        order: 2;
        width: 100%;
        margin: 1rem 0;
    }

    .sidebar-footer {
        order: 1;
        border: none;
        padding: 0;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .hero-body {
        flex-direction: column;
        gap: 20px;
    }

    #temperature {
        font-size: 5rem;
    }

    .highlights-grid {
        grid-column: 1 / -1;
    }

    .forecast-column {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    body {
        overflow-y: auto;
    }
}

/* --- Auth Overlay --- */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.auth-overlay.hidden {
    display: none;
}

.auth-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3rem;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.8s ease-out;
}

.auth-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: white;
}

.auth-header p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.input-group input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.full-width-btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    color: white;
    background: var(--accent);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
    margin-top: 10px;
}

.full-width-btn:hover {
    background: #00cec9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}