/* Navigation Header - 2026 Modern Design with Enhanced Glassmorphism */

/* RTL Support for Farsi/Persian */
#fbTopBar,
#navigation-header,
.navigation-container,
.navigation-scroll-wrapper {
    direction: rtl;
    text-align: right;
}

/* Ensure hamburger menu is visible on mobile devices by default */
@media screen and (max-width: 768px) {
    .nav-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1002 !important;
    }
}

#navigation-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* 2026 Enhanced Gradient with Vibrant Colors */
    background: linear-gradient(135deg, rgba(15, 25, 35, 0.95) 0%, rgba(20, 30, 45, 0.98) 50%, rgba(30, 40, 55, 0.95) 100%);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    /* 2026 Enhanced Shadow with Glow Effect */
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 
                0 4px 16px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    max-height: 56px;
    overflow: hidden;
    /* 2026 Subtle Animation */
    animation: slideDown 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Default mobile behavior - will be overridden by media queries for larger screens */
/* Mobile menu - hidden by default, shown when hamburger is clicked */
.mobile-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 0;
    margin: 0;
    background: #0f1923;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.visible {
    display: flex;
    max-height: 80vh;
    padding: 12px 16px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.navigation-scroll-wrapper {
    flex-direction: column;
}

.mobile-menu .nav-button {
    width: 100%;
    margin-bottom: 8px;
    text-align: right;
    padding: 12px 16px;
    font-size: 14px;
    min-height: 44px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* RTL: changed from flex-start to flex-end */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 
                0 2px 6px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mobile-menu .nav-button:last-child {
    margin-bottom: 0;
}

.navigation-header-content {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.nav-toggle {
    /* Default: hidden on desktop, shown on mobile */
    display: none;
    position: absolute;
    left: 12px; /* RTL: changed from right to left */
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px;
    cursor: pointer;
    border-radius: 12px;
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    /* Ensure it's always visible on mobile by default */
}

.nav-toggle:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.12) 100%);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.nav-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

/* Show hamburger menu on mobile by default */
@media screen and (max-width: 768px) {
    .nav-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Force visibility with class */
    .nav-toggle.mobile-visible {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1002 !important;
    }
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-toggle.active {
    background: rgba(255, 255, 255, 0.15);
}

/* Hamburger menu icon using image */
.nav-toggle-icon-img {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0) invert(1);
    -webkit-filter: brightness(0) invert(1);
}

.nav-toggle.active .nav-toggle-icon-img {
    transform: rotate(180deg);
    opacity: 0.8;
}

.nav-toggle:hover .nav-toggle-icon-img {
    opacity: 0.9;
    transform: scale(1.1);
}

.nav-toggle:active .nav-toggle-icon-img {
    transform: scale(0.95);
}

.navigation-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0 14px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.08);
    -ms-overflow-style: -ms-autohiding-scrollbar;
    position: relative;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

/* Custom scrollbar for webkit browsers - visible at bottom */
.navigation-container::-webkit-scrollbar {
    height: 4px;
    display: block;
}

.navigation-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin: 0 20px;
}

.navigation-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.4) 100%);
    border-radius: 2px;
    transition: background 0.2s ease;
}

.navigation-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.6) 100%);
}

.navigation-scroll-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 0;
    min-width: max-content;
    width: max-content;
    align-items: center;
    box-sizing: border-box;
}

.nav-button {
    /* 2026 Enhanced Button Design */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 14px;
    white-space: nowrap;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'B Nazanin', 'Tahoma', Arial, sans-serif;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    box-sizing: border-box;
    flex-shrink: 0;
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    /* 2026 Enhanced Shadow */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), 
                0 3px 8px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.nav-button-text {
    position: relative;
    z-index: 2;
}

