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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #EDE7F6;
    color: #29213A;
    min-height: 100vh;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #EDE7F6;
    display: flex;
    flex-direction: column;
    position: relative;
}

@media (min-width: 768px) {
    .app {
        max-width: 600px;
    }
}

@media (min-width: 1024px) {
    .app {
        max-width: 720px;
    }
}

.content {
    flex: 1;
    padding: 16px;
    padding-bottom: 80px;
    width: 100%;
}

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 100;
}

@media (min-width: 768px) {
    .tab-bar {
        max-width: 600px;
    }
}

@media (min-width: 1024px) {
    .tab-bar {
        max-width: 720px;
    }
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    cursor: pointer;
    color: #554B68;
    font-size: 11px;
    transition: color 0.2s;
}

.tab-item svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.tab-item.active {
    color: #6940A2;
    font-weight: 600;
}

.center-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 16px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #D5CCEF;
    border-top-color: #6940A2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error-icon {
    font-size: 48px;
}

.error-title {
    font-size: 18px;
    font-weight: 700;
}

.error-text {
    color: #554B68;
    font-size: 14px;
}

.btn-primary {
    background: #6940A2;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #E8E2F4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar svg {
    width: 24px;
    height: 24px;
    fill: #6940A2;
}

.greeting-title {
    font-size: 14px;
    font-weight: 600;
}

.greeting-sub {
    font-size: 12px;
    color: #554B68;
}

.refresh-btn {
    width: 36px;
    height: 36px;
    background: #E8E2F4;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn svg {
    width: 20px;
    height: 20px;
    fill: #6940A2;
}

.refresh-btn.spinning svg {
    animation: spin 1s linear infinite;
}

.location {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 16px;
}

.location svg {
    width: 20px;
    height: 20px;
    fill: #6940A2;
}

.location-name {
    flex: 1;
    font-weight: 600;
}

