* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #f8f9fc;
    --bg-secondary: #ffffff;
    --text-primary: #1a1d2d;
    --text-secondary: #5a5f70;
    --accent: #4361ee;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--transition);
}

.container {
    max-width: 870px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.8rem;
    color: var(--accent);
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-primary);
    cursor: pointer;
}


.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    align-items: center;
}

#city-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

#city-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

#search-btn {
    padding: 0.8rem 1.2rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

#search-btn:hover {
    background: #3a56d4;
}

.weather-info {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    display: none;
}

.weather-info.active {
    display: block;
}

.weather-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.weather-info p {
    margin: 0.4rem 0;
    color: var(--text-secondary);
    font-size: 1rem;
}

.weather-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.recent-searches {
    margin-top: 2rem;
    text-align: center;
}

.recent-searches h3 {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.recent-city {
    display: inline-block;
    background: rgba(67, 97, 238, 0.1);
    color: var(--accent);
    padding: 0.4rem 0.8rem;
    margin: 0 0.3rem 0.5rem 0;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.recent-city:hover {
    background: var(--accent);
    color: white;
}

.dark-mode {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --border: #333;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.location-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    margin: 1rem auto;
    transition: all 0.3s ease;
    justify-content: center;
}

.location-btn:hover {
    background: #3a56d4;
    transform: translateY(-2px);
}

.location-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}


.forecast-container {
    margin-top: 2rem;
    padding: 0;
    position: relative;
    display: none;
}

.forecast-container::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.forecast-container.active {
    display: block;
}

.forecast-container h3 {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.forecast-cards {
    display: flex;
    gap: 1rem;
    overflow-x: hidden;
    padding: 0.5rem 0;
    flex-wrap: nowrap;
    -ms-overflow-style: none;
    scrollbar-width: none;
}


.forecast-cards::-webkit-scrollbar {
    display: none;
}

.forecast-card {
    flex: 1;
    min-width: 140px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    font-size: 0.95rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.forecast-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.forecast-icon {
    font-size: 1.8rem;
    margin: 0.3rem 0;
}

.forecast-temp {
    font-weight: 600;
    color: var(--accent);
}

.forecast-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}


@media (max-width: 600px) {
    .search-box {
        flex-wrap: nowrap;
    }

    #search-btn {
        width: 45px;
        height: 45px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
    }

    #city-input {
        flex: 1;
        padding: 0.7rem 1rem;
        font-size: 1rem;
        min-width: 180px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .forecast-cards {
        overflow-x: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
        gap: 0.8rem;
        min-width: 120px;
    }

    .forecast-cards::-webkit-scrollbar {
        display: none;
    }
}