/* OPX 6.0 Custom Dropdown Styles */

/* Hide native select */
.custom-dropdown-wrapper select {
    display: none;
}

/* Custom Dropdown Container */
.custom-dropdown-wrapper {
    position: relative;
    width: 100%;
}

/* Custom Dropdown Trigger (mimics select appearance) */
.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background-color: white;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #262626;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-dropdown-trigger:hover {
    border-color: #a3a3a3;
}

.custom-dropdown-trigger.active {
    border-color: #ffac00;
    box-shadow: 0 0 0 2px rgba(255, 172, 0, 0.1);
}

.custom-dropdown-trigger.placeholder {
    color: #737373;
}

/* Dropdown Icon (chevron) */
.custom-dropdown-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.custom-dropdown-trigger.active .custom-dropdown-icon {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 99999 !important;
    background-color: white;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    box-shadow: 0px 4px 6px 0px rgba(0, 0, 0, 0.1), 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
    max-height: 320px;
    display: none;
    flex-direction: column;
}

/* Dropdown positioned above trigger */
.custom-dropdown-menu.dropdown-show-top {
    top: auto;
    bottom: calc(100% + 4px);
    box-shadow: 0px -4px 6px 0px rgba(0, 0, 0, 0.1), 0px -2px 4px 0px rgba(0, 0, 0, 0.1);
}

.custom-dropdown-menu.show {
    display: flex;
}

/* Search Section */
.custom-dropdown-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #d4d4d4;
    flex-shrink: 0;
}

.custom-dropdown-search-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #737373;
}

.custom-dropdown-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #262626;
    padding: 0;
}

.custom-dropdown-search-input::placeholder {
    color: #737373;
}

/* Options List */
.custom-dropdown-options {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}

/* Scrollbar Styling */
.custom-dropdown-options::-webkit-scrollbar {
    width: 16px;
}

.custom-dropdown-options::-webkit-scrollbar-track {
    background: transparent;
    padding: 4px;
}

.custom-dropdown-options::-webkit-scrollbar-thumb {
    background-color: #d4d4d4;
    border-radius: 8px;
    border: 4px solid white;
}

.custom-dropdown-options::-webkit-scrollbar-thumb:hover {
    background-color: #a3a3a3;
}

/* Option Item */
.custom-dropdown-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #262626;
    transition: background-color 0.15s;
}

.custom-dropdown-option:hover {
    background-color: #fafafa;
}

.custom-dropdown-option.selected {
    background-color: #f5f5f5;
}

.custom-dropdown-option.disabled {
    color: #a3a3a3;
    cursor: not-allowed;
}

.custom-dropdown-option.disabled:hover {
    background-color: transparent;
}

.custom-dropdown-option.hidden {
    display: none;
}

/* Checkmark Icon */
.custom-dropdown-check {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #262626;
    display: none;
}

.custom-dropdown-option.selected .custom-dropdown-check {
    display: block;
}

/* No Results Message */
.custom-dropdown-no-results {
    padding: 12px 8px;
    text-align: center;
    font-family: var(--font-family);
    font-size: 14px;
    color: #737373;
    display: none;
}

.custom-dropdown-no-results.show {
    display: block;
}

/* Add New Option */
.custom-dropdown-add-new {
    padding: 12px 8px;
    margin: 4px 8px 8px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    color: #0066FF;
    background-color: #F0F7FF;
    border: 1px dashed #0066FF;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.custom-dropdown-add-new:hover {
    background-color: #E0EFFF;
    border-color: #0052CC;
}

.custom-dropdown-add-new:active {
    background-color: #D0E7FF;
}

.custom-dropdown-add-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
}

.custom-dropdown-add-text {
    flex: 1;
}

.custom-dropdown-add-value {
    font-weight: 600;
}

/* Disabled State */
.custom-dropdown-wrapper.disabled .custom-dropdown-trigger {
    background-color: #f5f5f5;
    color: #a3a3a3;
    cursor: not-allowed;
    border-color: #e5e5e5;
}

.custom-dropdown-wrapper.disabled .custom-dropdown-trigger:hover {
    border-color: #e5e5e5;
}

/* Small variant for compact dropdowns */
.custom-dropdown-wrapper.small .custom-dropdown-trigger {
    padding: 8px 12px;
    font-size: 14px;
    line-height: 20px;
}

.custom-dropdown-wrapper.small .custom-dropdown-menu {
    max-height: 240px;
}

/* Full width variant */
.custom-dropdown-wrapper.full-width {
    width: 100%;
}

/* Ensure dropdowns inside forms/cards are visible */
.payment-card .custom-dropdown-wrapper,
.payment-card-fields .custom-dropdown-wrapper,
.bank-transfer-section .custom-dropdown-wrapper,
.others-bank-section .custom-dropdown-wrapper,
.combo-section .custom-dropdown-wrapper,
.form-section .custom-dropdown-wrapper,
.details-card .custom-dropdown-wrapper,
.from-section .custom-dropdown-wrapper,
.payment-card-container .custom-dropdown-wrapper,
.payment-card-others .custom-dropdown-wrapper,
.beneficiary-detail-field .custom-dropdown-wrapper,
.beneficiary-form .custom-dropdown-wrapper {
    position: relative;
    z-index: 1;
}

/* Ensure dropdown menu appears above all card content */
.payment-card .custom-dropdown-menu,
.payment-card-fields .custom-dropdown-menu,
.bank-transfer-section .custom-dropdown-menu,
.others-bank-section .custom-dropdown-menu,
.combo-section .custom-dropdown-menu,
.form-section .custom-dropdown-menu,
.details-card .custom-dropdown-menu,
.from-section .custom-dropdown-menu,
.payment-card-container .custom-dropdown-menu,
.payment-card-others .custom-dropdown-menu,
.beneficiary-detail-field .custom-dropdown-menu,
.beneficiary-form .custom-dropdown-menu {
    z-index: 9999 !important;
}