.hero {
    background: linear-gradient(135deg, #6940A2, #9B59B6);
    color: #fff;
    padding: 24px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.hero-date {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.hero-icon svg {
    width: 80px;
    height: 80px;
}

.hero-temp {
    font-size: 64px;
    font-weight: 300;
    line-height: 1;
    margin: 8px 0;
}

.hero-condition {
    font-size: 18px;
    margin-bottom: 4px;
}

.hero-range {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.hero-details {
    display: flex;
    justify-content: space-around;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.hero-detail-value {
    font-size: 18px;
    font-weight: 600;
}

.hero-detail-label {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 4px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 20px 0 12px;
}

.hourly {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.hour-item {
    min-width: 70px;
    background: #fff;
    padding: 12px 8px;
    border-radius: 12px;
    text-align: center;
    flex-shrink: 0;
}

.hour-time {
    font-size: 12px;
    color: #554B68;
    margin-bottom: 8px;
}

.hour-icon svg {
    width: 32px;
    height: 32px;
}

.hour-temp {
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.daily-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.daily-item {
    display: flex !important;
    align-items: center;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    box-sizing: border-box;
    flex-shrink: 0;
}

.day-name {
    min-width: 110px;
    width: 110px;
    font-weight: 600;
    color: #29213A;
    flex-shrink: 0;
}

.day-icon svg {
    width: 28px;
    height: 28px;
    margin: 0 12px;
}

.day-desc {
    flex: 1;
    font-size: 13px;
    color: #554B68;
}

.day-temps {
    display: flex;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.temp-low {
    color: #554B68;
}

.status {
    text-align: center;
    font-size: 12px;
    color: #554B68;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    display: inline-block;
}

.demo-dot {
    width: 8px;
    height: 8px;
    background: #FF9800;
    border-radius: 50%;
    display: inline-block;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    padding: 20px;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .modal {
        max-width: 600px;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.modal-close svg {
    width: 24px;
    height: 24px;
    fill: #554B68;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #F5F2FA;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.search-box svg {
    width: 20px;
    height: 20px;
    fill: #6940A2;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    outline: none;
    color: #29213A;
}

.search-hint {
    font-size: 12px;
    color: #554B68;
    margin-bottom: 8px;
}

.city-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.city-result:hover {
    background: #F5F2FA;
}

.city-result-name {
    font-weight: 600;
    font-size: 14px;
}

.city-result-sub {
    font-size: 12px;
    color: #554B68;
}

.city-result svg {
    width: 20px;
    height: 20px;
    fill: #6940A2;
    margin-left: auto;
}

.saved-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E8E2F4;
}

.saved-label {
    font-size: 12px;
    color: #554B68;
    margin-bottom: 4px;
}

.saved-city {
    font-size: 14px;
    font-weight: 600;
}

.rain-map-container {
    width: 100%;
}

.rain-map-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.rain-map-city {
    font-size: 14px;
    color: #6940A2;
    margin-bottom: 12px;
}

.rain-map-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.rain-map-controls button {
    width: 36px;
    height: 36px;
    background: #E8E2F4;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #6940A2;
}

.ts {
    font-size: 13px;
    color: #554B68;
    min-width: 60px;
    text-align: center;
}

.rain-map {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .rain-map {
        height: 500px;
    }
}

@media (min-width: 1024px) {
    .rain-map {
        height: 600px;
    }
}

.layer-buttons {
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
    align-items: flex-start !important;
    margin-bottom: 12px !important;
    padding: 8px !important;
    flex-wrap: wrap !important;
}

.layer-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 14px 18px !important;
    border-radius: 14px !important;
    border: 2px solid #D5CCEF !important;
    cursor: pointer !important;
    background: #F5F2FA !important;
    color: #29213A !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    min-width: 90px !important;
    line-height: 1.3 !important;
    transition: all 0.2s !important;
    font-family: inherit !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
}

.layer-btn:hover {
    border-color: #B8A9D4 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
}

.layer-btn .btn-icon {
    font-size: 26px !important;
    line-height: 1 !important;
    display: block !important;
}

.layer-btn.active {
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}

.layer-btn[data-type="temperature"].active {
    background: linear-gradient(135deg, #FF6B35, #FF8C42) !important;
    border-color: #FF6B35 !important;
}

.layer-btn[data-type="precipitation"].active {
    background: linear-gradient(135deg, #4A90E2, #6BA3E8) !important;
    border-color: #4A90E2 !important;
}

.layer-btn[data-type="wind"].active {
    background: linear-gradient(135deg, #7B68EE, #9B8AF0) !important;
    border-color: #7B68EE !important;
}

.layer-btn[data-type="pressure"].active {
    background: linear-gradient(135deg, #9B59B6, #B07CC6) !important;
    border-color: #9B59B6 !important;
}

.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 12px;
    max-width: 200px;
    z-index: 1000;
}

.map-legend-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 13px;
}

.map-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.map-legend-color {
    width: 30px;
    height: 15px;
    border: 1px solid #ccc;
    border-radius: 2px;
}

.legend-temp .color-1 { background: #0000FF; }
.legend-temp .color-2 { background: #00FFFF; }
.legend-temp .color-3 { background: #00FF00; }
.legend-temp .color-4 { background: #FFFF00; }
.legend-temp .color-5 { background: #FF8000; }
.legend-temp .color-6 { background: #FF0000; }

.legend-precip .color-1 { background: #FFFFFF; }
.legend-precip .color-2 { background: #AADDFF; }
.legend-precip .color-3 { background: #5599FF; }
.legend-precip .color-4 { background: #0055FF; }
.legend-precip .color-5 { background: #0000AA; }
.legend-precip .color-6 { background: #000055; }

.legend-wind .color-1 { background: #FFFFFF; }
.legend-wind .color-2 { background: #AAFFAA; }
.legend-wind .color-3 { background: #55FF55; }
.legend-wind .color-4 { background: #FFFF00; }
.legend-wind .color-5 { background: #FF8800; }
.legend-wind .color-6 { background: #FF0000; }

.legend-pressure .color-1 { background: #FF00FF; }
.legend-pressure .color-2 { background: #0000FF; }
.legend-pressure .color-3 { background: #00FFFF; }
.legend-pressure .color-4 { background: #00FF00; }
.legend-pressure .color-5 { background: #FFFF00; }
.legend-pressure .color-6 { background: #FF0000; }

.rain-bar-container {
    flex: 1 1 auto !important;
    height: 8px;
    background: #E8E2F4;
    border-radius: 4px;
    margin: 0 12px;
    overflow: hidden;
    min-width: 80px;
}

.rain-bar {
    height: 100%;
    background: linear-gradient(90deg, #4A90E2, #7B68EE);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.rain-value {
    min-width: 50px;
    width: 50px;
    text-align: right;
    font-weight: 700;
    color: #4A90E2;
    font-size: 14px;
    flex-shrink: 0;
}