/* ================================================
   LIQUID GLASS WEATHER DASHBOARD
   Translucent refractive panels over ambient color fields
   ================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Glass properties */
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-bg-heavy: rgba(255, 255, 255, 0.18);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-border-subtle: rgba(255, 255, 255, 0.12);
    --glass-highlight: rgba(255, 255, 255, 0.35);
    --glass-blur: 40px;
    --glass-blur-light: 20px;
    --glass-radius: 24px;
    --glass-radius-sm: 14px;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 var(--glass-highlight);
    --glass-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.35), inset 0 1px 0 var(--glass-highlight);

    /* Prismatic border gradient */
    --prism-gradient: linear-gradient(
        135deg,
        rgba(255, 120, 120, 0.4) 0%,
        rgba(255, 200, 120, 0.3) 15%,
        rgba(255, 255, 150, 0.3) 30%,
        rgba(120, 255, 180, 0.3) 45%,
        rgba(120, 200, 255, 0.4) 60%,
        rgba(160, 140, 255, 0.4) 75%,
        rgba(255, 140, 220, 0.3) 90%,
        rgba(255, 120, 120, 0.4) 100%
    );

    /* Colors */
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --accent-warm: #ff8a8a;
    --accent-cool: #8ad4ff;
    --accent-high: #ff6b6b;
    --accent-low: #74b9ff;

    /* Ambient background */
    --bg-base: #0a0e27;
    --bg-gradient: linear-gradient(160deg, #0a0e27 0%, #111640 30%, #1a1050 60%, #0d1a3a 100%);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ================================================
   AMBIENT BACKGROUND — Floating color orbs
   ================================================ */

.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--bg-gradient);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    will-change: transform;
    animation: drift 25s ease-in-out infinite alternate;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    top: -10%;
    right: -5%;
    animation-duration: 30s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #ec4899 0%, transparent 70%);
    bottom: -5%;
    left: -5%;
    animation-duration: 22s;
    animation-delay: -5s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
    top: 40%;
    left: 30%;
    animation-duration: 28s;
    animation-delay: -10s;
}

.orb-4 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #f59e0b 0%, transparent 70%);
    top: 15%;
    left: 60%;
    opacity: 0.3;
    animation-duration: 35s;
    animation-delay: -15s;
}

.orb-5 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #10b981 0%, transparent 70%);
    bottom: 20%;
    right: 20%;
    opacity: 0.35;
    animation-duration: 20s;
    animation-delay: -8s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -40px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    100% {
        transform: translate(15px, -15px) scale(1.05);
    }
}

/* ================================================
   LAYOUT
   ================================================ */

.app {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ================================================
   HEADER
   ================================================ */

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

h1 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 50%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 10px rgba(99, 102, 241, 0.3));
}

/* ================================================
   SEARCH & TOOLBAR — Glass panels
   ================================================ */

.search-container {
    position: relative;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.search-group {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-subtle);
    border-radius: var(--glass-radius-sm);
    overflow: hidden;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: inset 0 1px 0 var(--glass-highlight), 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.search-group:focus-within {
    background: var(--glass-bg-heavy);
    border-color: var(--glass-border);
    box-shadow: inset 0 1px 0 var(--glass-highlight), 0 4px 24px rgba(99, 102, 241, 0.2);
}

#city-search {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    border: none;
    border-radius: 0;
    width: 240px;
    background: transparent;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

#city-search::placeholder {
    color: var(--text-muted);
}

#city-search:focus {
    outline: none;
}

#search-btn {
    padding: 0.7rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-left: 1px solid var(--glass-border-subtle);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#search-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--glass-border-subtle);
    margin: 0 0.25rem;
}

#location-btn,
#refresh-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid var(--glass-border-subtle);
    border-radius: var(--glass-radius-sm);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur-light));
    -webkit-backdrop-filter: blur(var(--glass-blur-light));
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

#location-btn:hover:not(:disabled),
#refresh-all-btn:hover {
    background: var(--glass-bg-heavy);
    border-color: var(--glass-border);
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 var(--glass-highlight), 0 4px 16px rgba(0, 0, 0, 0.15);
}

#location-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

#location-btn svg,
#refresh-all-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}

#location-btn:hover svg,
#refresh-all-btn:hover svg {
    opacity: 1;
}