.nav-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-button:hover {
    /* 2026 Enhanced Hover with Vibrant Gradient */
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.25) 50%, rgba(240, 147, 251, 0.2) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    color: #ffffff;
    transform: translateY(-3px) scale(1.05);
    /* 2026 Enhanced Glow Effect */
    box-shadow: 0 10px 32px rgba(102, 126, 234, 0.4), 
                0 5px 16px rgba(0, 0, 0, 0.3),
                0 0 40px rgba(102, 126, 234, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2),
                0 0 0 1px rgba(102, 126, 234, 0.2) inset;
}

.nav-button:hover::before {
    left: 100%;
}

.nav-button:active {
    transform: translateY(0) scale(0.98);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 
                inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-button.active {
    /* 2026 Enhanced Active State with Vibrant Colors */
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.5) 0%, rgba(118, 75, 162, 0.4) 50%, rgba(240, 147, 251, 0.3) 100%);
    border-color: rgba(102, 126, 234, 0.7);
    color: #ffffff;
    font-weight: 700;
    /* 2026 Enhanced Active Glow */
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.6), 
                0 4px 16px rgba(118, 75, 162, 0.5),
                0 0 50px rgba(102, 126, 234, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.25),
                0 0 0 1px rgba(102, 126, 234, 0.3) inset;
    transform: translateY(-2px) scale(1.03);
}

.nav-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, rgba(79, 113, 176, 0.8) 0%, rgba(99, 133, 196, 0.8) 100%);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 8px rgba(79, 113, 176, 0.5);
}

/* Ripple effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    width: 10px;
    height: 10px;
    margin-top: -5px;
    margin-left: -5px;
    animation: ripple-animation 0.5s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(30);
        opacity: 0;
    }
}

/* Modern 2025 Animations */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(79, 113, 176, 0.4), 0 0 30px rgba(79, 113, 176, 0.2);
    }
    50% {
        box-shadow: 0 4px 25px rgba(79, 113, 176, 0.6), 0 0 40px rgba(79, 113, 176, 0.3);
    }
}

.nav-button.active {
    animation: fadeInScale 0.3s ease-out;
}

.nav-button.active:hover {
    animation: glow 2s ease-in-out infinite;
}

/* Scroll indicators */
.scroll-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(15, 25, 35, 0.95) 0%, rgba(20, 30, 45, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scroll-indicator.visible {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.scroll-indicator.visible:hover {
    transform: translateY(-50%) scale(1.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.1) 100%);
}

.scroll-indicator.visible {
    opacity: 1;
}

.scroll-indicator-left {
    right: 8px; /* RTL: changed from left to right */
}

.scroll-indicator-right {
    left: 8px; /* RTL: changed from right to left */
}

.scroll-indicator::before {
    content: '‹';
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

.scroll-indicator-right::before {
    content: '›';
}

/* ============================================
   MOBILE STYLES (0px - 768px)
   ============================================ */
@media screen and (max-width: 768px) {
    #navigation-header {
        max-height: 56px !important;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    #navigation-header.expanded {
        max-height: 80vh !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
    
    /* Hamburger menu button - ensure it's always visible on mobile */
    #fbTopBar .nav-toggle,
    .nav-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1002 !important;
        position: absolute !important;
        top: 50% !important;
        left: 12px !important; /* RTL: changed from right to left */
        transform: translateY(-50%) !important;
        width: 42px !important;
        height: 42px !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 12px !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
        cursor: pointer !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
    }
    
    #fbTopBar .nav-toggle:active,
    .nav-toggle:active {
        transform: translateY(-50%) scale(0.95) !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%) !important;
    }
    
    /* Hide desktop navigation on mobile */
    .navigation-container {
        display: none !important;
    }
    
    .navigation-scroll-wrapper {
        display: none !important;
    }
    
    /* Show mobile menu */
    .mobile-menu {
        display: flex !important;
    }
    
    .mobile-menu.visible {
        max-height: calc(80vh - 56px) !important;
        padding: 12px 16px 16px !important;
    }
    
    .mobile-menu .nav-button {
        width: 100% !important;
        text-align: right;
        padding: 12px 16px !important;
        font-size: 14px !important;
        min-height: 44px !important;
        margin-bottom: 8px;
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
    }
    
    .scroll-indicator {
        display: none !important;
    }
    
    body.has-navigation-header {
        padding-top: 56px;
    }
}

