:root {
    --primary-color: #4a90e2;
    --secondary-color: #f8f9fa;
    --accent-color: #ff6b6b;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --border-radius: 15px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --background-color: #2c2c2611;
    --card-background: rgba(255, 255, 255, 0.95);
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    --input-border: #e9ecef;
    --input-focus-border: #4a90e2;
}

[data-theme="dark"] {
    --primary-color: #5aa3f0;
    --secondary-color: #1a1a1a;
    --accent-color: #ff7979;
    --text-dark: #ffffff;
    --text-light: #b0b0b0;
    --background-color: #0f0f0f;
    --card-background: rgba(30, 30, 30, 0.95);
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    --input-border: #404040;
    --input-focus-border: #5aa3f0;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body {
    background: var(--background-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    color: var(--text-dark);
    transition: var(--transition);
}

.weather-card {
    background: var(--card-background);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin: 1rem;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

.weather-title {
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.search-container {
    position: relative;
}

.search-input {
    border: 2px solid var(--input-border);
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: var(--card-background);
    color: var(--text-dark);
}

.search-input:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
    outline: none;
    background: var(--card-background);
    color: var(--text-dark);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-btn {
    border-radius: 50px;
    padding: 12px 20px;
    background: var(--primary-color);
    border: none;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(74, 144, 226, 0.3);
}

.search-btn:hover {
    background: #3a7bd5;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.current-weather {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    color: white;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.current-weather::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-20px, -20px) rotate(180deg); }
}

.location-name {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.temperature-display {
    display: flex;
    align-items: baseline;
    margin-bottom: 1rem;
}

.temperature {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.temperature-unit {
    font-size: 2rem;
    font-weight: 300;
    margin-left: 0.5rem;
}

.condition-text {
    font-size: 1.2rem;
    font-weight: 500;
    text-transform: capitalize;
}

.feels-like {
    font-size: 1rem;
    opacity: 0.9;
}

.weather-icon {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

.weather-details {
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.detail-icon {
    background: linear-gradient(135deg, var(--primary-color), #3a7bd5);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.detail-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    word-wrap: break-word;
}

#refreshBtn {
    border-radius: 50px;
    padding: 10px 25px;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    transition: var(--transition);
}

#refreshBtn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .theme-toggle {
        top: 15px;
        right: 15px;
        padding: 8px 12px;
    }
    
    .theme-toggle i {
        font-size: 1rem;
    }
    
    .weather-card {
        margin: 0.5rem;
        padding: 1.5rem;
    }
    
    .current-weather {
        padding: 1.5rem;
    }
    
    .temperature {
        font-size: 3rem;
    }
    
    .temperature-unit {
        font-size: 1.5rem;
    }
    
    .weather-icon {
        width: 80px;
        height: 80px;
        margin-top: 1rem;
    }
    
    .location-name {
        font-size: 1.5rem;
    }
    
    .detail-card {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .search-container .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-btn {
        width: 100%;
    }
    
    .temperature-display {
        justify-content: center;
        text-align: center;
    }
    
    .weather-details .row {
        gap: 0.5rem;
    }
    
    .detail-card {
        padding: 0.75rem;
    }
    
    .detail-icon {
        width: 35px;
        height: 35px;
        margin-right: 0.75rem;
    }
}

/* Dark Mode Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-background);
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    padding: 10px 15px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    z-index: 1000;
    color: var(--text-dark);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
    background: var(--primary-color);
    color: white;
}

.theme-toggle i {
    font-size: 1.2rem;
    transition: var(--transition);
}

/* Theme transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Dark mode alert styles */
[data-theme="dark"] .alert-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
}

/* Dark mode text adjustments */
[data-theme="dark"] .text-muted {
    color: var(--text-light) !important;
}

[data-theme="dark"] .spinner-border {
    color: var(--primary-color) !important;
}

/* Loading Animation */
.loading-pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Error State */
.alert-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
}

/* Success Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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