body {
    background: #051923;
    color: #E0E1DD;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    
    /* เพิ่ม Animation พื้นหลัง */
    transition: background 1s ease-in-out;
}

.app-container {
    background: #003554;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

h1 {
    color: #00A6FB;
}

#search-form {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

#city-input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid #006494;
    border-radius: 0.5rem;
    background: #051923;
    color: #E0E1DD;
    font-size: 1rem;
}

#search-form button {
    padding: 0.75rem 1rem;
    background-color: #00A6FB;
    color: #051923;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

#search-form button:hover {
    background-color: #0582CA;
}

.weather-info {
    margin-top: 1.5rem;
    min-height: 150px;
    
    /* เพิ่ม animation การ fade-in */
    animation: fadeIn 1s forwards;
    opacity: 0;
}

.weather-info .temp {
    font-size: 3rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.error {
    color: #ff4d4d;
    font-weight: bold;
}

/* New CSS for Weather Forecast */
.forecast-container {
    margin-top: 2rem;
    text-align: left;
    
    /* เพิ่ม animation การ fade-in */
    animation: fadeIn 1.5s forwards;
    opacity: 0;
    animation-delay: 0.5s; /* หน่วงเวลาให้แสดงหลังจากข้อมูลหลัก */
}

.forecast-cards {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.forecast-card {
    background: #006494;
    padding: 0.75rem;
    border-radius: 0.75rem;
    text-align: center;
    width: 18%; /* สำหรับ 5 วัน */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    box-sizing: border-box; 
}

.forecast-card h3 {
    margin: 0;
    font-size: 0.9rem;
}

.forecast-card .temp-range {
    font-size: 0.8rem;
    color: #b0e0e6;
}

/* Keyframes for animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Background colors based on weather */
.sunny-bg {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.cloudy-bg {
    background: linear-gradient(135deg, #B0C4DE, #708090);
}

.rainy-bg {
    background: linear-gradient(135deg, #4682B4, #2F4F4F);
}

.snowy-bg {
    background: linear-gradient(135deg, #B0E0E6, #ADD8E6);
}