:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-main: #ffffff;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-light: #f1f5f9;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --gradient-hero: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

html,
body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

/* Premium Light Background Gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 0% 0%, rgba(79, 70, 229, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.05) 0%, transparent 40%);
    z-index: -1;
}

/* Navigation Styles */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 2000;
    border-bottom: 1px solid var(--border-light);
    height: 80px;
}

.nav-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #4f46e5, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    transition: var(--transition);
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition);
    opacity: 0.7;
}

.nav-links a:hover,
.nav-links a.active {
    opacity: 1;
    color: var(--primary-color);
}

#auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-link {
    color: #ef4444 !important;
    font-weight: 800 !important;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    z-index: 2100;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 2.5px;
    background: var(--text-main);
    border-radius: 10px;
    transition: var(--transition);
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

@media (max-width: 1024px) {
    .nav-links {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: center;
        padding: 4rem 2rem;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 2050;
        visibility: hidden;
        transition: right 0.4s ease, visibility 0.4s;
    }

    .nav-links.mobile-active {
        right: 0;
        visibility: visible;
    }

    .nav-links a {
        font-size: 1.25rem;
        width: 100%;
        text-align: center;
        padding: 1rem;
    }

    #auth-buttons {
        width: 100%;
        justify-content: center;
    }
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

@media (max-width: 768px) {
    nav {
        height: 70px;
    }

    .logo {
        font-size: 1.5rem;
    }
}

/* Premium Hero Section */
.hero-premium {
    padding: 6rem 5% 5rem;
    /* Reduced from 10rem to minimize header gap */
    text-align: center;
    position: relative;
    overflow: hidden;
    background: #ffffff;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    margin: 0 auto;
}

.badge-new {
    background: #f1f5f9;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: inline-block;
    margin-bottom: 2rem;
}

.hero-premium h1 {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 0.95;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-premium p {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 580px;
    margin: 0 auto 3.5rem;
    font-weight: 500;
}

.search-box-modern {
    background: white;
    border: 1px solid #f1f5f9;
    padding: 0.75rem 1rem 0.75rem 1.5rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 3rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.search-box-modern:focus-within {
    box-shadow: 0 20px 40px -15px rgba(99, 102, 241, 0.15);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.search-box-modern input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1.1rem;
    font-weight: 500;
}

.shortcut-tip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
}

.category-pills {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.category-pills button {
    background: white;
    border: 1px solid #f1f5f9;
    padding: 0.6rem 1.25rem;
    border-radius: 100px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.category-pills button.active,
.category-pills button:hover {
    background: var(--text-main);
    color: white;
    border-color: var(--text-main);
}

/* Search Container */
.search-container {
    max-width: 750px;
    margin: 0 auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    border-radius: 20px;
    background: white;
}

.search-input {
    width: 100%;
    padding: 1.5rem 2rem;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    color: var(--text-main);
    font-size: 1.15rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Wallpaper Grid Grid-based Responsiveness */
.wallpaper-grid {
    padding: 2rem 5%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .wallpaper-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Two columns on phone */
        padding: 1rem;
        gap: 1rem;
    }
}

.wallpaper-card {
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    height: fit-content;
}

/* Footer Responsiveness */
footer {
    padding: 4rem 5% 3rem;
    text-align: center;
    background: white;
    border-top: 1px solid var(--border-light);
}

@media (max-width: 600px) {
    footer {
        padding: 3rem 1rem 2rem;
    }
}

.wallpaper-card img {
    width: 100%;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.wallpaper-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.wallpaper-card:hover img {
    transform: scale(1.08);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 2rem 1.5rem 1.5rem;
    opacity: 0;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.wallpaper-card:hover .card-overlay {
    opacity: 1;
}

.card-overlay h3 {
    color: white;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.card-overlay span.res-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Filter Chips */
.filter-chip {
    background: white;
    border: 1px solid var(--border-light);
    padding: 0.6rem 1.25rem;
    border-radius: 100px;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.filter-chip:hover,
.filter-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
}

/* End of Styles */

footer {
    padding: 6rem 5% 4rem;
    text-align: center;
    background: white;
    border-top: 1px solid var(--border-light);
}