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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: white;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.search-box {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

#city-input {
    flex: 1;
    min-width: 200px;
    padding: 0.8rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
}

#city-input:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 0.8rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

button:hover {
    transform: translateY(-2px);
    background: #5568d3;
}

#current-location-btn {
    background: #10b981;
}

#current-location-btn:hover {
    background: #059669;
}

.loading {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.error {
    background: #fee;
    color: #c00;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #c00;
    margin-bottom: 1rem;
}

.hidden {
    display: none !important;
}

.weather-info {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.current-weather {
    text-align: center;
}

.location h2 {
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.location p {
    color: #6b7280;
    font-size: 1rem;
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

#weather-icon {
    width: 120px;
    height: 120px;
}

.temperature h1 {
    font-size: 3.5rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

#feels-like {
    color: #6b7280;
    font-size: 1rem;
}

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

#description {
    font-size: 1.3rem;
    color: #4b5563;
    text-transform: capitalize;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e5e7eb;
}

.detail-item {
    text-align: center;
}

.detail-item .label {
    display: block;
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.detail-item .value {
    display: block;
    color: #1f2937;
    font-size: 1.3rem;
    font-weight: 600;
}

.forecast {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.forecast h3 {
    color: #1f2937;
    margin-bottom: 1rem;
}

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

.forecast-card {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
}

.forecast-card .day {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.forecast-card img {
    width: 60px;
    height: 60px;
    margin: 0.5rem 0;
}

.forecast-card .temp {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0.5rem 0;
}

.forecast-card .desc {
    font-size: 0.85rem;
    color: #6b7280;
    text-transform: capitalize;
}

.recent-searches {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.recent-searches h3 {
    color: #1f2937;
    margin-bottom: 1rem;
}

#recent-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.recent-item {
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.recent-item:hover {
    background: #e5e7eb;
}

@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }

    .weather-main {
        flex-direction: column;
        gap: 1rem;
    }

    .temperature h1 {
        font-size: 2.5rem;
    }

    .search-box {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}