:root {
    --primary-color: #4facfe;
    --secondary-color: #00f2fe;
    --accent-color: #ff9a9e;
    --bg-gradient: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --text-color: #ffffff;
    --text-muted: #9ca3af;
    --danger-color: #ef4444;
    --font-main: 'Outfit', sans-serif;
    --nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: url('https://images.unsplash.com/photo-1534088568595-a066f410bcda?q=80&w=2551&auto=format&fit=crop') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Overlay for better text readability */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
}

/* Navigation */
.navbar {
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-item {
    cursor: pointer;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-color);
}

/* Main Content */
main {
    padding-top: calc(var(--nav-height) + 2rem);
    padding-bottom: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glassmorphism Cards */
.content-card,
.auth-card,
.weather-hero {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    margin-bottom: 2rem;
}

.content-card h2,
.auth-card h2 {
    text-align: center;
    margin-bottom: 2rem;
}

/* Home / Weather Section */
.search-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-container input {
    flex: 1;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
}

.search-container button {
    padding: 0 1.5rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s;
}

.search-container button:hover {
    transform: scale(1.05);
}

.current-weather {
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.weather-temp {
    font-size: 5rem;
    font-weight: 700;
    background: linear-gradient(to bottom, #fff, #ccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.weather-icon img {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    width: 100%;
    margin-top: 2rem;
}

.detail-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
}

.detail-box i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

/* Forecast */
.forecast-section h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.forecast-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.forecast-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s;
}

.forecast-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    font-family: var(--font-main);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Profile */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #1f2937;
    padding: 2rem;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-icon {
    color: #10b981;
}

.error-icon {
    color: var(--danger-color);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

.btn-secondary {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
}

.btn-danger {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    background: var(--danger-color);
    color: white;
    cursor: pointer;
}

/* Auth Switch */
.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.auth-switch a:hover {
    color: var(--secondary-color);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: var(--nav-height);
        flex-direction: column;
        background: rgba(17, 24, 39, 0.95);
        width: 100%;
        height: calc(100vh - var(--nav-height));
        text-align: center;
        transition: 0.3s;
        padding-top: 2rem;
        backdrop-filter: blur(10px);
    }

    .nav-links.active {
        left: 0;
    }

    .weather-main {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Mobile Optimization */
@media (max-width: 480px) {
    main {
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }

    .weather-hero,
    .content-card,
    .auth-card {
        padding: 1.25rem;
    }

    .search-container {
        gap: 0.5rem;
    }

    .search-container input {
        min-width: 0;
        font-size: 16px;
        /* Prevent auto-zoom on iOS */
    }

    .search-container button {
        padding: 0 1rem;
    }

    .weather-temp {
        font-size: 3.5rem;
    }

    .weather-icon img {
        width: 100px;
        height: 100px;
    }

    .forecast-section h3 {
        font-size: 1.25rem;
    }
}