/* ===================================
   CSS Variables
   =================================== */
:root {
    /* Primary Colors - Original Indigo/Purple Theme */
    --primary-indigo: #6366f1;
    --primary-purple: #8b5cf6;
    --primary-indigo-light: #818cf8;
    --primary-purple-light: #a78bfa;

    /* For compatibility with new design */
    --primary-pink: #8b5cf6;
    --primary-pink-light: #a78bfa;
    --primary-teal: #6366f1;
    --primary-teal-light: #818cf8;

    /* Darker shades */
    --primary-purple-dark: #7c3aed;
    --primary-pink-dark: #7c3aed;
    --primary-teal-dark: #4c1d95;

    /* Dark Purple Shades */
    --purple-dark: #4c1d95;
    --purple-mid: #7c3aed;
    --purple-mid-alt: #6d28d9;

    /* Background Colors - Dark */
    --bg-dark-1: #0f0f1e;
    --bg-dark-2: #1a1a2e;
    --bg-dark-3: #16213e;

    /* Text Colors - Light for dark background */
    --text-primary: #e4e4e7;
    --text-secondary: #d4d4d8;
    --text-tertiary: #a1a1aa;
    --text-highlight: #e9d5ff;

    /* Utility Colors */
    --success-green: #86efac;
    --white: #ffffff;
    --black: #000000;

    /* Light Grays (for book pages, etc.) */
    --gray-light-1: #f9fafb;
    --gray-light-2: #f3f4f6;
    --gray-light-3: #e5e7eb;
}

/* ===================================
   Global Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter Tight', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark-1) 0%, var(--bg-dark-2) 50%, var(--bg-dark-3) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ===================================
   Animated Background Elements
   =================================== */
body::before {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary-pink) 30%, transparent) 0%, transparent 70%);
    border-radius: 50%;
    top: -300px;
    right: -300px;
    animation: float 20s ease-in-out infinite;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary-teal) 30%, transparent) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -250px;
    left: -250px;
    animation: float 15s ease-in-out infinite reverse;
    z-index: 0;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-50px) scale(1.1);
    }
}

/* ===================================
   Navigation Bar - Avant-garde Edition
   =================================== */
nav {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 4rem);
    max-width: 1400px;
    z-index: 1000;
    background: rgba(15, 15, 30, 0.7);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid color-mix(in srgb, var(--primary-indigo) 30%, transparent);
    border-radius: 20px;
    padding: 1rem 2rem;
    animation: slideDown 0.8s ease-out;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 20px 60px color-mix(in srgb, var(--primary-indigo) 15%, transparent);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav:hover {
    background: rgba(15, 15, 30, 0.85);
    border-color: color-mix(in srgb, var(--primary-indigo) 50%, transparent);
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 24px 80px color-mix(in srgb, var(--primary-indigo) 25%, transparent);
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-logo:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.nav-logo img {
    height: 42px;
    width: auto;
    filter: drop-shadow(0 4px 12px color-mix(in srgb, var(--primary-indigo) 40%, transparent));
    transition: all 0.3s ease;
}

.nav-logo:hover img {
    filter: drop-shadow(0 6px 20px color-mix(in srgb, var(--primary-indigo) 60%, transparent));
    transform: scale(1.05);
}

.nav-logo span {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-indigo-light) 0%, var(--primary-purple-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
}

.nav-links a:not(.login-btn):not(.signup-btn):hover {
    color: var(--primary-indigo-light);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.nav-links a:not(.login-btn):not(.signup-btn)::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-indigo), var(--primary-purple));
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-links a:not(.login-btn):not(.signup-btn):hover::before {
    width: 70%;
}

/* ===================================
   Navigation Buttons - Enhanced
   =================================== */
.signup-btn {
    background: linear-gradient(135deg, var(--primary-indigo) 0%, var(--primary-purple) 100%);
    color: var(--white);
    padding: 0.75rem 1.75rem;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 20px color-mix(in srgb, var(--primary-purple) 40%, transparent),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    overflow: hidden;
}

.signup-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.signup-btn:hover::before {
    left: 100%;
}

.signup-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 8px 35px color-mix(in srgb, var(--primary-purple) 60%, transparent),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.login-btn {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    padding: 0.75rem 1.75rem;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid color-mix(in srgb, var(--primary-indigo) 40%, transparent);
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-indigo);
    color: var(--primary-indigo-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px color-mix(in srgb, var(--primary-indigo) 30%, transparent);
}

/* ===================================
   Mobile Menu Toggle
   =================================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-indigo), var(--primary-purple));
    border-radius: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--primary-indigo) 40%, transparent);
}

/* ===================================
   Footer
   =================================== */
footer {
    position: relative;
    z-index: 1;
    background: color-mix(in srgb, var(--bg-dark-1) 80%, transparent);
    backdrop-filter: blur(20px);
    border-top: 1px solid color-mix(in srgb, var(--primary-purple) 20%, transparent);
    padding: 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-purple-light);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary-purple) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary-purple) 30%, transparent);
}

.social-links a:hover {
    background: color-mix(in srgb, var(--primary-pink) 20%, transparent);
    border-color: var(--primary-pink);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-pink) 40%, transparent);
}

.social-links svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.copyright {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1024px) {
    nav {
        width: calc(100% - 2rem);
        top: 1rem;
    }

    .nav-links {
        gap: 0.25rem;
    }

    .nav-links a {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    nav {
        padding: 0.75rem 1.5rem;
        top: 1rem;
        width: calc(100% - 2rem);
        border-radius: 16px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 5.5rem;
        left: 1rem;
        right: 1rem;
        background: rgba(15, 15, 30, 0.95);
        backdrop-filter: blur(30px) saturate(180%);
        flex-direction: column;
        padding: 2rem;
        gap: 0.5rem;
        border: 1px solid color-mix(in srgb, var(--primary-indigo) 30%, transparent);
        border-radius: 16px;
        transform: translateY(-20px);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow:
            0 12px 48px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }

    .nav-links a::before {
        display: none;
    }

    footer {
        padding: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-links {
        gap: 1rem;
        justify-content: center;
    }

    .copyright {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-logo span {
        font-size: 1.25rem;
    }

    .nav-logo img {
        height: 32px;
    }

    .login-btn,
    .signup-btn {
        padding: 0.5rem 1.25rem;
        font-size: 0.875rem;
    }
}