.toolbar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--glass-border-subtle);
    border-radius: 10px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur-light));
    -webkit-backdrop-filter: blur(var(--glass-blur-light));
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.toolbar-toggle:hover {
    background: var(--glass-bg-heavy);
    border-color: var(--glass-border);
    color: var(--text-secondary);
}

.toolbar-toggle.active,
.toolbar-toggle.celsius {
    background: var(--glass-bg-heavy);
    border-color: var(--glass-border);
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 12px rgba(99, 102, 241, 0.15);
}

/* ================================================
   SEARCH RESULTS DROPDOWN
   ================================================ */

.search-results {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    background: rgba(15, 15, 40, 0.8);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border-subtle);
    border-radius: var(--glass-radius);
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: var(--glass-shadow), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 100;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item .city-name {
    font-weight: 500;
}

.search-result-item .country {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ================================================
   MAIN GRID
   ================================================ */

main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-subtle);
    border-radius: var(--glass-radius);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow);
}

.empty-state p {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state .hint {
    font-size: 1rem;
    color: var(--text-muted);
}

/* ================================================
   WEATHER CARDS — The liquid glass panels
   ================================================ */

.weather-card {
    position: relative;
    border-radius: var(--glass-radius);
    padding: 1.5rem;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
    /* Base glass appearance */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-subtle);
    box-shadow: var(--glass-shadow);
}

/* Prismatic refraction border — top and left edge glow */
.weather-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--prism-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

/* Specular highlight — top reflection */
.weather-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
    pointer-events: none;
}

.weather-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow-hover);
    border-color: var(--glass-border);
}

.weather-card:hover::before {
    opacity: 0.8;
}

/* Weather type tints — subtle color wash over glass */
.weather-card.sunny {
    background: linear-gradient(135deg, rgba(184, 122, 26, 0.25) 0%, rgba(122, 74, 10, 0.2) 100%),
                var(--glass-bg);
}

.weather-card.cloudy {
    background: linear-gradient(135deg, rgba(45, 106, 159, 0.2) 0%, rgba(26, 74, 110, 0.15) 100%),
                var(--glass-bg);
}

.weather-card.rainy {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.15) 100%),
                var(--glass-bg);
}

.weather-card.snowy {
    background: linear-gradient(135deg, rgba(200, 220, 240, 0.15) 0%, rgba(160, 190, 220, 0.1) 100%),
                var(--glass-bg);
}

.weather-card.stormy {
    background: linear-gradient(135deg, rgba(55, 59, 68, 0.3) 0%, rgba(66, 134, 244, 0.2) 100%),
                var(--glass-bg);
}

.weather-card.night {
    background: linear-gradient(135deg, rgba(12, 12, 12, 0.3) 0%, rgba(26, 26, 46, 0.25) 100%),
                var(--glass-bg);
}

.weather-card.foggy {
    background: linear-gradient(135deg, rgba(142, 158, 171, 0.2) 0%, rgba(92, 109, 126, 0.15) 100%),
                var(--glass-bg);
}

/* Weather card shadows — unified glass shadow */
.weather-card.rainy,
.weather-card.snowy,
.weather-card.sunny,
.weather-card.cloudy,
.weather-card.stormy,
.weather-card.night,
.weather-card.foggy {
    box-shadow: var(--glass-shadow);
}

.weather-card.rainy:hover,
.weather-card.snowy:hover,
.weather-card.sunny:hover,
.weather-card.cloudy:hover,
.weather-card.stormy:hover,
.weather-card.night:hover,
.weather-card.foggy:hover {
    box-shadow: var(--glass-shadow-hover);
}

/* ================================================
   DRAG AND DROP
   ================================================ */

.weather-card[draggable="true"] {
    cursor: grab;
}

.weather-card[draggable="true"]:active {
    cursor: grabbing;
}

.weather-card.dragging {
    opacity: 0.5;
    transform: scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    cursor: grabbing;
}

.weather-card.drag-over {
    border: 2px dashed rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.15);
}

/* ================================================
   CARD HEADER
   ================================================ */

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.city-info h2 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.city-info .country-code {
    font-size: 0.9rem;
    opacity: 0.7;
}

