/* ========================================
   UNIFIED FLOATING NAVBAR
   Shared across all story pages
   ======================================== */

.unified-navbar {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: navSlideDown 0.6s ease-out;
}

@keyframes navSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.unified-navbar:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Logo/Brand */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    padding: 0.3rem 0.8rem;
    border-radius: 25px;
}

.navbar-brand:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.navbar-brand i {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.navbar-brand-text {
    display: none;
}

/* Navigation Links */
.navbar-links {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
    justify-content: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
}

.nav-link i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link:hover i {
    transform: scale(1.15) rotate(5deg);
}

.nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Navbar Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.nav-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: scale(1.1);
}

.nav-action-btn.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .navbar-brand-text {
        display: none;
    }

    .nav-link span {
        display: none;
    }

    .nav-link {
        padding: 0.6rem;
    }
}

@media (max-width: 768px) {

    /* Compact top navbar */
    .unified-navbar {
        width: calc(100% - 2rem);
        top: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        padding: 0.6rem 1rem;
        border-radius: 50px;
    }

    .navbar-content {
        justify-content: space-between;
    }

    .navbar-brand {
        padding: 0.4rem 0.6rem;
    }

    .navbar-brand i {
        font-size: 1.4rem;
    }

    .navbar-brand-text {
        display: none;
    }

    /* Keep navbar actions visible on mobile */
    .navbar-actions {
        display: flex;
        gap: 0.5rem;
    }

    .nav-action-btn {
        display: flex;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active i {
        transform: rotate(90deg);
    }

    .mobile-menu-toggle i {
        transition: transform 0.3s ease;
    }

    /* Dropdown menu */
    .navbar-links {
        position: fixed;
        top: 4.5rem;
        left: 1rem;
        right: 1rem;
        width: calc(100% - 2rem);
        max-height: 0;
        transform: translateY(-20px);
        flex-direction: column;
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(30px) saturate(150%);
        -webkit-backdrop-filter: blur(30px) saturate(150%);
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 25px;
        padding: 0 1rem;
        gap: 0;
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow:
            0 20px 60px rgba(0, 0, 0, 0.4),
            inset 0 1px 1px rgba(255, 255, 255, 0.15);
        overflow: hidden;
        z-index: 9998;
    }

    .navbar-links.active {
        max-height: 400px;
        opacity: 1;
        pointer-events: all;
        transform: translateY(0);
        padding: 1rem;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem 1.2rem;
        border-radius: 15px;
        font-size: 1rem;
        margin: 0.3rem 0;
        opacity: 0;
        transform: translateX(-20px);
        animation: none;
    }

    .navbar-links.active .nav-link {
        opacity: 1;
        transform: translateX(0);
    }

    .navbar-links.active .nav-link:nth-child(1) {
        animation: slideInLink 0.3s ease forwards 0.1s;
    }

    .navbar-links.active .nav-link:nth-child(2) {
        animation: slideInLink 0.3s ease forwards 0.15s;
    }

    .navbar-links.active .nav-link:nth-child(3) {
        animation: slideInLink 0.3s ease forwards 0.2s;
    }

    .navbar-links.active .nav-link:nth-child(4) {
        animation: slideInLink 0.3s ease forwards 0.25s;
    }

    .navbar-links.active .nav-link:nth-child(5) {
        animation: slideInLink 0.3s ease forwards 0.3s;
    }

    @keyframes slideInLink {
        from {
            opacity: 0;
            transform: translateX(-20px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .nav-link span {
        display: inline;
    }

    .nav-link i {
        font-size: 1.2rem;
    }

    .nav-link:hover {
        transform: translateX(5px);
    }

    /* Backdrop blur overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 9997;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: all;
    }
}

@media (max-width: 480px) {
    .unified-navbar {
        padding: 0.5rem 0.8rem;
    }

    .navbar-brand i {
        font-size: 1.3rem;
    }

    .nav-action-btn,
    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .navbar-links {
        top: 4rem;
    }

    .nav-link {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }
}

/* Scrolled state - keep consistent transparent blur */
.unified-navbar.scrolled {
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
}