/* NAVBAR COMMON STYLES - Shared base styles */

:root {
    --technex-font: 'Mona Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Global font for whole site (PC + Mobile) */
html, body, input, button, textarea, select {
    font-family: var(--technex-font) !important;
}

/* Ensure descendants inherit the global font to avoid module overrides */
body * {
    font-family: inherit !important;
}

:root {
    --technex-header-height: 64px;
    --nav-mobile-max: 1080px;
}

#technexNavDropdownRoot {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    overflow: visible;
    z-index: 1000001;
    pointer-events: none;
}

#technexNavDropdownRoot .dropdown-menu.nav-dropdown-portal.is-open {
    pointer-events: auto;
}

body.technex-nav-dropdown-active .main-container {
    position: relative !important;
    z-index: 0 !important;
}

body.technex-nav-dropdown-active .hero-section,
body.technex-nav-dropdown-active .hero-center,
body.technex-nav-dropdown-active .hero-title {
    position: relative !important;
    z-index: 0 !important;
}

/* Hiển thị theo breakpoint — dùng chung mọi trang */
.desktop-only { display: block !important; }
.mobile-only  { display: none  !important; }

@media (max-width: 1080px) {
    .desktop-only { display: none !important; }
    .mobile-only  { display: flex !important; }
}

body:not(:has(.admin-app)) {
    padding-top: var(--technex-header-height) !important;
}

.technex-navbar {
    width: 100% !important;
    max-width: 100vw !important;
    min-height: var(--technex-header-height) !important;
    background-color: rgba(255, 255, 255, 0.98) !important;
    border-bottom: 1px solid #e5e7eb !important;
    z-index: 99999 !important;
    display: flex !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    left: 0 !important;
    right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: none !important;
    position: fixed !important;
    top: 0 !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

#pcAuthBlock {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
}

.technex-menu {
    display: flex !important;
    align-items: center !important;
    gap: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    flex-wrap: nowrap !important;
}

.technex-menu li {
    position: relative !important;
}

.technex-logo-brand-wrap {
    display: inline-flex !important;
    align-items: center !important;
    text-decoration: none !important;
    position: relative !important;
    flex-shrink: 0 !important;
    border-radius: 4px !important;
    overflow: visible !important;
}

html:not(.admin-page):not(.nexchat-page) .technex-logo-brand-wrap {
    height: auto !important;
    max-height: 20px !important;
}

.technex-logo-img {
    display: block !important;
    width: auto !important;
    object-fit: contain !important;
    object-position: center center !important;
    animation: technex-logo-fade-in 0.55s ease both !important;
    transition: filter 0.25s ease !important;
}

html:not(.admin-page):not(.nexchat-page) .technex-logo-img {
    height: 20px !important;
    max-height: 20px !important;
}

.technex-logo-brand-wrap:hover .technex-logo-img,
.technex-logo-brand-wrap:focus-visible .technex-logo-img {
    filter: brightness(1.05) !important;
}

.technex-logo-brand-wrap:active .technex-logo-img {
    filter: brightness(0.98) !important;
    transition-duration: 0.1s !important;
}

@keyframes technex-logo-fade-in {
    0% {
        opacity: 0;
        transform: translateY(3px);
    }
    100% {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .technex-logo-img {
        animation: none !important;
        transition: none !important;
    }

    .technex-logo-brand-wrap:hover .technex-logo-img,
    .technex-logo-brand-wrap:focus-visible .technex-logo-img {
        filter: none !important;
    }
}

/* Màu username/chức danh đồng bộ toàn hệ thống */
:root {
    --technex-role-admin: #ff0000;
    --technex-role-manager: #ff7600;
    --technex-role-user-plus: #a24aff;
    --technex-role-user-base: #0087ff;
}
.role-color-admin,
.user-name-meta-block strong.role-color-admin,
.profile-dropdown-window .user-name-meta-block strong.role-color-admin,
#dropdownUsernameText.role-color-admin { color: var(--technex-role-admin) !important; }
.role-color-manager,
.user-name-meta-block strong.role-color-manager,
.profile-dropdown-window .user-name-meta-block strong.role-color-manager,
#dropdownUsernameText.role-color-manager { color: var(--technex-role-manager) !important; }
.role-color-user-active,
.user-name-meta-block strong.role-color-user-active,
.profile-dropdown-window .user-name-meta-block strong.role-color-user-active,
#dropdownUsernameText.role-color-user-active { color: var(--technex-role-user-plus) !important; }
.role-color-user,
.user-name-meta-block strong.role-color-user,
.profile-dropdown-window .user-name-meta-block strong.role-color-user,
#dropdownUsernameText.role-color-user { color: var(--technex-role-user-base) !important; }

.avatar-role-admin { border-color: var(--technex-role-admin) !important; }
.avatar-role-manager { border-color: var(--technex-role-manager) !important; }
.avatar-role-user-active { border-color: var(--technex-role-user-plus) !important; }
.avatar-role-user { border-color: var(--technex-role-user-base) !important; }

/* menu-language-selector-row — khung giống navProfileDropdown */
.menu-language-selector-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    color: #374151 !important;
    border-radius: 6px !important;
    border: 1px solid #e5e7eb !important;
    background: #f9fafb !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.menu-language-selector-row .inline-dropdown-select {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    outline: none !important;
    cursor: pointer !important;
    min-width: 110px !important;
    max-width: 140px !important;
    flex-shrink: 0 !important;
}

