[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #eeeeee;
    --card-bg: #1e1e1e;
    --button-bg: #00bcd4;
    --button-text: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", sans-serif;
}

body {
    position: relative;
    overflow: hidden;
    color: #222222;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}


body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #8858cd 2%, #fd8afd, #6935b2);
    z-index: -1;
    transition: opacity 0.5s ease;
    opacity: 1;
}


body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #3b004b, #280558, #5c3790);
    z-index: -1;
    transition: opacity 0.5s ease;
    opacity: 0;
}


body.dark::before {
    opacity: 0;
}

body.dark::after {
    opacity: 1;
}

body.dark {
    color: #eeeeee;
}



.container {
    max-width: 500px;
    width: 100%;
    padding: 1.5rem;
    border-radius: 10px;
    background-color: #f0f0f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: background-color 0.5s ease;
    transition: color 1s ease;
}

.container.dark {
    background-color: #1b1b1b;
    box-shadow: 0 4px 20px rgba(223, 223, 223, 0.1);
    transition: background-color 0.5s ease;
    transition: color 1s ease;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

#themeToggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #222222;
}

.weather-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.search-box input {
    flex: 1 1 60%;
    min-width: 0;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.search-box button {
    flex: 1 1 35%;
    min-width: 80px;
    padding: 0.5rem 1rem;
    background-color: #b300ff;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    opacity: 0.9;
}

.weatherinfo {
    text-align: center;
}

.weatherinfo h2 {
    margin-bottom: 0.5rem;
}

.temp {
    font-size: 2rem;
    font-weight: bold;
}

.description {
    font-style: italic;
    margin: 0.5rem 0;
}

.humidity {
    font-size: 0.9rem;
    color: gray;
}


.error {
    display: none;
    color: red;
    padding: 10px 0px 0px 0px;
    font-family: monospace;
    font-size: 15px;
}

.image {
    width: 100px;
    height: 100px;
}

footer {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
}

footer span {
    color: #8600c0;
}

@media (max-width: 400px) {
    .search-box {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-box input,
    .search-box button {
        flex: 1 1 100%;
    }
}
