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

:root {
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);
    --blur: blur(40px);
    --radius: 20px;
    --radius-sm: 14px;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background: #1a1a2e;
    transition: background 1s ease;
    overflow-x: hidden;
}

body.weather-clear { background: linear-gradient(135deg, #2196F3 0%, #21CBF3 50%, #4FC3F7 100%); }
body.weather-clouds { background: linear-gradient(135deg, #546E7A 0%, #78909C 50%, #90A4AE 100%); }
body.weather-rain { background: linear-gradient(135deg, #37474F 0%, #455A64 50%, #546E7A 100%); }
body.weather-thunderstorm { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); }
body.weather-snow { background: linear-gradient(135deg, #CFD8DC 0%, #ECEFF1 50%, #FAFAFA 100%); }
body.weather-mist { background: linear-gradient(135deg, #78909C 0%, #90A4AE 50%, #B0BEC5 100%); }

#weatherCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.app {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    min-width: 280px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    height: 100vh;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.close-sidebar {
    display: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    color: white;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
}

.search-input::placeholder { color: var(--text-tertiary); }
.search-input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.18);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(40px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    max-height: 320px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

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

.search-result-item {
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.search-result-item:hover { background: rgba(255, 255, 255, 0.1); }
.search-result-item:last-child { border-bottom: none; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    padding: 14px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s;
    font-family: inherit;
    font-weight: 500;
}
.nav-item:hover { background: var(--glass-bg); color: white; }
.nav-item.active { background: rgba(255, 255, 255, 0.22); color: white; font-weight: 600; }

.location-btn-sidebar {
    margin-top: auto;
    padding: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: white;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}
.location-btn-sidebar:hover { background: rgba(255, 255, 255, 0.15); }

.main-content {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
    height: 100vh;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.menu-btn {
    display: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 20px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.location-display h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    flex: 1;
}

.refresh-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 18px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.4s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.refresh-btn:hover { background: rgba(255,255,255,0.2); transform: rotate(180deg); }

.content-section {
    display: none;
    animation: fadeSlide 0.5s ease;
}
.content-section.active { display: block; }

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.current-hero {
    text-align: center;
    padding: 20px 20px 15px;
    margin-bottom: 15px;
}

.main-icon-display {
    font-size: 80px;
    line-height: 1;
    margin-bottom: 5px;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.15));
}

.temp-hero {
    font-size: 72px;
    font-weight: 200;
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -2px;
}

.temp-desc-hero {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.feels-like-hero {
    font-size: 14px;
    color: var(--text-tertiary);
}

.sun-times {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    padding: 10px 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
}

.sun-time-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sun-time-item .label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
}

.sun-time-item .time {
    font-size: 15px;
    font-weight: 600;
}

.hourly-section {
    margin-bottom: 15px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

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

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

.hourly-item {
    min-width: 60px;
    padding: 10px 6px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.2s;
}
.hourly-item:hover { transform: translateY(-3px); }

.hourly-item .time { font-size: 11px; color: var(--text-secondary); }
.hourly-item .icon { font-size: 18px; }
.hourly-item .temp { font-size: 14px; font-weight: 600; }
.hourly-item .rain-chance { font-size: 9px; color: #64B5F6; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.detail-card {
    padding: 12px 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s;
    min-width: 0;
    overflow: hidden;
}
.detail-card:hover { transform: translateY(-4px); }

.card-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    display: block;
}

.card-value {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
}

.card-sub {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.wind-compass {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.compass {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--text-tertiary);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compass-arrow {
    font-size: 14px;
    transition: transform 0.5s ease;
}

.daily-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.daily-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: transform 0.2s;
}
.daily-item:hover { transform: translateX(4px); }

.daily-item .day {
    width: 80px;
    font-weight: 500;
    font-size: 14px;
}

.daily-item .day-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.daily-item .icon { font-size: 20px; }

.daily-item .temps {
    display: flex;
    gap: 10px;
    font-weight: 600;
    min-width: 70px;
    justify-content: flex-end;
}

.daily-item .temp-max { color: white; }
.daily-item .temp-min { color: var(--text-tertiary); }
.daily-item .rain-day { font-size: 11px; color: #64B5F6; min-width: 40px; text-align: right; }

.uv-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.uv-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.error-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    background: rgba(255, 59, 48, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 14px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.4s ease;
    z-index: 1000;
}

.error-toast.active { transform: translateX(-50%) translateY(0); }

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 100;
        transition: left 0.3s ease;
    }
    .sidebar.active { left: 0; }
    .close-sidebar { display: flex; }
    .menu-btn { display: flex; }
    .main-content { padding: 15px 20px; }
    .current-hero { padding: 15px 10px; }
    .main-icon-display { font-size: 60px; }
    .temp-hero { font-size: 56px; }
    .location-display h2 { font-size: 20px; }
    .detail-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .detail-card { padding: 10px 12px; }
    .card-value { font-size: 18px; }
}
