/* ========================================
   Navigation & Logo Styles
   ======================================== */

/* Navigation Bar — scoped to top navbar only (not bottom-nav) */
nav:not(.bottom-nav) {
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    transition: background-color var(--transition-base);
}

/* Offset body for fixed nav height */
body {
    padding-top: 70px;
}

.navbar {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-base);
}

.nav-btn-primary {
    background-color: #F4CA16;
    color: var(--primary);
    font-weight: 700;
}

.nav-btn-primary:hover {
    background-color: #e6b800;
    transform: translateY(-2px);
}

.nav-btn-danger {
    background-color: var(--danger);
    color: white;
}

.nav-btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* Theme Toggle Button */
.theme-toggle {
    padding: 8px 12px;
    border: 2px solid var(--input-border);
    border-radius: 6px;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    transition: all var(--transition-base);
}

.theme-toggle:hover {
    border-color: var(--primary);
    background-color: var(--light);
    color: #2c3e50;
}

/* Logo Component */
.logo {
    font-size: 28px;
    font-weight: bold;
    color: #F4CA16;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.logo span {
    color: #F4CA16;
    font-weight: 900;
    font-size: 32px;
    line-height: 1;
}

.logo:hover {
    transform: scale(1.02);
    color: #e6b800;
}

.logo:hover span {
    color: #e6b800;
}

/* User Info Display */
.user-info {
    display: none;
    padding: 8px 16px;
    border-radius: 20px;
    /* background-color: var(--light); */
    color: white;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.user-info.show {
    display: inline-block;
}

.user-info img {
    filter: brightness(0) invert(1);
}

.profile-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: white;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: none;
}

.profile-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Language Selector */
.languageSelector {
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-weight: 600;
    color: white;
    font-size: 14px;
    transition: all var(--transition-base);
    min-width: 100px;
}

.languageSelector:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
}

.languageSelector option {
    color: var(--text-color);
    background: var(--card-bg);
}

/* Mobile-only language selector inside profile dropdown — hidden on desktop */
.mobile-lang-selector {
    display: none;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
    display: inline-block;
}

.profile-dropdown .user-info {
    display: inline-flex;
    padding: 8px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-base);
    align-items: center;
    justify-content: center;
}

.profile-dropdown .user-info:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.profile-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--card-bg);
    border: 2px solid var(--input-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1001;
    padding: 8px;
    flex-direction: column;
    gap: 8px;
}

/* Create invisible bridge between trigger and content */
.profile-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    height: 8px;
    background: transparent;
    z-index: 1000;
}

/* Keep dropdown open when hovering over the trigger or the content (only on desktop) */
@media (min-width: 821px) {
    .profile-dropdown:hover .profile-dropdown-content,
    .profile-dropdown-content:hover {
        display: flex;
    }
    /* Hide on hover if manually closed */
    .profile-dropdown.dropdown-closed:hover .profile-dropdown-content {
        display: none !important;
    }
    .profile-dropdown.dropdown-closed .profile-dropdown-content:hover {
        display: none !important;
    }
}

/* Show dropdown when toggled via click */
.profile-dropdown-content.show {
    display: flex !important;
}

.profile-dropdown-content .theme-toggle {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    font-size: 14px;
}

.profile-dropdown-content .theme-toggle span {
    font-size: 14px;
}

.profile-dropdown-content .nav-btn {
    width: 100%;
}

/* Responsive Navigation */
@media (max-width: 820px) {
    .navbar {
        flex-wrap: nowrap;
        height: 56px;
        padding: 0 12px;
        gap: 8px;
    }

    body {
        padding-top: 56px;
    }

    .nav-links {
        width: auto;
        gap: 6px;
        padding-top: 0;
        flex-wrap: nowrap;
        margin-left: auto;
    }

    .logo {
        font-size: 18px;
        flex-shrink: 0;
    }

    .logo span {
        font-size: 22px;
    }

    /* Hide language selector in main nav row — it's inside mobile profile menu */
    .nav-links > .languageSelector {
        display: none;
    }

    /* Hide full login button text, show compact version */
    #navLogin {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* Compact profile dropdown trigger */
    .profile-dropdown .user-info {
        padding: 6px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    /* Notification bell compact */
    .notification-bell {
        padding: 4px;
        margin-right: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .notification-bell svg {
        width: 18px;
        height: 18px;
    }

    /* Show language selector inside profile dropdown on mobile */
    .profile-dropdown-content .mobile-lang-selector {
        display: block;
        padding-bottom: 4px;
        border-bottom: 1px solid var(--input-border);
        margin-bottom: 4px;
    }

    .mobile-lang-select {
        width: 100%;
        padding: 8px 10px;
        border: 2px solid var(--input-border);
        border-radius: 6px;
        background: var(--card-bg);
        color: var(--text-color);
        font-weight: 600;
        font-size: 13px;
        cursor: pointer;
    }

    /* Profile dropdown position fix for mobile */
    .profile-dropdown-content {
        right: -40px;
        min-width: 170px;
    }

    /* Nav admin lock compact on mobile */
    .nav-admin-lock {
        padding: 4px;
        margin-right: 0;
        width: 32px;
        height: 32px;
    }

    .nav-admin-lock img {
        width: 18px !important;
        height: 18px !important;
    }
}

/* Ultra-compact mobile: profile icon only, no text */
@media (max-width: 500px) {
    .profile-dropdown .user-info {
        padding: 6px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .profile-dropdown .user-info .user-display-name {
        display: none;
    }

    .profile-dropdown .user-info img {
        margin-right: 0 !important;
    }
}

/* Notification Bell */
.notification-bell {
    position: relative;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    margin-right: 0;
    border-radius: 50%;
    transition: background-color 0.3s;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.notification-bell:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Nav Admin Lock Button */
.nav-admin-lock {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 0;
    border-radius: 50%;
    transition: background-color 0.3s;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.nav-admin-lock:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.notifications-popup {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    max-height: 600px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--input-border);
}

.notifications-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-color);
}

.mark-read-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
}

.mark-read-btn:hover {
    text-decoration: underline;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--tab-inactive);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--text-color);
}

.notifications-list {
    overflow-y: auto;
    max-height: 500px;
    padding: 8px;
}

.notification-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background-color: var(--input-bg);
}

.notification-item.unread {
    background-color: rgba(var(--primary-rgb), 0.1);
    border-left-color: var(--primary);
}

.notification-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 4px;
}

.notification-item-message {
    font-size: 13px;
    color: var(--tab-inactive);
    margin-bottom: 4px;
}

.notification-item-time {
    font-size: 11px;
    color: var(--tab-inactive);
}

.notifications-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--tab-inactive);
}

.notifications-empty img {
    width: 80px;
    height: 80px;
    opacity: 0.5;
    margin-bottom: 16px;
}
