/* ==========================================================================
   DROPDOWN.CSS - Custom Animated Floating Dropdown & Searchable Select Component
   ========================================================================== */

.custom-dropdown {
    position: relative;
    display: inline-block;
    user-select: none;
}

.custom-dropdown.full-width {
    width: 100%;
    display: block;
}

.custom-dropdown-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-main, #1e293b);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-sizing: border-box;
}

.custom-dropdown-btn:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.custom-dropdown.disabled .custom-dropdown-btn,
.custom-dropdown.is-disabled .custom-dropdown-btn,
.custom-dropdown[data-locked] .custom-dropdown-btn {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

.custom-dropdown.active .custom-dropdown-btn,
.custom-dropdown-btn:focus {
    border-color: #059669;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.custom-dropdown-btn .dropdown-label {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-dropdown-btn .dropdown-label.placeholder {
    color: #8896ab;
}

.custom-dropdown-btn .dropdown-arrow {
    font-size: 11px;
    color: #94a3b8;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.custom-dropdown.active .custom-dropdown-btn .dropdown-arrow {
    transform: rotate(180deg);
    color: #059669;
}

/* Dropdown Menu Container */
.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.03);
    padding: 6px;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.custom-dropdown.active .custom-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Search Box Inside Dropdown */
.dropdown-search-box {
    padding: 6px 6px 8px;
    position: relative;
    border-bottom: 1px solid #eef1f4;
    margin-bottom: 6px;
}

.dropdown-search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #94a3b8;
    pointer-events: none;
}

.dropdown-search-input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12.5px;
    background: #f8fafc;
    color: #1e293b;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.dropdown-search-input:focus {
    background: #ffffff;
    border-color: #059669;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.12);
}

/* Dropdown Items List */
.dropdown-options-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}

.dropdown-options-list::-webkit-scrollbar {
    width: 5px;
}

.dropdown-options-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Dropdown Items */
.custom-dropdown-item {
    padding: 8.5px 12px;
    font-size: 12.5px;
    color: #334155;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.15s ease;
}

.custom-dropdown-item:hover {
    background: #f0fdf4;
    color: #059669;
}

.custom-dropdown-item.selected {
    background: #f0fdf4;
    color: #059669;
    font-weight: 600;
}

.custom-dropdown-item .item-check {
    font-size: 11px;
    color: #059669;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.custom-dropdown-item.selected .item-check {
    opacity: 1;
}

.dropdown-no-results {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}

/* ==========================================================================
   DARK MODE DROPDOWN STYLES
   ========================================================================== */
body.dark-mode .custom-dropdown-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode .custom-dropdown.disabled .custom-dropdown-btn {
    background: #0f172a !important;
    border-color: #1e293b !important;
    color: #475569 !important;
}

body.dark-mode .custom-dropdown-btn:hover {
    background: #243047 !important;
    border-color: #475569 !important;
}

body.dark-mode .custom-dropdown.active .custom-dropdown-btn,
body.dark-mode .custom-dropdown-btn:focus {
    border-color: #4f7df3 !important;
    background: #1e293b !important;
    box-shadow: 0 0 0 3px rgba(79, 125, 243, 0.25) !important;
}

body.dark-mode .custom-dropdown-btn .dropdown-arrow {
    color: #64748b !important;
}

body.dark-mode .custom-dropdown.active .custom-dropdown-btn .dropdown-arrow {
    color: #60a5fa !important;
}

body.dark-mode .custom-dropdown-menu {
    background: #0f172a !important;
    border-color: #1e293b !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45) !important;
}

body.dark-mode .dropdown-search-box {
    border-bottom-color: #1e293b;
}

body.dark-mode .dropdown-search-input {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode .dropdown-search-input:focus {
    border-color: #4f7df3 !important;
}

body.dark-mode .custom-dropdown-item {
    color: #cbd5e1 !important;
}

body.dark-mode .custom-dropdown-item:hover {
    background: #18223c !important;
    color: #60a5fa !important;
}

body.dark-mode .custom-dropdown-item.selected {
    background: #1e2a4a !important;
    color: #60a5fa !important;
}

body.dark-mode .custom-dropdown-item .item-check {
    color: #60a5fa !important;
}
