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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #fff;
    padding: 20px;
    transition: background 0.8s ease;
}

body.weather-sunny {
    background: linear-gradient(145deg, #facc15 0%, #fb923c 48%, #38bdf8 100%);
}

body.weather-cloudy {
    background: linear-gradient(145deg, #64748b 0%, #94a3b8 48%, #cbd5e1 100%);
}

body.weather-rainy {
    background: linear-gradient(145deg, #334155 0%, #64748b 50%, #0f172a 100%);
}

body.weather-snowy {
    background: linear-gradient(145deg, #e0f2fe 0%, #93c5fd 48%, #475569 100%);
}

body.weather-foggy {
    background: linear-gradient(145deg, #475569 0%, #94a3b8 50%, #e2e8f0 100%);
}

body.weather-stormy {
    background: linear-gradient(145deg, #111827 0%, #312e81 48%, #64748b 100%);
}

/* App Container */
.app {
    max-width: 600px;
    margin: 0 auto;
}

/* Main Weather Container */
.weather-container {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-radius: 48px;
    padding: 24px;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Header & Search */
.header {
    margin-bottom: 32px;
}

.search-wrapper {
    width: 100%;
}

.search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 60px;
    padding: 6px 6px 6px 20px;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.search-form:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.search-icon {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

/* Search Input Wrapper for suggestions */
.search-input-wrapper {
    flex: 1;
    position: relative;
}

#search-input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 14px 0;
    font-size: 1rem;
    color: white;
    outline: none;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-form button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.search-form button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

.location-btn {
    background: rgba(100, 150, 255, 0.3);
}

/* Suggestions Dropdown */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 25, 45, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: none;
}

.suggestions-dropdown.show {
    display: block;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.suggestion-item:hover {
    background: rgba(165, 180, 252, 0.2);
}

.suggestion-item i {
    color: #a5b4fc;
    font-size: 0.9rem;
    width: 24px;
}

.suggestion-item .suggestion-name {
    flex: 1;
    font-weight: 500;
    color: white;
}

.suggestion-item .suggestion-country {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.suggestion-item.selected {
    background: rgba(165, 180, 252, 0.3);
}

/* Scrollbar for suggestions */
.suggestions-dropdown::-webkit-scrollbar {
    width: 6px;
}

.suggestions-dropdown::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.suggestions-dropdown::-webkit-scrollbar-thumb {
    background: rgba(165, 180, 252, 0.5);
    border-radius: 10px;
}

/* History Header */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    margin-bottom: 8px;
}

.history-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
}

.clear-history-btn {
    background: rgba(220, 60, 60, 0.2);
    border: 0.5px solid rgba(220, 60, 60, 0.3);
    border-radius: 40px;
    padding: 4px 12px;
    font-size: 0.7rem;
    color: #ff8a8a;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.clear-history-btn:hover {
    background: rgba(220, 60, 60, 0.4);
    color: #ffcccc;
    transform: scale(0.95);
}

.history-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

/* History items */
.history-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 0.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 40px;
    padding: 4px 4px 4px 16px;
    transition: all 0.2s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.history-item button.city-btn {
    background: transparent;
    border: none;
    padding: 6px 8px;
    font-size: 0.8rem;
    color: #cdd6f4;
    cursor: pointer;
    flex: 1;
    text-align: left;
}

.history-item button.city-btn:hover {
    color: white;
}

.delete-item-btn {
    background: rgba(220, 60, 60, 0.3);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
    color: #ffaaaa;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-item-btn:hover {
    background: rgba(220, 60, 60, 0.7);
    color: white;
    transform: scale(1.05);
}

/* Weather Hero Section */
.weather-hero {
    text-align: center;
    margin-bottom: 32px;
}

.city-header {
    margin-bottom: 24px;
}

#city-name {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}

.condition-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
}

.temp-section {
    margin-bottom: 32px;
}

.temp-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

#weather-icon {
    font-size: 4.5rem;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
}

.temp-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

#temperature {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
}

.unit-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.unit-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 14px 10px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.1);
}

.stat-card i {
    font-size: 1.5rem;
    color: #a5b4fc;
    margin-bottom: 8px;
    display: block;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
}

.uv-badge {
    font-size: 0.7rem;
    margin-left: 5px;
}

/* Tips Section */
.tips-section {
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.15), rgba(100, 150, 255, 0.05));
    border-radius: 32px;
    padding: 20px;
    margin-bottom: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title {
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: #a5b4fc;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.tip-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.tip-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.tip-icon {
    width: 40px;
    height: 40px;
    background: rgba(165, 180, 252, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.tip-content {
    flex: 1;
}

.tip-question {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    display: block;
}

.tip-answer {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

/* Forecast Section */
.forecast-section {
    margin-top: 8px;
}

.forecast-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 4px 12px 4px;
    scrollbar-width: thin;
}

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

.forecast-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.forecast-scroll::-webkit-scrollbar-thumb {
    background: rgba(165, 180, 252, 0.5);
    border-radius: 10px;
}

.forecast-card {
    min-width: 110px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 28px;
    padding: 16px 12px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s;
}

.forecast-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.forecast-card .day {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.forecast-card i {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

.forecast-card .temp-range {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.forecast-card .condition {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Skeleton Loader Animation */
.skeleton-loader {
    display: none;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

.skeleton-city {
    height: 48px;
    width: 200px;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200% 100%;
    border-radius: 12px;
    margin: 20px auto;
    animation: shimmer 1.5s infinite;
}

.skeleton-temp {
    height: 80px;
    width: 150px;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200% 100%;
    border-radius: 20px;
    margin: 20px auto;
    animation: shimmer 1.5s infinite;
}

.skeleton-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 30px 0;
}

.skeleton-stat {
    height: 80px;
    background: linear-gradient(90deg, rgba(255,255,255,0.08) 25%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.08) 75%);
    background-size: 200% 100%;
    border-radius: 24px;
    animation: shimmer 1.5s infinite;
}

.skeleton-tips {
    height: 200px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 75%);
    background-size: 200% 100%;
    border-radius: 32px;
    margin: 20px 0;
    animation: shimmer 1.5s infinite;
}

.skeleton-forecast {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.skeleton-card {
    min-width: 110px;
    height: 140px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 75%);
    background-size: 200% 100%;
    border-radius: 28px;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Toast Messages */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    padding: 12px 24px;
    border-radius: 60px;
    font-size: 0.85rem;
    color: white;
    z-index: 2000;
    display: none;
    white-space: nowrap;
}

.toast.error {
    background: rgba(220, 60, 60, 0.9);
}

/* Responsive */
@media (max-width: 500px) {
    body {
        padding: 12px;
    }
    
    .weather-container {
        padding: 18px;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    #temperature {
        font-size: 3.5rem;
    }
    
    #weather-icon {
        font-size: 3rem;
    }
    
    .skeleton-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .skeleton-forecast {
        overflow-x: auto;
    }
}