/* ============================================
   SMALL MOBILE (0px - 480px)
   ============================================ */
@media screen and (max-width: 480px) {
    .nav-button {
        font-size: 13px;
        padding: 9px 14px;
        min-height: 38px;
    }
    
    .navigation-scroll-wrapper {
        padding: 12px 12px 16px;
        gap: 5px;
    }
    
    .nav-toggle {
        width: 36px;
        height: 36px;
        left: 10px; /* RTL: changed from right to left */
    }
    
    #navigation-header {
        max-height: 54px;
    }
    
    body.has-navigation-header {
        padding-top: 54px;
    }
}

/* ============================================
   TABLET STYLES (769px - 1024px)
   ============================================ */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    #navigation-header {
        max-height: none !important;
        overflow: visible;
    }
    
    /* Hide mobile menu on tablet/desktop */
    .mobile-menu {
        display: none !important;
    }
    
    .navigation-container {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px 16px 8px 50px !important; /* RTL: swapped left/right */
        overflow-x: auto !important;
        overflow-y: hidden !important;
        box-sizing: border-box !important;
    }
    
    .navigation-scroll-wrapper {
        padding: 0 !important;
        gap: 6px;
        flex-direction: row !important;
        display: flex !important;
        width: max-content !important;
        min-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .nav-button {
        padding: 7px 14px;
        font-size: 12px;
        min-height: 34px;
        width: auto !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
    }
    
    #fbTopBar .navigation-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px 16px 8px 50px !important; /* RTL: swapped left/right */
        margin: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        box-sizing: border-box !important;
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    #fbTopBar .navigation-scroll-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        gap: 6px !important;
        flex-direction: row !important;
        display: flex !important;
        width: max-content !important;
        min-width: 0 !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
    }
    
    #fbTopBar .nav-button {
        flex-shrink: 0 !important;
        max-width: 180px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .nav-toggle,
    #fbTopBar .nav-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    body.has-navigation-header {
        padding-top: 50px;
    }
}

/* ============================================
   DESKTOP STYLES (1025px - 1440px)
   ============================================ */
@media screen and (min-width: 1025px) and (max-width: 1440px) {
    #navigation-header {
        max-height: none !important;
        overflow: visible;
    }
    
    /* Hide mobile menu on desktop */
    .mobile-menu {
        display: none !important;
    }
    
    .navigation-container {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px 20px 10px 60px !important; /* RTL: swapped left/right */
        overflow-x: auto !important;
        overflow-y: hidden !important;
        box-sizing: border-box !important;
    }
    
    .navigation-scroll-wrapper {
        padding: 0 !important;
        gap: 8px;
        flex-direction: row !important;
        display: flex !important;
        width: max-content !important;
        min-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .nav-button {
        padding: 8px 16px;
        font-size: 13px;
        min-height: 36px;
        width: auto !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
    }
    
    #fbTopBar .navigation-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px 20px 10px 60px !important; /* RTL: swapped left/right */
        overflow-x: auto !important;
        overflow-y: hidden !important;
        box-sizing: border-box !important;
    }
    
    #fbTopBar .navigation-scroll-wrapper {
        padding: 0 !important;
        gap: 8px !important;
        flex-direction: row !important;
        display: flex !important;
        width: max-content !important;
        min-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .nav-toggle,
    #fbTopBar .nav-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    body.has-navigation-header {
        padding-top: 56px;
    }
}

/* ============================================
   LARGE DESKTOP (1441px+)
   ============================================ */
