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

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(to right, #4facfe, #00f2fe);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background 0.5s ease;
}

.app-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.2rem;
    color: white;
    letter-spacing: 1px;
}

.container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 450px;

    border: 1px solid rgba(255,255,255,0.3);

    box-shadow: 0 10px 30px rgba(0,0,0,0.2);

}

.container.dark {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(12px);
    color: white;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-box {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

input {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

button {
    padding: 10px 15px;
    border-radius: 8px;
    border: none;
    background: #4facfe;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    background: #007bff;
}

.location-btn {
    width: 100%;
    margin-bottom: 10px;
    background: #28a745;
}

.weather-box {
    margin-top: 25px;
    animation: fadeIn 0.5s ease-in-out;
}

.weather-box img {
    width: 80px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(0,0,0,0.05);
    filter: drop-shadow(0px 3px 5px rgba(0,0,0,0.3));
}

.container.dark .weather-box img {
    background: rgba(255,255,255,0.1);
}

.forecast {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap; 
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;       
    padding-bottom: 5px;
}

.forecast-card {
    flex: 1 1 60px;
    max-width: 60px;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(6px);

    padding: 10px;
    border-radius: 12px;

    display: flex;
    flex-direction: column;
    align-items: center;

    font-size: 14px;

    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s ease forwards;
}

.day {
    font-weight: bold;
}

.temp {
    font-size: 15px;
}

.forecast-card img {
    width: 40px;
    margin: 5px 0;
    border-radius: 10px;
    background: rgba(0,0,0,0.05);
    filter: drop-shadow(0px 3px 5px rgba(0,0,0,0.3));
}

.container.dark .forecast-card {
    background: rgba(255,255,255,0.1);
}

body.dark .forecast-card {
    background: rgba(255,255,255,0.1);
}

.recent {
    margin-bottom: 10px;
}

.recent button {
    background: gray;
    margin: 3px;
    font-size: 12px;
}

.error {
    background: #ffdddd;
    padding: 10px;
    border-radius: 8px;
    color: red;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 400px) {
    .container {
        width: 90%;
    }
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4facfe;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}