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

/* Navbar */
.navbar {
    position: sticky;
    top: 1.5rem;
    z-index: 100;
    background: linear-gradient(145deg, rgba(20, 20, 25, 0.65), rgba(12, 12, 15, 0.85));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    max-width: 1400px;
    width: calc(100% - 3rem);
    margin: 1.5rem auto 2rem auto;
    padding: 0.75rem 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo i {
    color: var(--primary-color);
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-login {
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--text-main);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Header Search */
.header-search {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    width: 300px;
    transition: all 0.3s ease;
}

.header-search:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 70, 85, 0.2);
    width: 350px;
}

.header-search .header-search-icon {
    color: var(--text-muted);
    margin-right: 0.75rem;
}

.header-search input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    width: 100%;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

.header-search input::selection {
    background: transparent;
    color: inherit;
}

.header-search .search-shortcut {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Nav Dropdowns */
.nav-dropdown {
    position: relative;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0.15s;
}


.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 1rem;
    background: rgba(25, 25, 25, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 260px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition-delay: 0.15s;
    z-index: 100;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -24px;
    left: 0;
    right: 0;
    height: 24px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.dropdown-item div {
    display: flex;
    flex-direction: column;
}

.dropdown-item div strong {
    font-size: 0.95rem;
}

.dropdown-item div span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dropdown-item.view-all {
    justify-content: center;
    color: var(--primary-color);
    font-weight: 600;
    gap: 0.5rem;
}

.dropdown-item.text-danger {
    color: #ff4655;
}

.dropdown-item.text-danger:hover {
    background: rgba(255, 70, 85, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Auth Section */
.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}

/* Profile Dropdown */
.profile-dropdown-wrapper {
    position: relative;
}

.profile-toggle {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.profile-toggle:hover .profile-avatar {
    border-color: var(--primary-color);
}

.profile-dropdown-wrapper:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0.15s;
}

.profile-menu {
    right: 0;
    left: auto;
    min-width: 220px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
}

.profile-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-info strong {
    font-size: 1rem;
    color: var(--text-main);
}

.profile-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Mobile Menu Styles */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
}


@media (max-width: 992px) {
    .nav-left {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-menu-btn {
        display: block;
        transition: transform 0.3s ease;
    }

    .mobile-menu-btn:active {
        transform: scale(0.9);
    }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch; /* Override desktop center alignment */
        width: 100%;
        background: #141419;
        position: absolute;
        top: calc(100% + 1rem);
        left: 0;
        padding: 1.25rem;
        gap: 0.5rem;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 24px;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.02) inset;
        z-index: 1000;
        text-align: left;
    }
    


    .nav-links .nav-link {
        font-size: 1.1rem;
        font-weight: 600;
        padding: 1rem 1.25rem;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.02);
        color: var(--text-main);
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: all 0.3s ease;
        text-decoration: none;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-links .nav-link:hover,
    .nav-links .nav-link:active {
        background: rgba(255, 255, 255, 0.08);
        transform: translateX(5px);
    }

    /* Override the desktop hover underline effect for the mobile arrow */
    .nav-links .nav-link::after {
        content: '\f054';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 0.85rem;
        color: var(--text-muted);
        position: static; /* Important: Override inherited absolute positioning */
        width: auto;
        height: auto;
        background-color: transparent;
        transition: color 0.3s ease, transform 0.3s ease;
    }

    .nav-links .nav-link:hover::after,
    .nav-links .nav-link:active::after {
        color: var(--primary-color);
        transform: translateX(3px);
        width: auto; /* Prevent underline expansion */
    }

    .nav-buttons {
        display: none;
    }
}

/* PC Specific Overrides */
@media (min-width: 993px) {
    /* Ensure the mobile auth section is never visible on Desktop */
    .mobile-auth-container {
        display: none !important;
    }
    
    /* Safeguard navigation links on desktop */
    .nav-links {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }
}