@media screen and (min-width: 1441px) {
    #navigation-header {
        max-height: none !important;
        overflow: visible;
    }
    
    /* Hide mobile menu on desktop */
    .mobile-menu {
        display: none !important;
    }
    
    .navigation-container {
        display: block !important;
    }
    
    .navigation-scroll-wrapper {
        padding: 0 24px;
        gap: 10px;
        flex-direction: row !important;
        display: flex !important;
    }
    
    .nav-button {
        padding: 9px 18px;
        font-size: 13px;
        min-height: 38px;
        width: auto !important;
    }
    
    .navigation-container {
        padding: 12px 0;
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .nav-toggle {
        display: none !important;
        visibility: hidden !important;
    }
    
    body.has-navigation-header {
        padding-top: 60px;
    }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */
@media screen and (max-width: 768px) and (orientation: landscape) {
    #navigation-header.expanded {
        max-height: 70vh;
    }
    
    .navigation-container {
        max-height: calc(70vh - 56px);
    }
}

/* ============================================
   RTL SUPPORT
   ============================================ */
[dir="rtl"] .navigation-scroll-wrapper,
body[dir="rtl"] .navigation-scroll-wrapper {
    direction: rtl;
}

[dir="rtl"] .nav-toggle,
body[dir="rtl"] .nav-toggle {
    left: 12px;
    right: auto;
}

body[dir="rtl"] .nav-button {
    font-family: 'B Nazanin', 'Tahoma', 'Segoe UI', Arial, sans-serif;
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] .scroll-indicator-left {
    left: auto;
    right: 8px;
}

body[dir="rtl"] .scroll-indicator-right {
    right: auto;
    left: 8px;
}

/* ============================================
   TOOLBAR ADJUSTMENTS - Navigation inside fbTopBar
   ============================================ */
#fbTopBar {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(15, 25, 35, 0.95) 0%, rgba(20, 30, 45, 0.98) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#fbTopBar .navigation-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 20px 16px 60px; /* RTL: swapped left/right padding */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.08);
    -ms-overflow-style: -ms-autohiding-scrollbar;
    position: relative;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    margin: 0;
    left: 0;
    right: 0;
}

/* Custom scrollbar for webkit browsers - visible at bottom */
#fbTopBar .navigation-container::-webkit-scrollbar {
    height: 4px;
    display: block;
}

#fbTopBar .navigation-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin: 0 50px;
}

#fbTopBar .navigation-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.4) 100%);
    border-radius: 2px;
    transition: background 0.2s ease;
}

#fbTopBar .navigation-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.6) 100%);
}

#fbTopBar .navigation-scroll-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0;
    width: max-content;
    min-width: 0;
    align-items: center;
    box-sizing: border-box;
}

#fbTopBar .nav-toggle {
    position: absolute !important;
    left: 12px !important; /* RTL: changed from right to left */
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 1002 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 42px !important;
    height: 42px !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
}

#fbTopBar .nav-toggle:hover,
#fbTopBar .nav-toggle:active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%) !important;
    transform: translateY(-50%) scale(1.05) !important;
}

#fbTopBar .nav-toggle.active {
    background: linear-gradient(135deg, rgba(79, 113, 176, 0.3) 0%, rgba(79, 113, 176, 0.2) 100%) !important;
    border-color: rgba(79, 113, 176, 0.5) !important;
}

#fbTopBar.mobile-view .navigation-container {
    display: none !important;
}

#fbTopBar.mobile-view {
    position: relative !important;
    overflow: visible !important;
}

/* Ensure hamburger icon image is visible and properly styled */
#fbTopBar .nav-toggle .nav-toggle-icon-img {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    object-fit: contain !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    filter: brightness(0) invert(1) !important;
    -webkit-filter: brightness(0) invert(1) !important;
    position: relative !important;
    z-index: 1 !important;
}

#fbTopBar .nav-toggle.active .nav-toggle-icon-img {
    transform: rotate(180deg) !important;
    opacity: 0.8 !important;
}

