/* Modern Weather Tracker - Clean & Contemporary Design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #0f172a;
    --text-gray: #64748b;
    --text-light: #cbd5e1;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeIn 0.6s ease;
}

.header-content h1 {
    color: var(--text-dark);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header-content h1 .wi {
    font-size: 3rem;
    color: var(--primary);
}

.subtitle {
    color: var(--text-gray);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Search Section */
.search-section {
    background: var(--bg-white);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 32px;
    animation: slideUp 0.6s ease;
    border: 1px solid var(--border);
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: stretch;
}

.search-box i.fa-search {
    color: var(--text-gray);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.search-box input {
    flex: 1;
    padding: 14px 20px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
    color: var(--text-dark);
    font-weight: 500;
}

.search-box input::placeholder {
    color: var(--text-gray);
}

.search-box input:focus {
    border-color: var(--primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box button {
    padding: 14px 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.search-box button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.search-box button:active {
    transform: translateY(0);
}

.location-btn {
    width: 100%;
    padding: 14px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.location-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Loading & Error */
.loading, .error-message {
    text-align: center;
    padding: 48px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.error-message {
    color: #ef4444;
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: #ef4444;
}

.hidden {
    display: none !important;
}

/* Weather Display */
.weather-display {
    animation: slideUp 0.6s ease;
}

.current-weather {
    background: var(--bg-white);
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    margin-bottom: 32px;
    position: relative;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.current-weather:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.location-info {
    margin-bottom: 32px;
}

.location-info h2 {
    font-size: 2rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-weight: 700;
}

.location-info h2 i {
    color: var(--primary);
}

.location-info p {
    color: var(--text-gray);
    font-size: 1rem;
    font-weight: 500;
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    margin-bottom: 48px;
    padding: 32px 0;
}

.weather-icon-container i {
    font-size: 10rem;
    color: var(--primary);
    display: block;
}

.temperature-section {
    text-align: center;
}

.temp-main {
    font-size: 5rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 12px;
}

.temp-unit {
    font-size: 2.5rem;
    color: var(--text-gray);
}

#weatherDescription {
    font-size: 1.5rem;
    color: var(--text-gray);
    text-transform: capitalize;
    font-weight: 500;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    background: var(--bg-light);
    border-radius: var(--radius);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.detail-item:hover {
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.detail-item i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.detail-label {
    color: var(--text-gray);
    font-size: 0.875rem;
    margin-bottom: 6px;
    font-weight: 500;
}

.detail-value {
    color: var(--text-dark);
    font-size: 1.25rem;
    font-weight: 700;
}

.cloud-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    background: var(--primary);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
}

/* Forecast Section */
.forecast-section {
    background: var(--bg-white);
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

.forecast-section h3 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.forecast-section h3 i {
    color: var(--primary);
}

.forecast-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.forecast-card {
    background: var(--bg-light);
    padding: 24px;
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border);
}

.forecast-card:hover {
    background: white;
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.forecast-date {
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.forecast-icon {
    font-size: 3rem;
    margin: 16px 0;
    color: var(--primary);
}

.forecast-temp {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 12px 0;
    color: var(--text-dark);
}

.forecast-desc {
    font-size: 0.875rem;
    color: var(--text-gray);
    text-transform: capitalize;
    font-weight: 500;
}

/* Footer */
.footer {
    text-align: center;
    padding: 32px;
    color: var(--text-gray);
    margin-top: 48px;
}

.footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .header-content h1 {
        font-size: 2rem;
    }

    .header-content h1 .wi {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 0.875rem;
    }

    .search-section {
        padding: 24px;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box button {
        width: 100%;
        justify-content: center;
    }

    .current-weather {
        padding: 32px 20px;
    }

    .weather-main {
        flex-direction: column;
        gap: 32px;
        padding: 24px 0;
    }

    .weather-icon-container i {
        font-size: 7rem;
    }

    .temp-main {
        font-size: 4rem;
    }

    .temp-unit {
        font-size: 2rem;
    }

    #weatherDescription {
        font-size: 1.25rem;
    }

    .weather-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .detail-item {
        padding: 20px 16px;
    }

    .forecast-section {
        padding: 32px 20px;
    }

    .forecast-section h3 {
        font-size: 1.5rem;
    }

    .forecast-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .forecast-card {
        padding: 20px 16px;
    }

    .cloud-badge {
        position: static;
        margin-top: 24px;
        justify-content: center;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }

    .location-info h2 {
        font-size: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.75rem;
        flex-direction: column;
        gap: 8px;
    }

    .weather-icon-container i {
        font-size: 6rem;
    }

    .temp-main {
        font-size: 3.5rem;
    }
}
