/* Base styles - keep original design for desktop */
#page-topbar {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.layout-width {
    width: 100%;
    margin: 0 auto;
}

.navbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
}

.navbar-brand-box {
    display: flex;
    align-items: center;
}

.logo img {
    height: 20px;
}

.topnav-hamburger {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    width: 20px;
    height: 15px;
    justify-content: space-between;
}

.hamburger-icon span {
    height: 2px;
    background: #333;
    transition: all 0.3s ease;
}

/* Custom Topbar Dropdowns */
.topbar-custom-dropdown {
    display: none;
    position: fixed;
    z-index: 1100;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    padding: 6px 0;
}

.topbar-custom-dropdown.show {
    display: block;
}

.topbar-custom-dropdown .dropdown-content {
    display: flex;
    flex-direction: column;
}

.topbar-custom-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.topbar-custom-dropdown .dropdown-item:hover {
    background: #f5f5f5;
    color: #000;
}

.topbar-custom-dropdown .dropdown-item i {
    margin-right: 0.5rem;
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

/* Nested Dropdown Styles */
.dropdown-item-group {
    position: relative;
}

.dropdown-item-parent {
    justify-content: space-between;
}

.dropdown-item-parent .submenu-arrow {
    margin-left: auto;
    margin-right: 0;
    transition: transform 0.2s ease;
}

.dropdown-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    padding: 6px 0;
    z-index: 1101;
}

.dropdown-item-group:hover .dropdown-submenu,
.dropdown-submenu.submenu-open {
    display: block;
}

.dropdown-item-group:hover .submenu-arrow {
    transform: rotate(90deg);
}

.nav-link .dropdown-arrow {
    margin-left: 0.2rem;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.nav-link.dropdown-active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Horizontal Scroll Navigation Styles */
.topbar-nav-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
    padding-left: 0.5rem;
}

.topbar-nav-scroll {
    overflow: hidden;
    flex: 1;
    min-width: 0;
    position: relative;
}

.topbar-nav-scroll .navbar-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    will-change: transform;
}

.nav-scroll-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e0e0e0;
    background: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.nav-scroll-btn.visible {
    display: flex;
}

.nav-scroll-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.nav-scroll-btn i {
    font-size: 1.25rem;
}

.nav-scroll-count {
    font-size: 0.65rem;
    font-weight: 600;
    background: #000;
    color: #fff;
    border-radius: 10px;
    padding: 1px 5px;
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    text-align: center;
    line-height: 1.3;
}

.custom-menu {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.navbar-nav {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover {
    color: #000000;
}

.nav-link i {
    margin-right: 0.2rem;
}

.nav-link.active {
    border-bottom: 3px solid #000;
}

.navbar-nav .nav-link {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
}

.navbar-nav .nav-link i {
    font-size: 1rem;
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    min-width: 200px;
    z-index: 1050;
}

.menu-dropdown .nav {
    flex-direction: column;
    padding: 0.5rem 0;
}

.menu-dropdown .nav-link {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.menu-dropdown .nav-link:last-child {
    border-bottom: none;
}

/* Mobile overlay menu */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: #fff;
    z-index: 1050;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
}

.mobile-menu-content {
    padding: 1rem 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
}

.mobile-nav-link:hover {
    background: #f8f9fa;
    color: #000000;
}

.mobile-submenu {
    display: none;
    background: #f8f9fa;
}

.mobile-submenu.active {
    display: block;
}

.mobile-submenu-link {
    display: block;
    padding: 0.5rem 2rem;
    color: #666;
    text-decoration: none;
    border-bottom: 1px solid #e9ecef;
}

.mobile-submenu-link:hover {
    color: #000000;
    background: #e9ecef;
}

.mobile-toggle-icon {
    transition: transform 0.3s ease;
}

.mobile-toggle-icon.rotated {
    transform: rotate(180deg);
}

/* Tablet styles */
@media (max-width: 1024px) {
    .navbar-header {
        padding: 0.5rem 0.75rem;
    }

    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
    }

    .nav-scroll-btn {
        width: 28px;
        height: 28px;
    }

    .nav-scroll-btn i {
        font-size: 1.1rem;
    }
}

/* Mobile styles */
@media (max-width: 1024px) {
    .topnav-hamburger {
        display: block;
    }

    .topbar-nav-wrapper {
        display: none;
    }

    .custom-menu {
        display: none;
    }

    .mobile-overlay,
    .mobile-menu {
        display: block;
    }

    .navbar-header {
        justify-content: space-between;
    }

    .d-flex.align-items-center {
        display: flex !important;
        align-items: center !important;
    }
}
/* Small mobile styles */
@media (max-width: 480px) {
    .navbar-header {
        padding: 0.5rem;
    }

    .logo img {
        height: 18px;
    }

    .mobile-menu {
        width: 100%;
        left: -100%;
    }
}

/* Hamburger animation */
.hamburger-active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.hamburger-active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}