.city-info .local-time {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.remove-btn, .refresh-btn {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn svg {
    flex-shrink: 0;
}

.remove-btn:hover {
    background: rgba(255, 80, 80, 0.35);
    border-color: rgba(255, 80, 80, 0.4);
    transform: scale(1.1);
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(180deg);
}

/* ================================================
   WEATHER MAIN
   ================================================ */

.weather-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.weather-icon {
    font-size: 4rem;
}

.temperature {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.temperature-block {
    display: flex;
    flex-direction: column;
}

.temperature .unit-toggle {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.7;
    display: block;
    margin-top: 0.25rem;
}

.feels-like {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.high-low {
    display: flex;
    gap: 0.75rem;
    font-size: 0.95rem;
    margin-top: 0.35rem;
}

.high-low .high {
    color: var(--accent-high);
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(255, 107, 107, 0.3);
}

.high-low .low {
    color: var(--accent-low);
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(116, 185, 255, 0.3);
}

.weather-description {
    font-size: 1.1rem;
    text-transform: capitalize;
    margin-bottom: 1rem;
    opacity: 0.85;
}

/* ================================================
   SUN TIMES & DAYLIGHT PROGRESS
   ================================================ */

.sun-times {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--glass-radius-sm);
    padding: 0.75rem;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.sun-times .sun-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 60px;
}

.sun-icon {
    font-size: 1.5rem;
}

.sun-label {
    font-size: 0.7rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sun-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.daylight-progress {
    flex: 1;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
}

.daylight-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: visible;
}

.daylight-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffeaa7 0%, #fdcb6e 50%, #f39c12 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.daylight-fill:not(.is-day) {
    background: linear-gradient(90deg, #636e72 0%, #2d3436 100%);
}

.sun-position {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
    transition: left 0.5s ease;
}

/* ================================================
   BADGES
   ================================================ */

.badges-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.aqi-badge, .uv-badge {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 0.5rem;
    border-radius: var(--glass-radius-sm);
    font-weight: 500;
    flex-wrap: wrap;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.moon-badge {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 0.5rem;
    border-radius: var(--glass-radius-sm);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #fff;
    flex-wrap: wrap;
}

.badge-emoji {
    font-size: 1rem;
}

.badge-value {
    font-weight: 700;
    font-size: 0.85rem;
}

.badge-label {
    font-size: 0.75rem;
    opacity: 0.85;
}

/* ================================================
   WEATHER DETAILS GRID
   ================================================ */

.weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.detail-item {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 10px;
    text-align: center;
}

.detail-item .label {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-bottom: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item .value {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ================================================
   LOADING & ERROR STATES
   ================================================ */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    background: rgba(255, 50, 50, 0.15);
    border: 1px solid rgba(255, 50, 50, 0.2);
    color: #fff;
    padding: 1rem;
    border-radius: var(--glass-radius-sm);
    text-align: center;
    margin-top: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .app {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .search-group {
        width: 100%;
    }

    #city-search {
        width: 100%;
        min-width: 0;
    }

    .toolbar-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-results {
        width: 90%;
    }

    main {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   COLLAPSIBLE CARDS
   ================================================ */

.card-details {
    display: none;
    margin-top: 1rem;
}

.weather-card.expanded .card-details {
    display: block;
}

.expand-btn {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expand-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.weather-card.expanded .expand-btn {
    transform: rotate(180deg);
}

.weather-card.expanded .expand-btn:hover {
    transform: rotate(180deg) scale(1.1);
}

.weather-card:not(.expanded) {
    padding: 1rem;
}

.weather-card:not(.expanded) .weather-main {
    margin-bottom: 0.5rem;
}

.weather-card:not(.expanded) .weather-description {
    margin-bottom: 0;
}

/* ================================================
   HOURLY FORECAST
   ================================================ */

.hourly-forecast {
    margin-bottom: 1rem;
    overflow: hidden;
}

.hourly-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.hourly-scroll::-webkit-scrollbar {
    height: 4px;
}

.hourly-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.hourly-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.hourly-item {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    text-align: center;
    min-width: 60px;
}

.hourly-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

.hourly-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.hourly-temp {
    font-size: 0.9rem;
    font-weight: 600;
}

.hourly-precip {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* ================================================
   DAILY FORECAST
   ================================================ */

.daily-forecast {
    margin: 1rem 0;
}

.daily-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    opacity: 0.85;
}

.daily-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.daily-item {
    display: grid;
    grid-template-columns: 60px 30px 50px 1fr;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    font-size: 0.85rem;
}

.daily-day {
    font-weight: 500;
}

.daily-icon {
    font-size: 1.1rem;
    text-align: center;
}

.daily-precip {
    font-size: 0.75rem;
    opacity: 0.7;
    text-align: center;
}

.daily-temps {
    text-align: right;
}

.daily-high {
    font-weight: 600;
    margin-right: 0.5rem;
}

.daily-low {
    opacity: 0.6;
}

/* ================================================
   LIGHT THEME — Bright glass over soft gradients
   ================================================ */

body.light-theme {
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-bg-heavy: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.7);
    --glass-border-subtle: rgba(255, 255, 255, 0.45);
    --glass-highlight: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 var(--glass-highlight);
    --glass-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.12), inset 0 1px 0 var(--glass-highlight);
    --prism-gradient: linear-gradient(
        135deg,
        rgba(255, 120, 120, 0.25) 0%,
        rgba(255, 200, 120, 0.2) 15%,
        rgba(255, 255, 150, 0.2) 30%,
        rgba(120, 255, 180, 0.2) 45%,
        rgba(120, 200, 255, 0.25) 60%,
        rgba(160, 140, 255, 0.25) 75%,
        rgba(255, 140, 220, 0.2) 90%,
        rgba(255, 120, 120, 0.25) 100%
    );
    --text-primary: #1a1a2e;
    --text-secondary: rgba(26, 26, 46, 0.7);
    --text-muted: rgba(26, 26, 46, 0.45);
    --bg-base: #e0eaf4;
    --bg-gradient: linear-gradient(160deg, #e0eaf4 0%, #d4dff0 30%, #e8ddf0 60%, #dae8f0 100%);

    color: var(--text-primary);
}

body.light-theme .ambient-bg {
    background: var(--bg-gradient);
}

body.light-theme .orb-1 {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
}

body.light-theme .orb-2 {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.3) 0%, transparent 70%);
}

body.light-theme .orb-3 {
    background: radial-gradient(circle, rgba(6, 182, 212, 0.3) 0%, transparent 70%);
}

body.light-theme .orb-4 {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
}

body.light-theme .orb-5 {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
}

body.light-theme h1 {
    background: linear-gradient(135deg, #1a1a2e 0%, #4a3a6e 50%, #6366f1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: none;
}

body.light-theme .weather-card {
    color: var(--text-primary);
}

/* Light theme weather tints */
body.light-theme .weather-card.sunny {
    background: linear-gradient(135deg, rgba(255, 236, 210, 0.5) 0%, rgba(252, 182, 159, 0.4) 100%),
                var(--glass-bg);
}

body.light-theme .weather-card.cloudy {
    background: linear-gradient(135deg, rgba(201, 214, 223, 0.5) 0%, rgba(168, 192, 200, 0.4) 100%),
                var(--glass-bg);
}

body.light-theme .weather-card.rainy {
    background: linear-gradient(135deg, rgba(168, 192, 216, 0.5) 0%, rgba(143, 168, 200, 0.4) 100%),
                var(--glass-bg);
}

body.light-theme .weather-card.snowy {
    background: linear-gradient(135deg, rgba(232, 238, 241, 0.6) 0%, rgba(205, 213, 219, 0.5) 100%),
                var(--glass-bg);
}

body.light-theme .weather-card.stormy {
    background: linear-gradient(135deg, rgba(156, 165, 176, 0.5) 0%, rgba(122, 138, 154, 0.4) 100%),
                var(--glass-bg);
    color: #fff;
}

body.light-theme .weather-card.night {
    background: linear-gradient(135deg, rgba(74, 85, 104, 0.6) 0%, rgba(45, 55, 72, 0.5) 100%),
                var(--glass-bg);
    color: #fff;
}

body.light-theme .weather-card.foggy {
    background: linear-gradient(135deg, rgba(212, 221, 230, 0.5) 0%, rgba(184, 197, 208, 0.4) 100%),
                var(--glass-bg);
}

/* Light theme toolbar & search */
body.light-theme .search-group {
    background: var(--glass-bg);
    border-color: var(--glass-border-subtle);
}

body.light-theme .search-group:focus-within {
    background: var(--glass-bg-heavy);
    border-color: var(--glass-border);
}

body.light-theme #city-search {
    color: var(--text-primary);
}

body.light-theme #city-search::placeholder {
    color: var(--text-muted);
}

body.light-theme #search-btn {
    background: rgba(0, 0, 0, 0.03);
    border-left-color: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
}

body.light-theme #search-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

body.light-theme .toolbar-divider {
    background: rgba(0, 0, 0, 0.1);
}

body.light-theme #location-btn,
body.light-theme #refresh-all-btn {
    background: var(--glass-bg);
    border-color: var(--glass-border-subtle);
    color: var(--text-secondary);
}

body.light-theme #location-btn:hover:not(:disabled),
body.light-theme #refresh-all-btn:hover {
    background: var(--glass-bg-heavy);
    border-color: var(--glass-border);
    color: var(--text-primary);
}

body.light-theme .toolbar-toggle {
    background: var(--glass-bg);
    border-color: var(--glass-border-subtle);
    color: var(--text-muted);
}

body.light-theme .toolbar-toggle:hover {
    background: var(--glass-bg-heavy);
    border-color: var(--glass-border);
    color: var(--text-secondary);
}

body.light-theme .toolbar-toggle.active,
body.light-theme .toolbar-toggle.celsius {
    background: var(--glass-bg-heavy);
    border-color: var(--glass-border);
    color: var(--text-primary);
}

body.light-theme .search-results {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
    border-color: var(--glass-border-subtle);
}

body.light-theme .search-result-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

body.light-theme .empty-state {
    background: var(--glass-bg);
}

body.light-theme .remove-btn,
body.light-theme .refresh-btn,
body.light-theme .expand-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

body.light-theme .hourly-item,
body.light-theme .daily-item {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .weather-details .detail-item {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .sun-times {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.04);
}

/* ================================================
   WEATHER ALERTS
   ================================================ */

.weather-alerts {
    margin-bottom: 0.75rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-item:last-child {
    margin-bottom: 0;
}

.alert-extreme, .alert-severe {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.6) 0%, rgba(192, 57, 43, 0.5) 100%);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: #fff;
}

.alert-moderate {
    background: linear-gradient(135deg, rgba(255, 165, 2, 0.5) 0%, rgba(230, 126, 34, 0.4) 100%);
    border: 1px solid rgba(255, 165, 2, 0.3);
    color: #fff;
}

.alert-minor {
    background: linear-gradient(135deg, rgba(255, 234, 167, 0.5) 0%, rgba(253, 203, 110, 0.4) 100%);
    border: 1px solid rgba(253, 203, 110, 0.3);
    color: #2d3436;
}

.alert-icon {
    font-size: 1rem;
}

.alert-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-expand {
    font-size: 0.7rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.alert-item:hover {
    filter: brightness(1.1);
}

.alert-details {
    display: none;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.4;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.alert-details.expanded {
    display: block;
    animation: slideDown 0.2s ease;
}

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

.alert-headline {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.alert-description {
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.alert-expires {
    font-size: 0.75rem;
    opacity: 0.6;
    font-style: italic;
}

body.light-theme .alert-details {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.06);
}

/* ================================================
   TEMPERATURE COMPARISON
   ================================================ */

.temp-comparison {
    display: inline-block;
    font-size: 0.8rem;
    margin-top: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    text-shadow: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.temp-comparison.warmer {
    background: rgba(255, 100, 100, 0.15);
    border: 1px solid rgba(255, 100, 100, 0.2);
    color: #ff8a8a;
}

.temp-comparison.cooler {
    background: rgba(100, 180, 255, 0.15);
    border: 1px solid rgba(100, 180, 255, 0.2);
    color: #8ad4ff;
}

.temp-comparison.same {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

body.light-theme .temp-comparison.warmer {
    background: rgba(255, 80, 80, 0.1);
    border-color: rgba(255, 80, 80, 0.2);
    color: #c0392b;
}

body.light-theme .temp-comparison.cooler {
    background: rgba(36, 113, 163, 0.1);
    border-color: rgba(36, 113, 163, 0.2);
    color: #2471a3;
}

body.light-theme .temp-comparison.same {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: #555;
}

/* Wind Arrow */
.wind-arrow {
    display: inline-block;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

/* Moon Badge */
body.light-theme .moon-badge {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

/* Pressure Trend */
.pressure-trend {
    font-weight: 700;
    margin-left: 0.25rem;
}

.pressure-trend.rising {
    color: var(--accent-high);
}

.pressure-trend.falling {
    color: var(--accent-low);
}

/* ================================================
   CLOTHING SUGGESTIONS
   ================================================ */

.clothing-suggestions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--glass-radius-sm);
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.clothing-item {
    font-size: 1.2rem;
    cursor: help;
}

.clothing-label {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: auto;
}

/* ================================================
   TEMPERATURE TREND GRAPH
   ================================================ */

.temp-trend {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--glass-radius-sm);
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.temp-trend-label {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.temp-trend-svg {
    width: 100%;
    height: 60px;
    display: block;
}

.temp-trend-svg .temp-label {
    font-size: 4px;
    font-weight: 600;
    fill: #fff;
}

.temp-trend-svg .temp-label-max {
    fill: #ff7675;
}

.temp-trend-svg .temp-label-min {
    fill: #74b9ff;
}

body.light-theme .temp-trend-svg .temp-label {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

body.light-theme .temp-trend-svg .temp-label-max {
    fill: #d63031;
}

body.light-theme .temp-trend-svg .temp-label-min {
    fill: #0984e3;
}

body.light-theme .temp-trend {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .clothing-suggestions {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .daylight-bar {
    background: rgba(0, 0, 0, 0.12);
}

/* ================================================
   COMPACT MODE
   ================================================ */

body.compact-mode main {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

body.compact-mode .weather-card {
    padding: 0.75rem;
}

body.compact-mode .weather-card .card-header {
    margin-bottom: 0.5rem;
}

body.compact-mode .weather-card .city-info h2 {
    font-size: 1.1rem;
}

body.compact-mode .weather-card .city-info .country-code,
body.compact-mode .weather-card .city-info .local-time {
    font-size: 0.75rem;
}

body.compact-mode .weather-card .weather-icon {
    font-size: 2.5rem;
}

body.compact-mode .weather-card .temperature {
    font-size: 2rem;
}

body.compact-mode .weather-card .feels-like,
body.compact-mode .weather-card .high-low {
    font-size: 0.8rem;
}

body.compact-mode .weather-card .weather-description {
    font-size: 0.9rem;
}

body.compact-mode .weather-card .temp-comparison {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
}

body.compact-mode .weather-card .remove-btn,
body.compact-mode .weather-card .refresh-btn,
body.compact-mode .weather-card .expand-btn {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
}

body.compact-mode .weather-card .weather-alerts .alert-item {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
}

body.compact-mode .weather-card .card-details {
    font-size: 0.85rem;
}

body.compact-mode .weather-card .hourly-item {
    min-width: 50px;
    padding: 0.4rem 0.5rem;
}

body.compact-mode .weather-card .daily-item {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

body.compact-mode .weather-card .badges-row {
    gap: 0.35rem;
}

body.compact-mode .weather-card .aqi-badge,
body.compact-mode .weather-card .uv-badge,
body.compact-mode .weather-card .moon-badge {
    padding: 0.4rem;
    font-size: 0.75rem;
}

body.compact-mode .weather-card .weather-details {
    gap: 0.35rem;
}

body.compact-mode .weather-card .detail-item {
    padding: 0.4rem;
}

body.compact-mode .weather-card .detail-item .label {
    font-size: 0.65rem;
}

body.compact-mode .weather-card .detail-item .value {
    font-size: 0.75rem;
}

@media (max-width: 400px) {
    .weather-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================
   FOOTER
   ================================================ */

footer {
    text-align: center;
    padding: 3rem 1rem 2rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.35);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.footer-logo {
    width: 48px;
    height: auto;
    margin-bottom: 1.5rem;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer-logo:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

footer p {
    margin: 0;
    opacity: 0.9;
    font-weight: 500;
}

footer a {
    color: inherit;
    text-decoration: none;
}

body.light-theme footer {
    color: rgba(26, 26, 46, 0.35);
}

body.light-theme .footer-logo {
    opacity: 0.5;
}