.menu-language-selector-row {
    gap: 12px !important;
    flex-wrap: nowrap !important;
}

.menu-language-selector-row > span:first-child {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
    min-width: 0 !important;
    line-height: 1.25 !important;
}

.menu-language-selector-row .menu-icon {
    margin-right: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
    color: #374151 !important;
}

.menu-language-selector-row .menu-icon svg,
.menu-language-selector-row .menu-icon svg circle,
.menu-language-selector-row .menu-icon svg path {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    stroke: currentColor !important;
    fill: none !important;
}

/* dropdown-left-meta căn giữa */
.dropdown-left-meta {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.user-name-meta-block strong.role-color-admin,
.user-name-meta-block strong.role-color-manager,
.user-name-meta-block strong.role-color-user-active,
.user-name-meta-block strong.role-color-user {
    font-weight: 700 !important;
}

/* Sau đăng nhập: ẩn khung đăng ký/đăng nhập */
.technex-navbar.navbar-logged-in .nav-right-guest,
.technex-navbar.navbar-logged-in #navRightGuestBlock,
.technex-navbar.navbar-logged-in .btn-signup,
.technex-navbar.navbar-logged-in .technex-login-btn,
.technex-navbar.navbar-logged-in .mobile-auth-guest {
    display: none !important;
}

/* Mobile/tablet: avatar + menu-toggle bên phải */
.nav-mobile-actions {
    display: none !important;
    align-items: center !important;
    gap: 10px !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
}

@media (max-width: 1080px) {
    .nav-mobile-actions {
        display: inline-flex !important;
    }

    .nav-left-group {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        gap: 0 !important;
    }

    .technex-menu:not(.show) {
        display: none !important;
    }

    .technex-menu.show,
    #navbarMenu.technex-menu.show {
        min-height: 0 !important;
        height: auto !important;
    }
}

