/* Navbar - Floating Pill Design */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1100px;
    z-index: 1100;
    padding: 10px 30px;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    background: rgba(15, 23, 42, 0.92);
    padding: 10px 30px;
    top: 10px;
    width: 95%;
    max-width: 1200px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.4em;
    letter-spacing: 0.5px;
    color: var(--text-main);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Reduced gap, controlled by padding */
}

/* Mobile Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1050;
    padding: 0;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 2.5px;
    background-color: var(--text-main);
    border-radius: 4px;
    transition: all 0.3s ease;
    display: block;
}

/* Toggle Animation */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.mobile-menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 4px;
    transition: all 0.3s ease;
    display: block;
}

/* Toggle Animation */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Navigation Links */
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
    padding: 8px 16px;
    border-radius: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

/* Specific Buttons */
.nav-btn-login {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 8px 24px;
    transition: all 0.3s ease;
    margin-left: 10px;
    font-weight: 600;
}

.nav-btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-main);
    color: var(--text-main);
}

.nav-btn-cta {
    background: var(--primary-color, #2563EB);
    /* Fallback to blue */
    color: white;
    border: none;
    border-radius: 30px;
    padding: 10px 28px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
    margin-left: 10px;
}

.nav-btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .navbar {
        width: 95%;
        top: 10px;
        padding: 12px 20px;
        border-radius: 20px;
    }

    .logo-text {
        font-size: 1.1em;
    }

    .mobile-menu-toggle {
        display: flex;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 80px 30px 30px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        gap: 0;
        overflow-y: auto;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-link {
        font-size: 1.2em;
        padding: 15px 0;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
        cursor: pointer;
    }

    .nav-link:hover,
    .nav-link.active {
        background: transparent;
        color: var(--primary-color, #2563EB);
        padding-left: 10px;
    }

    #nav-auth-user,
    #nav-auth-guest {
        flex-direction: column;
        width: 100%;
        align-items: stretch !important;
        margin-top: 20px;
        gap: 15px;
    }

    .user-menu {
        margin-left: 0 !important;
    }

    .nav-btn-login,
    .nav-btn-cta {
        padding: 12px 16px;
        font-size: 1em;
        text-align: center;
        margin-left: 0;
        width: 100%;
        border-radius: 8px;
    }
}

/* Main Layout */
.app-view {
    padding-top: 120px;
    /* Increased for floating navbar */
    min-height: 100vh;
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.app-view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* AUTH OVERLAY (Fixed Layout) */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    /* Slightly darker for better contrast */
    z-index: 5000;
    justify-content: center;
    align-items: center;
    display: none;
    /* Hidden by default */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.welcome-overlay.active {
    display: flex;
    /* Shown when active */
}

/* Ensure inner container is centered and visible */
.login-container {
    display: flex;
    width: 900px;
    max-width: 95%;
    height: 600px;
    background: var(--glass-bg-strong);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--depth-2);
    overflow: hidden;
    position: relative;
    /* Ensure z-index context */
}

/* Ensure text inside is visible */
.login-sidebar {
    width: 40%;
    background: var(--gradient-secondary);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--glass-border);
    color: var(--text-main);
    z-index: 2;
}

.login-main {
    width: 60%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 2;
}

.feature-list {
    margin-top: 40px;
}

.f-item {
    margin-bottom: 15px;
    font-size: .95em;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.sidebar-footer {
    font-size: .75em;
    color: var(--text-muted);
}