/* ============================================================
   FitTracks Global Custom Combobox & Dropdown Design System
   ============================================================ */

/* SweetAlert2 Modal Dropdown Overlay Fixes */
.swal2-popup {
    overflow: visible !important;
}
.swal2-html-container {
    overflow: visible !important;
    position: relative !important;
    z-index: 30 !important;
}
.swal2-popup .swal2-actions {
    z-index: 10 !important;
    position: relative !important;
    margin-top: 18px !important;
}

/* Combobox Outer Container */
.fit-dropdown-wrap {
    position: relative;
    width: 100%;
    z-index: 40;
}

/* Combobox Trigger Button */
.fit-dropdown-trigger {
    width: 100%;
    box-sizing: border-box;
    background: #141d2b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    outline: none;
    color: #f8fafc;
    height: 42px;
    font-size: 13.5px;
    font-family: inherit;
}

.fit-dropdown-trigger:hover,
.fit-dropdown-trigger:focus,
.fit-dropdown-trigger.open {
    border-color: var(--lime, #84cc16);
    box-shadow: 0 0 0 2px rgba(132, 204, 22, 0.2);
}

.fit-dropdown-trigger.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
}

[data-theme="light"] .fit-dropdown-trigger {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .fit-dropdown-trigger:hover,
[data-theme="light"] .fit-dropdown-trigger:focus,
[data-theme="light"] .fit-dropdown-trigger.open {
    border-color: var(--lime, #65a30d);
    box-shadow: 0 0 0 2px rgba(101, 163, 13, 0.18);
}

/* Trigger Inner Content */
.fit-dropdown-trigger-content {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.fit-dropdown-chevron {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.fit-dropdown-trigger.open .fit-dropdown-chevron {
    transform: rotate(180deg);
}

/* Floating Dropdown Menu Card */
.fit-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #141d2c;
    border: 1px solid #2e3d52;
    border-radius: 10px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 99999;
    overflow: hidden;
    text-align: left;
}

[data-theme="light"] .fit-dropdown-menu {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Search Header inside Dropdown */
.fit-dropdown-search-wrap {
    padding: 8px;
    border-bottom: 1px solid #243246;
    background: #0d141f;
}

[data-theme="light"] .fit-dropdown-search-wrap {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

.fit-dropdown-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.fit-dropdown-search-box svg.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
    pointer-events: none;
}

.fit-dropdown-search-input {
    width: 100%;
    box-sizing: border-box;
    height: 34px;
    background: #141d2b;
    border: 1px solid #2e3d52;
    border-radius: 6px;
    padding: 6px 75px 6px 32px;
    font-size: 13px;
    color: #f8fafc;
    outline: none;
    transition: all 0.15s ease;
    font-family: inherit;
}

.fit-dropdown-search-input:focus {
    border-color: var(--lime, #84cc16);
    box-shadow: 0 0 0 2px rgba(132, 204, 22, 0.15);
}

[data-theme="light"] .fit-dropdown-search-input {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .fit-dropdown-search-input::placeholder {
    color: #94a3b8;
}

[data-theme="light"] .fit-dropdown-search-input:focus {
    border-color: var(--lime, #65a30d);
    box-shadow: 0 0 0 2px rgba(101, 163, 13, 0.12);
}

.fit-dropdown-search-badge {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    pointer-events: none;
}

/* Scrollable Options List */
.fit-dropdown-list {
    max-height: 180px;
    overflow-y: auto;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: #334155 #141d2c;
}

.fit-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.fit-dropdown-list::-webkit-scrollbar-track {
    background: #141d2c;
}

.fit-dropdown-list::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

[data-theme="light"] .fit-dropdown-list {
    scrollbar-color: #cbd5e1 #ffffff;
}

[data-theme="light"] .fit-dropdown-list::-webkit-scrollbar-track {
    background: #f8fafc;
}

[data-theme="light"] .fit-dropdown-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

/* Individual Dropdown Item */
.fit-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
    margin-bottom: 2px;
    color: #f8fafc;
}

.fit-dropdown-item:hover,
.fit-dropdown-item.active {
    background: #1e2a3c;
}

.fit-dropdown-item.selected {
    background: rgba(132, 204, 22, 0.16);
}

[data-theme="light"] .fit-dropdown-item {
    color: #0f172a;
}

[data-theme="light"] .fit-dropdown-item:hover,
[data-theme="light"] .fit-dropdown-item.active {
    background: #f1f5f9;
}

[data-theme="light"] .fit-dropdown-item.selected {
    background: rgba(101, 163, 13, 0.12);
}

/* Avatar / Icon Container */
.fit-dropdown-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #223049;
    color: var(--lime, #84cc16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid rgba(132, 204, 22, 0.3);
    flex-shrink: 0;
    overflow: hidden;
}

.fit-dropdown-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

[data-theme="light"] .fit-dropdown-avatar {
    background: #ecfccb;
    color: #3f6212;
    border-color: #bef264;
}

/* Search Query Highlighting */
.fit-dropdown-highlight {
    background: rgba(132, 204, 22, 0.35);
    color: #ffffff;
    border-radius: 2px;
    padding: 0 2px;
}

[data-theme="light"] .fit-dropdown-highlight {
    background: rgba(101, 163, 13, 0.25);
    color: #166534;
}

/* Status Indicator Dots */
.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot-active {
    background: #84cc16;
    box-shadow: 0 0 6px rgba(132, 204, 22, 0.6);
}

.status-dot-pending {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.status-dot-expired {
    background: #64748b;
}

.status-dot-cancelled {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

[data-theme="light"] .status-dot-active {
    background: #16a34a;
    box-shadow: 0 0 6px rgba(22, 163, 74, 0.35);
}

[data-theme="light"] .status-dot-pending {
    background: #d97706;
    box-shadow: 0 0 6px rgba(217, 119, 6, 0.35);
}

[data-theme="light"] .status-dot-cancelled {
    background: #dc2626;
    box-shadow: 0 0 6px rgba(220, 38, 38, 0.35);
}

/* Universal Form Inputs Matching Custom Combobox */
.wb-modal-input,
.wb-modal-date-input {
    width: 100%;
    box-sizing: border-box;
    height: 42px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #141d2b;
    color: #f8fafc;
    padding: 10px 14px;
    font-size: 13.5px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.wb-modal-input:focus,
.wb-modal-date-input:focus {
    border-color: var(--lime, #84cc16);
    box-shadow: 0 0 0 2px rgba(132, 204, 22, 0.2);
}

[data-theme="light"] .wb-modal-input,
[data-theme="light"] .wb-modal-date-input {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

[data-theme="light"] .wb-modal-input:focus,
[data-theme="light"] .wb-modal-date-input:focus {
    border-color: var(--lime, #65a30d) !important;
    box-shadow: 0 0 0 2px rgba(101, 163, 13, 0.18) !important;
}
