:root {
    /* Light theme variables */
    --bg-primary: rgba(255, 255, 255, 0.9);
    --bg-secondary: rgba(248, 249, 250, 0.8);
    --text-primary: #333;
    --text-secondary: #666;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --overlay-color: rgba(13, 41, 55, 0.5);
    --input-bg: rgba(255, 255, 255, 0.9);
    --error-bg: rgba(248, 215, 218, 0.9);
    --error-text: #dc3545;
}

[data-theme="dark"] {
    /* Dark theme variables */
    --bg-primary: rgba(33, 37, 41, 0.9);
    --bg-secondary: rgba(52, 58, 64, 0.8);
    --text-primary: #fff;
    --text-secondary: #ced4da;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --overlay-color: rgba(0, 0, 0, 0.7);
    --input-bg: rgba(33, 37, 41, 0.9);
    --error-bg: rgba(220, 53, 69, 0.2);
    --error-text: #ff6b6b;
}

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

body {
    font-family: Arial, sans-serif;
    background-image: url('./images/weather-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    transition: all 0.3s ease;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay-color);
    z-index: 1;
    transition: background-color 0.3s ease;
}

.container {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 30px;
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

input {
    padding: 12px;
    border: 1px solid var(--text-secondary);
    border-radius: 5px;
    flex-grow: 1;
    font-size: 16px;
    background-color: var(--input-bg);
    color: var(--text-primary);
}

button {
    padding: 12px 24px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #0056b3;
}

.weather-card {
    background-color: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    margin-top: 20px;
}

.weather-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.weather-item {
    text-align: center;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.weather-item:hover {
    transform: translateY(-5px);
}

.weather-item h3 {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.weather-item p {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
}

.error {
    color: var(--error-text);
    background-color: var(--error-bg);
    padding: 10px;
    border-radius: 5px;
    display: none;
    margin-top: 10px;
    text-align: center;
}

/* Theme Switcher Styles */
.theme-switch-wrapper {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.theme-switch-wrapper span {
    color: var(--text-primary);
    font-size: 14px;
}

@media (max-width: 600px) {
    .search-container {
        flex-direction: column;
    }
    
    .weather-info {
        grid-template-columns: 1fr;
    }
}