:root {
    --primary-color: #007BFF;
    --text-color: #333;
    --background-color: #f0f8ff;
    --card-background: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body.dark-theme {
    --primary-color: #64B5F6;
    --text-color: #f4f4f4;
    --background-color: #121212;
    --card-background: #1e1e1e;
    --shadow-color: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
    transition: all 0.3s ease;
}

body {
    margin: 0;
    padding: 20px;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: auto;
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 20px var(--shadow-color);
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar {
    display: flex;
    gap: 10px;
}

#city-input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 16px;
    flex-grow: 1;
    background-color: var(--card-background);
    color: var(--text-color);
}

#search-button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
}

.weather-display, .loading-message {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
}
.weather-display.visible, .loading-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.weather-card {
    background: var(--card-background);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 15px var(--shadow-color);
    text-align: center;
    margin-bottom: 20px;
}

.current-info {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5em;
    gap: 20px;
    color: var(--primary-color);
}
.current-info #current-temperature {
    font-size: 1em;
    font-weight: bold;
}
.weather-description {
    font-size: 1.5em;
    color: var(--text-color);
    margin-top: 10px;
}

.details {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-top: 30px;
    background-color: var(--background-color);
    border-radius: 15px;
    padding: 15px;
}
.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    font-size: 1em;
    color: var(--text-color);
}
.detail-item span {
    font-weight: bold;
    margin-top: 5px;
    font-size: 1.2em;
}

.forecast-tabs {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 10px;
}
.tab-button {
    padding: 12px 25px;
    border: none;
    background: var(--card-background);
    color: var(--text-color);
    cursor: pointer;
    border-radius: 20px;
    font-size: 1em;
    font-weight: bold;
}
.tab-button.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.forecast-list {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background: var(--card-background);
    border-radius: 20px;
    box-shadow: 0 4px 10px var(--shadow-color);
}
.forecast-item {
    min-width: 120px;
    text-align: center;
    padding: 15px;
    background: var(--background-color);
    border-radius: 10px;
    box-shadow: 0 2px 5px var(--shadow-color);
    color: var(--text-color);
}
.forecast-item p {
    margin: 5px 0;
}
.forecast-item p:first-child {
    font-weight: bold;
}
.hidden {
    display: none;
}
.error-message {
    text-align: center;
    color: #d9534f;
    margin-top: 20px;
    font-size: 1.2em;
    display: none;
}
.loading-message {
    text-align: center;
    font-size: 1.5em;
    color: var(--primary-color);
    margin-top: 40px;
    font-weight: bold;
}
.daily-forecast-item {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 15px;
    background: var(--background-color);
    border-radius: 10px;
    box-shadow: 0 2px 5px var(--shadow-color);
    color: var(--text-color);
}
.daily-forecast-item p {
    margin: 5px 0;
}
.daily-forecast-item p:first-child {
    font-weight: bold;
}
.daily-temps {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--primary-color);
}
.min-temp {
    color: var(--text-color);
    font-weight: normal;
    font-size: 0.9em;
}

.current-info .current-icon-emoji {
    font-size: 128px;
    margin: 0;
    padding: 0;
}

.last-update {
    font-size: 0.9em;
    color: var(--text-color);
    margin-top: 5px;
    opacity: 0.7;
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
    }
    .search-bar {
        width: 100%;
    }
    #city-input {
        width: 100%;
    }
    .details {
        flex-direction: column;
    }
    .forecast-list {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    .daily-forecast-item {
        min-width: 120px;
        flex: none;
    }
}