#fbTopBar .nav-toggle:hover .nav-toggle-icon-img {
    opacity: 0.9 !important;
    transform: scale(1.1) !important;
}

#fbTopBar .nav-toggle:active .nav-toggle-icon-img {
    transform: scale(0.95) !important;
}

#fbTopBar.mobile-view .mobile-menu {
    display: none !important;
    position: fixed;
    top: 46px;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, rgba(15, 25, 35, 0.98) 0%, rgba(20, 30, 45, 0.95) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    z-index: 1001;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
}

#fbTopBar.mobile-view.nav-expanded .mobile-menu,
#fbTopBar.mobile-view .mobile-menu.visible {
    display: flex !important;
    flex-direction: column;
    max-height: calc(100vh - 46px);
    padding: 20px 16px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 1;
}

#fbTopBar.mobile-view .mobile-menu .nav-button {
    width: 100%;
    margin-bottom: 12px;
    text-align: right;
    padding: 14px 20px;
    font-size: 15px;
    min-height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 
                0 2px 6px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#fbTopBar.mobile-view .mobile-menu .nav-button:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 
                inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

#fbTopBar.desktop-view .mobile-menu,
#fbTopBar.tablet-view .mobile-menu {
    display: none !important;
}

#fbTopBar.desktop-view .navigation-container,
#fbTopBar.tablet-view .navigation-container {
    display: block;
}

/* مخفی کردن همبرگر منو در دسکتاپ و تبلت */
#fbTopBar.desktop-view .nav-toggle,
#fbTopBar.tablet-view .nav-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* مخفی کردن همبرگر در صفحه نمایش بزرگ */
@media screen and (min-width: 769px) {
    #fbTopBar .nav-toggle,
    .nav-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* اطمینان از اینکه navigation در کادر می‌ماند */
    #fbTopBar .navigation-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        box-sizing: border-box !important;
    }
    
    #fbTopBar .navigation-scroll-wrapper {
        width: max-content !important;
        min-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    #fbTopBar .nav-button {
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
    }
}

/* ============================================
   FIX FOR 801px - 1326px RANGE
   ============================================ */
@media screen and (min-width: 801px) and (max-width: 1326px) {
    #fbTopBar {
        width: 100% !important;
        max-width: 100vw !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    /* Force containment */
    html, body {
        overflow-x: hidden !important;
    }
    
    #fbTopBar .navigation-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px 16px 16px 50px !important; /* RTL: swapped left/right */
        margin: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        scrollbar-width: thin !important;
        scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.08) !important;
    }
    
    #fbTopBar .navigation-scroll-wrapper {
        width: max-content !important;
        min-width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
    }
    
    #fbTopBar .nav-button {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
        min-width: auto !important;
        max-width: 180px !important;
        display: inline-flex !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    #fbTopBar .nav-button .nav-button-text {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        max-width: 100% !important;
        display: block !important;
    }
    
    /* Visible scrollbar to indicate scrollable content */
    #fbTopBar .navigation-container {
        scrollbar-width: thin !important;
        scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.05) !important;
        -ms-overflow-style: -ms-autohiding-scrollbar !important;
        padding-bottom: 16px !important;
    }
    
    #fbTopBar .navigation-container::-webkit-scrollbar {
        height: 4px !important;
        display: block !important;
    }
    
    #fbTopBar .navigation-container::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.08) !important;
        border-radius: 2px !important;
        margin: 0 50px !important;
    }
    
    #fbTopBar .navigation-container::-webkit-scrollbar-thumb {
        background: linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.4) 100%) !important;
        border-radius: 2px !important;
        transition: background 0.2s ease !important;
    }
    
    #fbTopBar .navigation-container::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(90deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.6) 100%) !important;
    }
    
    /* Ensure no element exceeds viewport */
    #fbTopBar,
    #fbTopBar .navigation-container {
        max-width: 100vw !important;
    }
    
    #fbTopBar .navigation-container {
        min-width: 0 !important;
    }
}

