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

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --bg-color: #eff6ff;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    opacity: 0.9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.search-section {
    margin-bottom: 2rem;
}

.search-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.search-form {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.popular-cities {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.city-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.city-btn:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.current-weather {
    margin-bottom: 2rem;
}

.current-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    color: white;
}

.current-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.location h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.location p {
    opacity: 0.9;
}

.weather-icon-large img {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.current-temp {
    font-size: 5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
}

.current-desc {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.current-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-icon {
    font-size: 1.5rem;
}

.detail-content {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

.detail-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.forecast-section {
    margin-bottom: 2rem;
}

.forecast-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.forecast-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.forecast-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s;
}

.forecast-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.forecast-date {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.forecast-icon img {
    width: 60px;
    height: 60px;
    margin-bottom: 0.5rem;
}

.forecast-temp {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.forecast-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.favorites-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.favorites-header h3 {
    font-size: 1.25rem;
}

.btn-add {
    padding: 0.5rem 1rem;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add:hover {
    background: #059669;
    transform: scale(1.05);
}

.favorites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.favorite-item {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    cursor: pointer;
}

.favorite-item:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateX(4px);
}

.favorite-info h4 {
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.favorite-temp {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.btn-remove {
    padding: 0.25rem 0.75rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.btn-remove:hover {
    background: #dc2626;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .search-form {
        grid-template-columns: 1fr;
    }

    .current-temp {
        font-size: 4rem;
    }

    .current-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .forecast-list {
        grid-template-columns: 1fr;
    }

    .favorites-list {
        grid-template-columns: 1fr;
    }
}
