/**
 * Language and City Dropdown Styles
 * Includes bottom-bar dropdowns, story-type-section, and category dropdowns
 * Features custom scrollbars and RTL support
 */

/* Language and City Dropdown Buttons */
#bottom-bar .dropdown-toggle {
    padding: 10px 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#bottom-bar .dropdown-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

#bottom-bar .dropdown-toggle .flag-icon {
    margin-right: 8px;
    vertical-align: middle;
}

/* Language and City Dropdown Menus */
#bottom-bar .dropdown-menu {
    min-width: 200px;
    padding: 4px 0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Language and City Dropdown Items */
#bottom-bar .dropdown-item {
    padding: 10px 16px;
    transition: background-color 0.15s ease;
}

#bottom-bar .dropdown-item:hover {
    background-color: #f0f4f8;
}

#bottom-bar .dropdown-item:active {
    background-color: #e1e8ef;
}

/* City dropdown specific - add max height with nice scrollbar */
#cityDropdown + .dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999 !important;
    position: absolute !important;
}

/* Story-type-section styling (mimics bottom-bar) */
#story-type-section {
    padding: 10px 0 10px 10px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

#story-type-section .header-actions {
    margin-left: auto;
    margin-right: 10px;
}

#story-type-section .btn-link {
    padding: 10px 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: #333;
    font-weight: normal;
    cursor: pointer;
    font-size: 0.9375rem;
}

/* Add space between icon and text in tabs */
#story-type-section .btn-link i {
    margin-right: 6px;
}

#story-type-section .btn-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #000;
}

#story-type-section .btn-link.rz-state-active {
    background-color: #e9ecef;
    color: #000;
    font-weight: 600;
}

#story-type-section .dropdown {
    position: relative;
    z-index: 10000;
}

/* Category dropdown in story-type-section TOP - MUST be above cards */
#categoryDropdownTop + .dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
    z-index: 99999 !important;
    position: fixed !important;
    min-width: 200px;
    padding: 4px 0;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#categoryDropdownTop + .dropdown-menu .dropdown-item {
    padding: 10px 16px;
    transition: background-color 0.15s ease;
    font-size: 0.9375rem;
}

/* Add space between icon and text in dropdown items */
#categoryDropdownTop + .dropdown-menu .dropdown-item i {
    margin-right: 8px;
}

#categoryDropdownTop + .dropdown-menu .dropdown-item:hover {
    background-color: #f0f4f8;
}

#categoryDropdownTop + .dropdown-menu .dropdown-item:active {
    background-color: #e1e8ef;
}

#categoryDropdownTop + .dropdown-menu .dropdown-item.active {
    background-color: #007bff;
    color: white;
}

#categoryDropdownTop + .dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

#categoryDropdownTop + .dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#categoryDropdownTop + .dropdown-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#categoryDropdownTop + .dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Custom scrollbar for city dropdown */
#cityDropdown + .dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

#cityDropdown + .dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#cityDropdown + .dropdown-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#cityDropdown + .dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Custom scrollbar for category dropdown */
#categoryDropdown + .dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

#categoryDropdown + .dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#categoryDropdown + .dropdown-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#categoryDropdown + .dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Category dropdown items - same styling as bottom-bar */
#categoryDropdown + .dropdown-menu .dropdown-item {
    padding: 10px 16px;
    transition: background-color 0.15s ease;
}

#categoryDropdown + .dropdown-menu .dropdown-item:hover {
    background-color: #f0f4f8;
}

#categoryDropdown + .dropdown-menu .dropdown-item:active {
    background-color: #e1e8ef;
}

/* RTL support */
html[dir="rtl"] #bottom-bar .dropdown-toggle .flag-icon {
    margin-right: 0;
    margin-left: 8px;
}

html[dir="rtl"] #bottom-bar .dropdown-item:hover {
    padding-left: 20px !important;
    padding-right: 24px !important;
}

/* Fix z-index for category dropdown to appear above story cards */
#categoryDropdown + .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}

/* Ensure dropdown parent has relative positioning */
#categoryDropdown {
    position: relative;
}

/* Make sure all dropdowns appear on top */
.dropdown-menu.show {
    z-index: 9999 !important;
}
