/* Basic dropdown styles */
#categoryDropdownMenu {
    background-color: #fff;
    border-radius: 0.25rem;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
    width: 250px;
    z-index: 9999;
}

/* Dropdown arrow */
#categoryDropdownMenu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
    z-index: 2;
}

#categoryDropdownMenu::after {
    content: '';
    position: absolute;
    top: -9px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* RTL support for dropdown arrow */
.rtl-container #categoryDropdownMenu::before,
.rtl-container #categoryDropdownMenu::after,
[dir="rtl"] #categoryDropdownMenu::before,
[dir="rtl"] #categoryDropdownMenu::after {
    left: auto;
    right: 20px;
}

/* Dropdown header */
#categoryDropdownMenu .dropdown-header {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    padding: 0 0.75rem 4px;
    color: var(--theme-blue, #0d6efd);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

#categoryDropdownMenu .dropdown-header i {
    margin-right: 5px;
    color: var(--theme-blue, #0d6efd);
}

.rtl-container #categoryDropdownMenu .dropdown-header i,
[dir="rtl"] #categoryDropdownMenu .dropdown-header i {
    margin-right: 0;
    margin-left: 5px;
}

/* Dropdown list */
#categoryDropdownMenu .dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

#categoryDropdownMenu .dropdown-list li {
    margin-bottom: 2px;
}

#categoryDropdownMenu .dropdown-list li a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
    padding: 4px 0;
    font-size: 0.8rem;
    color: var(--text-dark, #333);
    text-decoration: none;
    transition: all 0.2s ease;
}

#categoryDropdownMenu .dropdown-list li a:hover {
    color: var(--theme-blue, #0d6efd);
    transform: translateX(3px);
}

.rtl-container #categoryDropdownMenu .dropdown-list li a:hover,
[dir="rtl"] #categoryDropdownMenu .dropdown-list li a:hover {
    transform: translateX(-3px);
}

/* View all link */
#categoryDropdownMenu .view-all-item {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

#categoryDropdownMenu .view-all-link {
    display: block;
    text-align: center;
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    color: var(--theme-blue, #0d6efd) !important;
    font-weight: 500;
}

#categoryDropdownMenu .view-all-link:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: none !important;
}

/* Toggle button styles */
#categoryDropdownToggle {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#categoryDropdownToggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Dropdown arrow animation */
.dropdown-arrow {
    transition: transform 0.2s ease;
}

/* Rotate class for dropdown arrow */
.dropdown-arrow.rotate {
    transform: rotate(180deg);
}

/* Active state for toggle button */
.nav-link.active {
    color: var(--theme-blue, #0d6efd) !important;
    font-weight: 500;
    background-color: rgba(13, 110, 253, 0.1);
}

.nav-link.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* RTL specific styles */
.rtl-container #categoryDropdownMenu,
[dir="rtl"] #categoryDropdownMenu {
    text-align: right;
    direction: rtl;
}

/* Mobile styles */
@media (max-width: 992px) {
    #categoryDropdownMenu {
        width: 100%;
        border-radius: 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        border-left: none;
        border-right: none;
        left: 0 !important;
        right: 0 !important;
    }

    #categoryDropdownMenu::before,
    #categoryDropdownMenu::after {
        display: none;
    }

    #categoryDropdownMenu .dropdown-header {
        padding: 0 15px 4px;
        font-size: 0.9rem;
    }

    #categoryDropdownMenu .dropdown-list {
        padding: 0 15px;
        max-height: none;
    }

    #categoryDropdownMenu .dropdown-list li a {
        padding: 5px 0;
        font-size: 0.85rem;
    }

    #categoryDropdownMenu .view-all-link {
        margin: 0 15px;
    }
}