/* User notifications bell */
.technex-notif-wrap { position: relative; display: flex; align-items: center; flex-shrink: 0; z-index: 2; }
.technex-notif-bell {
    position: relative; width: 40px; height: 40px; border: none; background: transparent;
    border-radius: 8px; cursor: pointer; color: #64748b; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto; z-index: 1;
}
.technex-notif-bell-icon { pointer-events: none; display: block; flex-shrink: 0; }
.technex-nexchat-msg-icon { color: inherit; }
.technex-notif-bell:hover,
.technex-notif-bell.technex-nexchat-link:hover { background: #f1f5f9; color: #0f172a; }
.technex-notif-bell:active,
.technex-notif-bell.technex-nexchat-link:active { transform: translateY(-1px) scale(0.96); }
.technex-notif-bell.technex-nexchat-link { text-decoration: none; }
.technex-notif-badge {
    position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: #fd5e5e; color: #fff; font-size: 11px; font-weight: 600;
    display: none; align-items: center; justify-content: center; border: 2px solid #fff;
    box-sizing: border-box; line-height: 1;
}
.technex-notif-badge.is-visible { display: flex; }
.technex-notif-panel {
    --technex-notif-pad-x: 16px;
    font-family: var(--technex-font) !important;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    display: block;
    position: absolute; top: calc(100% + 8px); right: 0; width: min(380px, 92vw);
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 1000002; overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px) scale(0.97);
    transform-origin: top right;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease, visibility 0.28s ease;
}
.technex-notif-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.technex-notif-panel-head {
    padding: 14px var(--technex-notif-pad-x) 6px; border-bottom: none;
}
.technex-notif-panel-title {
    margin: 0; font-size: 18px; font-weight: 600; line-height: 1.25; color: #111827;
}
.technex-notif-tabs,
.technex-notif-filters {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 8px var(--technex-notif-pad-x) 10px;
}
.technex-notif-tab,
.technex-notif-filter {
    border: none; background: transparent; color: #374151;
    font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1.2;
    padding: 7px 12px; border-radius: 999px; cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.technex-notif-tab:hover,
.technex-notif-filter:hover { background: #f3f4f6; color: #111827; }
.technex-notif-tab.is-active,
.technex-notif-filter.is-active { background: #eef0ff; color: #5b5ff8; font-weight: 600; }
.technex-notif-section-label {
    padding: 6px var(--technex-notif-pad-x) 2px;
    font-size: 13px; font-weight: 600; line-height: 1.3; color: #111827;
}
.technex-notif-list { max-height: 420px; overflow-y: auto; }
.technex-notif-footer {
    border-top: 1px solid #e5e7eb;
    padding: 10px var(--technex-notif-pad-x) 12px;
    text-align: center;
}
.technex-notif-more-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #5b5ff8;
    text-decoration: none;
}
.technex-notif-more-link:hover { text-decoration: underline; }
.technex-notif-item {
    display: flex; align-items: flex-start; gap: 10px;
    width: 100%; border: none; background: transparent; cursor: pointer;
    padding: 9px var(--technex-notif-pad-x); text-decoration: none; color: inherit;
    transition: background 0.15s ease; text-align: left; font: inherit;
}
.technex-notif-item:hover { background: #f8fafc; }
.technex-notif-item.is-read { background: #fff; color: #475569; }
.technex-notif-item.is-read:hover { background: #f8fafc; }
.technex-notif-item.is-unread,
.technex-notif-item.unread { background: rgba(238, 242, 255, 0.5); color: #1e293b; font-weight: 500; }
.technex-notif-item.is-unread:hover,
.technex-notif-item.unread:hover { background: #eef2ff; }
.technex-notif-item.is-read .technex-notif-item-text { color: #475569; font-weight: 400; }
.technex-notif-item.is-unread .technex-notif-item-text,
.technex-notif-item.unread .technex-notif-item-text { color: #1e293b; font-weight: 500; }
.technex-notif-item-avatar {
    position: relative;
    width: 48px; height: 48px; flex-shrink: 0;
}
.technex-notif-item-avatar img {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: #e5e7eb;
}
.technex-notif-type-badge {
    position: absolute; right: -2px; bottom: -2px;
    width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff;
    display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.technex-notif-type-badge.is-like { background: #ef4444; color: #fff; }
.technex-notif-type-badge.is-comment {background: #00c911;}
.technex-notif-type-badge.is-share { background: #ff9800; }
.technex-notif-type-badge.is-system {background: #00b4ff;}
.technex-notif-item-body { flex: 1 1 auto; min-width: 0; padding-top: 1px; }
.technex-notif-item-text {
    display: block; font-size: 14px; line-height: 1.45; color: #111827; word-break: break-word;
}
.technex-notif-item-text strong { font-weight: 600; }
.technex-notif-item-time {
    display: block; margin-top: 3px; font-size: 12px; line-height: 1.25; color: #5b5ff8; font-weight: 500;
}
.technex-notif-item.is-read .technex-notif-item-time { color: #9ca3af; }
.technex-notif-unread-dot,
.technex-notif-item-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #4f46e5;
    flex-shrink: 0; margin-top: 10px; display: none;
    animation: technexNotifPulse 1.5s ease-in-out infinite;
}
@keyframes technexNotifPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.92); }
}
.technex-notif-item.is-unread .technex-notif-unread-dot,
.technex-notif-item.is-unread .technex-notif-item-dot,
.technex-notif-item.unread .technex-notif-item-dot { display: block; }
.technex-notif-empty {
    padding: 20px var(--technex-notif-pad-x); text-align: center;
    color: #6b7280; font-size: 14px; font-weight: 500; margin: 0;
}
.technex-notif-footer { padding: 0 var(--technex-notif-pad-x) 14px; }
.technex-notif-more-btn {
    width: 100%; padding: 10px 14px; border: none; border-radius: 8px;
    background: #f3f4f6; font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.25;
    color: #111827; cursor: pointer; transition: background 0.15s ease;
}
.technex-notif-more-btn:hover { background: #e5e7eb; }
.nav-mobile-actions .technex-notif-wrap { margin-right: 2px; }
@media (max-width: 1080px) {
    .nav-mobile-actions .technex-notif-wrap {
        position: relative;
        z-index: 3;
        pointer-events: auto;
        flex-shrink: 0;
    }
    .nav-mobile-actions .technex-notif-bell,
    .nav-mobile-actions #technexNotifBell {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        pointer-events: auto;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    .nav-mobile-actions .technex-notif-badge { pointer-events: none; }
}
.nav-right-section .technex-notif-wrap,
#pcAuthBlock .technex-notif-wrap { margin-right: 6px; flex-shrink: 0; }
@media (max-width: 1080px) {
    .nav-right-section .technex-notif-wrap,
    #pcAuthBlock .technex-notif-wrap { display: none !important; }
}
.feed-card-image, .feed-card-image-placeholder { cursor: pointer; }

/* Dropdown item icons — PC + mobile */
.dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.dropdown-item-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #111827 !important;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
}

.dropdown-item-icon svg {
    width: 16px !important;
    height: 16px !important;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

.dropdown-item-label {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    line-height: 1.35 !important;
    text-align: left !important;
}

.dropdown-item:hover,
.dropdown-item:focus-visible {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

.dropdown-item:hover .dropdown-item-icon,
.dropdown-item:focus-visible .dropdown-item-icon {
    background: #ececf0 !important;
    border-color: #e5e7eb !important;
    color: #111827 !important;
}

.dropdown-item.disabled .dropdown-item-icon {
    opacity: 0.45 !important;
}

.dropdown-item.disabled:hover .dropdown-item-icon {
    background: #ffffff !important;
    border-color: #e5e7eb !important;
    color: #111827 !important;
}
