/* --- Top Nav (guest) --- */
.unqbd-topnav-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1002;
    background: transparent;
    width: 100%;
    margin-bottom: 0;
}

.unqbd-topnav-container {
    max-width: 1300px;
    margin: 1rem auto 0;  /* Top spacing for desktop/tablet floating effect */
    background: rgba(250, 251, 252, 0.95); /* Increased opacity for better readability */
    border-radius: 2.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.8rem;
    gap: 1.5rem;
    backdrop-filter: blur(8px); /* Subtle blur for depth without compromising clarity */
    -webkit-backdrop-filter: blur(8px); /* Safari support */
}

/* Ensure hero can sit at the very top of the viewport (nav overlays it) */
.page-index,
.page-index-shell,
.min-vh-100 {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.unqbd-topnav-logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    min-width: 160px;
}

.unqbd-topnav-logo img {
    height: 52px;
    width: auto;
    display: block;
}

.unqbd-topnav-auth {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.unqbd-topnav-signin {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    border-radius: 2rem;
    padding: 0.65rem 1.6rem;
    background: linear-gradient(90deg, #00b4ff 60%, #0088cc 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,180,255,0.13);
}

.unqbd-topnav-signin:hover,
.unqbd-topnav-signin:focus {
    color: #fff;
    filter: brightness(1.03);
    box-shadow: 0 8px 32px rgba(0,180,255,0.18);
}

/* Dark mode refinements for guest nav utilities */
body.dark-mode .unqbd-topnav-container {
    background: rgba(26, 26, 26, 0.95); /* Increased opacity to match light mode */
    border: 1px solid rgba(255, 255, 255, 0.10);
}

body.dark-mode .unqbd-topnav-signin {
    background: linear-gradient(90deg, #4DB8FF 60%, #2b87c8 100%);
    color: #0b0b0b;
}

body.dark-mode .unqbd-topnav-signin:hover,
body.dark-mode .unqbd-topnav-signin:focus {
    color: #0b0b0b;
}

body.dark-mode .unqbd-topnav-logo img {
    filter: brightness(1.05) contrast(1.05);
}

/* Dark mode mobile adjustments */
@media (max-width: 600px) {
    body.dark-mode .unqbd-topnav-container {
        background: rgba(26, 26, 26, 0.95);
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }
}

@media (max-width: 900px) {
    /* Tablet: slight reduction but keep floating style with top spacing */
    .unqbd-topnav-container {
        max-width: 96vw;
        margin-top: 0.75rem;  /* Keep some top spacing on tablet */
        padding: 0.65rem 1.2rem;
        gap: 0.75rem;
        border-radius: 2rem;
    }

    .unqbd-topnav-logo {
        min-width: 100px;
        flex-shrink: 1;
    }

    .unqbd-topnav-logo img {
        height: 44px;
    }

    .unqbd-topnav-signin {
        font-size: 1rem;
        padding: 0.6rem 1.2rem;
    }
}

@media (max-width: 600px) {
    /* Modern mobile app experience - edge-to-edge with safe area support */
    .unqbd-topnav-sticky {
        /* Add safe area support for notched devices (iPhone X+) */
        padding-top: env(safe-area-inset-top);
    }

    .unqbd-topnav-container {
        /* Remove rounded corners for full-width mobile app feel */
        border-radius: 0;
        /* Remove margin and make edge-to-edge */
        margin: 0;
        max-width: 100%;
        /* Simplified padding with safe area insets */
        padding: 0.75rem max(1rem, env(safe-area-inset-right)) 0.75rem max(1rem, env(safe-area-inset-left));
        gap: 0.5rem;
        /* Replace shadow with subtle bottom border for cleaner mobile look */
        box-shadow: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        /* Increase background opacity for better readability on mobile */
        background: rgba(250, 251, 252, 0.95);
    }

    .unqbd-topnav-logo {
        min-width: 80px;
    }

    .unqbd-topnav-logo img {
        height: 40px;
        max-width: 100px;
    }

    .unqbd-topnav-signin {
        font-size: 0.95rem;
        padding: 0.6rem 1.1rem;
        /* Slightly less rounded for mobile app aesthetic */
        border-radius: 1.5rem;
    }
}

/* --- Top Nav (member) - Main Tabs --- */
.topnav-main-tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topnav-main-tab {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    color: #444;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.topnav-main-tab:hover {
    background-color: rgba(0, 180, 255, 0.08);
    color: #00b4ff;
}

.topnav-main-tab.active {
    background: linear-gradient(90deg, #00b4ff 60%, #0088cc 100%);
    color: #fff;
    font-weight: 600;
}

/* Profile/logout link style */
.unqbd-topnav-profile {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 2rem;
    padding: 0.5rem 1.2rem;
    background: transparent;
    color: #444;
    border: 1px solid #ccc;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.unqbd-topnav-profile:hover,
.unqbd-topnav-profile:focus {
    background-color: rgba(0, 0, 0, 0.04);
    border-color: #999;
    color: #222;
}

/* Dark mode for member nav */
body.dark-mode .topnav-main-tab {
    color: #e0e0e0;
}

body.dark-mode .topnav-main-tab:hover {
    background-color: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

body.dark-mode .topnav-main-tab.active {
    background: linear-gradient(90deg, #4DB8FF 60%, #2b87c8 100%);
    color: #0b0b0b;
}

body.dark-mode .unqbd-topnav-profile {
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .unqbd-topnav-profile:hover,
body.dark-mode .unqbd-topnav-profile:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Responsive: hide tabs on mobile, show condensed menu */
@media (max-width: 768px) {
    .topnav-main-tabs {
        display: none;
    }
}

@media (max-width: 600px) {
    /* Hide profile text on mobile, keep icon only */
    .unqbd-topnav-profile {
        font-size: 0.9rem;
        padding: 0.5rem;
        border-radius: 50%;
        min-width: 42px;
        min-height: 42px;
        justify-content: center;
    }

    .unqbd-topnav-profile span {
        display: none;
    }

    .unqbd-topnav-profile i {
        font-size: 1.3rem;
    }
}

/* --- Top Nav Icon Buttons --- */
.topnav-icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    border-radius: 50%;
    font-size: 1.1rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.topnav-icon-btn:hover {
    background-color: rgba(0, 180, 255, 0.08);
    color: #00b4ff;
}

body.dark-mode .topnav-icon-btn {
    color: #e0e0e0;
}

body.dark-mode .topnav-icon-btn:hover {
    background-color: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

/* --- Profile Dropdown --- */
.profile-dropdown-container {
    position: relative;
}

.profile-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 2rem;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    color: #444;
    font-size: 1.25rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.profile-dropdown-trigger:hover {
    background-color: rgba(0, 0, 0, 0.04);
    border-color: #bbb;
}

.profile-chevron {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.profile-chevron.open {
    transform: rotate(180deg);
}

.profile-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    z-index: 1010;
    animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-menu-section {
    padding: 0.25rem 0;
}

.profile-menu-divider {
    height: 1px;
    background: #eee;
    margin: 0.5rem 0.75rem;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.15s ease;
}

.profile-menu-item:hover {
    background-color: rgba(0, 180, 255, 0.06);
    color: #00b4ff;
}

.profile-menu-item i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
    color: #666;
}

.profile-menu-item:hover i {
    color: #00b4ff;
}

.profile-menu-item-logout {
    color: #dc3545;
}

.profile-menu-item-logout i {
    color: #dc3545;
}

.profile-menu-item-logout:hover {
    background-color: rgba(220, 53, 69, 0.08);
    color: #c82333;
}

.profile-menu-item-logout:hover i {
    color: #c82333;
}

/* Dark mode for profile dropdown */
body.dark-mode .profile-dropdown-trigger {
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .profile-dropdown-trigger:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

body.dark-mode .profile-dropdown-menu {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body.dark-mode .profile-menu-divider {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .profile-menu-item {
    color: #e0e0e0;
}

body.dark-mode .profile-menu-item i {
    color: #9ca3af;
}

body.dark-mode .profile-menu-item:hover {
    background-color: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
}

body.dark-mode .profile-menu-item:hover i {
    color: #60a5fa;
}

body.dark-mode .profile-menu-item-logout {
    color: #f87171;
}

body.dark-mode .profile-menu-item-logout i {
    color: #f87171;
}

body.dark-mode .profile-menu-item-logout:hover {
    background-color: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
}

body.dark-mode .profile-menu-item-logout:hover i {
    color: #fca5a5;
}

/* Responsive adjustments for profile dropdown */
@media (max-width: 600px) {
    .profile-dropdown-trigger {
        padding: 0.4rem 0.6rem;
        font-size: 1.1rem;
    }

    .profile-chevron {
        display: none;
    }

    .profile-dropdown-menu {
        right: -0.5rem;
        min-width: 200px;
    }
}

/* Profile menu section labels */
.profile-menu-label {
    padding: 0.5rem 1rem 0.25rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
}

body.dark-mode .profile-menu-label {
    color: #6b7280;
}

/* Admin menu item styling */
.profile-menu-item-admin {
    color: #7c3aed;
}

.profile-menu-item-admin i {
    color: #7c3aed;
}

.profile-menu-item-admin:hover {
    background-color: rgba(124, 58, 237, 0.08);
    color: #6d28d9;
}

.profile-menu-item-admin:hover i {
    color: #6d28d9;
}

body.dark-mode .profile-menu-item-admin {
    color: #a78bfa;
}

body.dark-mode .profile-menu-item-admin i {
    color: #a78bfa;
}

body.dark-mode .profile-menu-item-admin:hover {
    background-color: rgba(167, 139, 250, 0.12);
    color: #c4b5fd;
}

body.dark-mode .profile-menu-item-admin:hover i {
    color: #c4b5fd;
}

/* Profile avatar image in dropdown trigger */
.profile-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00b4ff;
}

.profile-dropdown-trigger .profile-avatar-img {
    margin-right: 0.25rem;
}

body.dark-mode .profile-avatar-img {
    border-color: #4DB8FF;
}
