/* Foundlify Navbar */
nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: #0f0f1e;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    gap: 3rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

nav * {
    user-select: none;
}

/* Logo Section */
nav .logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
}

nav .logo img {
    height: 2.5rem;
    width: 2.5rem;
}

nav .logo span {
    font-weight: 700;
    font-size: 1.8rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Tabs Container */
nav .tabs {
    display: flex;
    position: relative;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
    margin: 0 2rem;
    flex-wrap: wrap;
}

nav .tabs input[type="radio"] {
    display: none;
}

nav .tabs input[type="radio"]+.tab {
    color: #b0b0b0;
    transition: color 0.3s ease,
        transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

nav .tabs input[type="radio"]:checked+.tab {
    color: #ffffff;
}

nav .tabs .tab {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.7rem 1.8rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.8rem;
    cursor: pointer;
    transform: scale(1);
    transform-origin: center;
    will-change: transform;
    transition: color 0.38s ease,
        transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    white-space: nowrap;
    gap: 0.5rem;
    text-decoration: none;
}

nav .tabs .tab:hover,
nav .tabs .tab:focus-visible {
    transform: scale(1.08);
}

nav .tabs .tab img {
    height: 1.2rem;
    width: 1.2rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

nav .tabs input[type="radio"]:checked+.tab img {
    opacity: 1;
}
#tabs-logout+.tab,
#tabs-login+.tab {
    margin-left: auto;
}

#tabs-about+.tab {
    margin-left: 0;
}

#tabs-home+.tab {
    margin-left: auto !important;
}

/* Glider - the animated background */
nav .tabs .glider {
    position: absolute;
    z-index: 1;
    left: 0;
    top: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.8rem;
    transition: width 0.35s cubic-bezier(0.4, 0.0, 0.2, 1),
        height 0.35s cubic-bezier(0.4, 0.0, 0.2, 1),
        transform 0.35s cubic-bezier(0.4, 0.0, 0.2, 1),
        opacity 0.35s ease-in;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    opacity: 0;
}

/* No transitions during initial page load */
nav .tabs .glider.no-transition {
    transition: none;
}

/* Glider appears when radio is checked */
nav .tabs input:checked~.glider {
    opacity: 1;
}

/* Right Section - User/Links */
/* All items now use radio buttons in tabs section */

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #6E65C6;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.mobile-menu-btn .mobile-menu-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: block;
}

/* Icon-only mode (when tabs would wrap) */
nav .tabs.icon-only .tab {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    min-width: 2.8rem;
    justify-content: center;
}

nav .tabs.icon-only .tab span {
    display: none;
}

nav .tabs.icon-only .tab img {
    opacity: 0.75;
}

/* Responsive Design */
@media (max-width: 1024px) {
    nav {
        padding: 1rem 3%;
        gap: 2rem;
    }

    nav .logo span {
        font-size: 1.4rem;
    }

    nav .tabs {
        margin: 0 1rem;
        gap: 0.2rem;
    }

    nav .tabs .tab {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        min-width: 2.8rem;
        justify-content: center;
    }

    nav .tabs .tab span {
        display: none;
    }

    nav .tabs .tab img {
        opacity: 0.75;
    }

    nav .nav-right {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        padding: 1rem 6%;
        gap: 1rem;
    }

    nav .tabs {
        display: flex;
        position: absolute;
        top: 100%;
        left: auto;
        right: 0;
        flex-direction: column;
        background-color: #1a1a2e;
        border-radius: 0;
        width: fit-content;
        margin: 0;
        gap: 0.5rem;
        border-bottom: 1px solid rgba(102, 126, 234, 0.1);
        padding: 1rem;
        border-bottom-left-radius: 1rem;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-20px);
        transition: opacity 0.5s ease,
            transform 0.5s ease,
            visibility 0s linear 0.5s;
    }

    nav .tabs.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
        transition: opacity 0.5s ease,
            transform 0.5s ease,
            visibility 0s linear 0s;
    }

    nav .tabs .tab {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        border-radius: 0;
        opacity: 0.55;
        transition: opacity 0.25s ease;
    }

    nav .tabs input[type="radio"]:checked+.tab {
        opacity: 1;
    }

    nav .tabs .tab img {
        opacity: 0.55;
    }

    nav .tabs input[type="radio"]:checked+.tab img {
        opacity: 1;
    }

    nav .tabs .glider {
        display: none;
    }

    nav .tabs .tab:hover,
    nav .tabs .tab:focus-visible {
        transform: none;
    }

    .mobile-menu-btn {
        display: block;
    }
}