body.has-navigation-header .phoneTopBar {
    top: 56px;
}

@media screen and (max-width: 480px) {
    body.has-navigation-header .fbTopBar,
    body.has-navigation-header .phoneTopBar {
        top: 54px;
    }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    body.has-navigation-header .fbTopBar,
    body.has-navigation-header .phoneTopBar {
        top: 50px;
    }
}

@media screen and (min-width: 1441px) {
    body.has-navigation-header .fbTopBar,
    body.has-navigation-header .phoneTopBar {
        top: 60px;
    }
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */
.navigation-container {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   HIDE OLD NAVIGATION BUTTONS
   ============================================ */
.flip-action[style*="display: none"],
.flip-action[style*="visibility: hidden"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ============================================
   HIDE OLD SEARCH AND HAMBURGER MENU
   ============================================ */
/* Hide old search button */
.phoneTopBar .button[data-button="search"],
.fbTopBar .button[data-button="search"],
.phoneTopBar .button:has(img[src*="search"]),
.fbTopBar .button:has(img[src*="search"]),
.searchBar,
.preSearch {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide old hamburger/menu button */
.phoneTopBar .button[data-button="tableOfContent"],
.phoneTopBar .button[data-button="bookmark"],
.fbTopBar .button[data-button="tableOfContent"],
.fbTopBar .button[data-button="bookmark"],
.phoneTopBar .button:has(img[src*="tableOfContent"]),
.phoneTopBar .button:has(img[src*="bookmark"]),
.fbTopBar .button:has(img[src*="tableOfContent"]),
.fbTopBar .button:has(img[src*="bookmark"]) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide any menu buttons in phoneTopBar (first button is usually menu) */
.phoneTopBar .button:first-child:not(.nav-toggle),
.phoneTopBar .button:nth-child(1):not(.nav-toggle) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide search-related elements */
.searchBar,
.preSearch,
.searchButton,
[class*="search"],
[id*="search"]:not(#navigation-header) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide table of content button if it's a menu button */
.phoneTopBar .button[aria-label*="Table"],
.phoneTopBar .button[aria-label*="Menu"],
.phoneTopBar .button[aria-label*="Content"],
.fbTopBar .button[aria-label*="Table"],
.fbTopBar .button[aria-label*="Menu"],
.fbTopBar .button[aria-label*="Content"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide all buttons in phoneTopBar except logo (first button is usually menu/hamburger) */
.phoneTopBar .button:not([data-button="logo"]):not([data-button="home"]) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Specifically hide search button in phoneTopBar */
.phoneTopBar .button[data-button="search"],
.phoneTopBar .button[data-button="tableOfContent"],
.phoneTopBar .button[data-button="bookmark"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide search form and related elements */
.search_form_phone,
.phone .searchButton,
.phone .input_search {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide and remove search bar in fbTopBar */
.fbTopBar .searchBar,
.fbTopBar .preSearch,
.fbTopBar #preSearchContent,
.fbTopBar .preSearchContent,
.fbTopBar .button[title*="Search"],
.fbTopBar .button:has(img[src*="search"]),
.fbTopBar .button:has(span:contains("Search")),
.fbTopBar .searchBar * {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
}

/* Hide and remove "More" button in fbTopBar */
.fbTopBar .button:has(span:contains("More")),
.fbTopBar .button.right:has(span:contains("More")),
.fbTopBar .button[title*="More"],
.fbTopBar .button.right {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.nav-button:focus {
    outline: 2px solid rgba(79, 113, 176, 0.6);
    outline-offset: 2px;
}

.nav-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.4);
    outline-offset: 2px;
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .nav-button {
        min-height: 40px;
        padding: 10px 16px;
    }
    
    .nav-button:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.05);
    }
    
    .nav-button:active {
        transform: scale(0.98);
        background: rgba(255, 255, 255, 0.12);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    #navigation-header {
        display: none;
    }
}
