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

/* ===== Root color (dịu – weather UI) ===== */
:root {
    --bg-page: #EEF4FA;
    --bg-card: #FFFFFF;
    --primary: #4A90E2;
    --primary-soft:#EAF3FF;
    --text-main: #2C3E50;
    --text-sub: #6B7C93;
    --border-soft: #E2E8F0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
}

/* ===== Header ===== */
header {
    background: var(--bg-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

/* ===== Search ===== */
.search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    background: var(--primary-soft);
    color: var(--text-main);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

.search-btn:hover {
    background: #3B7FD6;
}

/* ===== Layout ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Main Weather ===== */
.main-weather {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.main-weather-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.city-name-large {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--text-main);
}

.main-temp-section {
    display: flex;
    align-items: center;
    gap: 30px;
}

.temp-info {
    display: flex;
    flex-direction: column;
}

.current-temp {
    font-size: 5em;
    font-weight: bold;
    color: var(--primary);
    line-height: 1;
}

.weather-desc {
    font-size: 1.5em;
    color: var(--text-sub);
    margin-top: 10px;
}

.feels-like {
    font-size: 1.1em;
    color: var(--text-sub);
    margin-top: 10px;
}

.temp-range {
    font-size: 1.3em;
    color: var(--text-main);
    margin-top: 5px;
}

/* ===== Detail grid ===== */
.weather-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.detail-box {
    background: var(--primary-soft);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.detail-label {
    font-size: 0.9em;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.detail-value {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--text-main);
}
/* ===== Forecast ===== */
.forecast-section {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.forecast-title {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 20px;
}

.forecast-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
  
}

.forecast-card {
    background: var(--primary-soft);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.forecast-date {
    font-weight: bold;
    margin-bottom: 10px;
}


.forecast-temp {
    font-size: 1.3em;
    font-weight: bold;
    margin: 10px 0;
    color: var(--primary);
}

.forecast-humidity {
    font-size: 0.9em;
    color: var(--text-sub);
}

/* ===== Featured cities ===== */
.featured-cities {
    margin-bottom: 30px;
}

.section-title {
    background: var(--bg-card);
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.8em;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.city-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border-soft);
}

.city-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.city-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.city-card-name {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--text-main);
}

.city-card-temp {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary);
    margin: 10px 0;
}

.city-card-desc {
    color: var(--text-sub);
    margin-bottom: 10px;
}

.city-card-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: var(--text-sub);
}

/* ===== All cities ===== */
.all-cities-section {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.cities-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.city-link {
    padding: 12px 20px;
    background: var(--primary-soft);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s;
    text-align: center;
    font-weight: 500;
}

.city-link:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* ===== Loading ===== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-sub);
    font-size: 1.2em;
}

/* ===== Footer ===== */
footer {
    background: #DCE7F3;
    color: var(--text-sub);
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }

    .search-box {
        max-width: 100%;
    }

    .main-weather {
        padding: 20px;
    }

    .main-temp-section {
        flex-direction: column;
        text-align: center;
    }

    .current-temp {
        font-size: 3.5em;
    }

    .city-name-large {
        font-size: 1.8em;
    }
}