/* Ensure parent containers don't clip dropdown menus */
.payment-card,
.payment-card-fields,
.bank-transfer-section,
.others-bank-section,
.combo-section,
.from-section,
.payment-card-container,
.payment-card-others,
.beneficiary-detail-field,
.beneficiary-form,
.card-content {
    overflow: visible !important;
}

/* Fix z-index stacking for beneficiary dropdowns to prevent overlap */
.beneficiary-detail-field {
    position: relative;
}

/* Increase z-index when dropdown is active/open */
.beneficiary-detail-field:has(.custom-dropdown-trigger.active) {
    z-index: 10;
}

/* Ensure sequential z-index for stacked beneficiary fields */
.beneficiary-detail-field:nth-child(1) { z-index: 3; }
.beneficiary-detail-field:nth-child(2) { z-index: 2; }
.beneficiary-detail-field:nth-child(3) { z-index: 1; }

/* When any dropdown is active, boost its z-index above all others */
.beneficiary-detail-field:nth-child(1):has(.custom-dropdown-trigger.active) { z-index: 100; }
.beneficiary-detail-field:nth-child(2):has(.custom-dropdown-trigger.active) { z-index: 100; }
.beneficiary-detail-field:nth-child(3):has(.custom-dropdown-trigger.active) { z-index: 100; }

/* Fix z-index stacking for beneficiary form groups to prevent dropdown overlap */
.form-section .form-row {
    position: relative;
}

.form-section .form-group {
    position: relative;
    z-index: 1;
}

/* Boost z-index when dropdown is active/open */
.form-section .form-group:has(.custom-dropdown-trigger.active) {
    z-index: 50000 !important;
}

/* Ensure form sections don't clip dropdowns */
.form-section .section-content {
    overflow: visible !important;
}

.create-beneficiary-container,
#createBeneficiaryForm,
#beneficiaryDetailsForm {
    overflow: visible !important;
}

/* CRITICAL: Ensure dropdown menu in beneficiary forms always appears on top of EVERYTHING */
.form-section .custom-dropdown-menu,
.form-section .custom-dropdown-menu.show {
    z-index: 99999 !important;
}

/* Boost wrapper z-index when active */
.form-section .custom-dropdown-wrapper:has(.custom-dropdown-trigger.active) {
    z-index: 60000 !important;
}

/* Fix z-index stacking for combo fields to prevent dropdown overlap */
.combo-field {
    position: relative;
}

/* Ensure sequential z-index for stacked combo fields */
.combo-field:nth-child(1) { z-index: 3; }
.combo-field:nth-child(2) { z-index: 2; }
.combo-field:nth-child(3) { z-index: 1; }

/* When any dropdown is active, boost its z-index above all others */
.combo-field:nth-child(1):has(.custom-dropdown-trigger.active) { z-index: 100; }
.combo-field:nth-child(2):has(.custom-dropdown-trigger.active) { z-index: 100; }
.combo-field:nth-child(3):has(.custom-dropdown-trigger.active) { z-index: 100; }

/* Ensure combo-fields-group doesn't clip dropdown menus */
.combo-fields-group {
    overflow: visible !important;
}

/* COMPREHENSIVE FIX: Ensure ALL potential parent containers don't clip dropdowns */
.card,
.card-body,
.card-content,
.form-card,
.details-card,
.info-card,
.section-card,
.payment-section,
.transfer-section,
.beneficiary-section,
.sender-section,
.transaction-section,
.create-beneficiary-container,
.create-sender-container,
.create-transaction-container,
.subsection,
.form-subsection,
.field-group,
.input-group-wrapper,
.radio-cards-group,
.toggle-section,
.collapsible-section,
.accordion-section,
.tab-content,
.panel,
.panel-body,
.modal-body,
.dialog-content,
.container-fluid,
.row,
.col,
[class*="col-"],
.form-horizontal,
.form-vertical,
body > *,
main,
.main-content,
.page-content,
.wrapper,
.inner-wrapper {
    overflow: visible !important;
}

/* Ensure all form-related containers have proper stacking */
.form-section,
.form-row,
.form-group,
.form-field,
.field-wrapper,
.input-wrapper,
.select-wrapper {
    position: relative;
}

/* CRITICAL: Massive z-index boost for active dropdown and all its parents */
.custom-dropdown-wrapper:has(.custom-dropdown-menu.show),
.form-group:has(.custom-dropdown-menu.show),
.form-row:has(.custom-dropdown-menu.show),
.form-section:has(.custom-dropdown-menu.show),
.section-content:has(.custom-dropdown-menu.show),
.card:has(.custom-dropdown-menu.show),
.card-body:has(.custom-dropdown-menu.show),
.payment-card:has(.custom-dropdown-menu.show),
.payment-card-fields:has(.custom-dropdown-menu.show) {
    z-index: 999999 !important;
    position: relative;
}

/* Ensure dropdown menu itself has the highest z-index */
.custom-dropdown-menu.show {
    z-index: 9999999 !important;
    position: absolute;
}

/* Fix for dropdowns inside overflow containers */
.custom-dropdown-wrapper {
    overflow: visible !important;
}

/* Ensure parent of custom dropdown doesn't have overflow hidden */
.custom-dropdown-wrapper::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}


.notifications-container .notifications-controls .custom-dropdown-search-input {
    background: transparent;
    width: 100%;
}