/* Dropdown Container */
.singlecustom-select-container {
    z-index: 1;
    position: relative;
    width: 100%;
    display: inline-block;
    overflow: visible !important;
}

/* Dropdown Trigger */
.singlecustom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.singlecustom-select-trigger:hover {
    border-color: #20b9a3;
}

/* Dropdown Menu */
.singlecustom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin-top: 4px;
    max-height: 330px;
    overflow-y: auto;
    z-index: 9999 !important;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.singlecustom-select-dropdown.active {
    display: block;
}

@media only screen and (max-width: 480px) {
  .singlecustom-select-dropdown.active {
    display: block;
    position: relative;
  }
}


/* Search Input */
.singlecustom-select-search {
    padding: 0.5rem;
    border-bottom: 1px solid #ced4da;
}

.singlecustom-select-search input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    outline: none;
}

.singlecustom-select-search input:focus {
    border-color: #20b9a3;
}

/* Options List */
.singlecustom-select-options {
    list-style: none;
    padding: 0;
    margin: 0;
}

.singlecustom-select-option {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}


.singlecustom-select-option.selected {
    background-color: #20b9a3;
}

/* Disabled State */
.singlecustom-select-container.disabled .singlecustom-select-trigger {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Loading Spinner */
.dropdown-spinner
 {
    display: inline-block;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

/* Form Overlay */
.form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Scrollbar Styles */
.singlecustom-select-dropdown::-webkit-scrollbar {
    width: 8px;
}

.singlecustom-select-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.singlecustom-select-dropdown::-webkit-scrollbar-thumb {
    background: #20b9a3;
    border-radius: 4px;
}

.singlecustom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: #1a9a87;
}

/* Error State */
.singlecustom-select-container.error .singlecustom-select-trigger {
    border-color: #dc3545;
}

.singlecustom-select-option.error {
    color: #dc3545;
    cursor: not-allowed;
}

/* Success State */
.singlecustom-select-container.success .singlecustom-select-trigger {
    border-color: #28a745;
}

/* Focus State */
.singlecustom-select-container:focus-within .singlecustom-select-trigger {
    /* No border or shadow on focus */
    border-color: #20b9a3;
    box-shadow: 0 0 0 0.2rem rgba(32, 185, 163, 0.25);
}

/* ===== RESPONSIVE DROPDOWN STYLES ===== */

/* Large Desktop */
@media (min-width: 1200px) {
    .singlecustom-select-trigger {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        min-height: 48px;
    }

    .singlecustom-select-option {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }

    .singlecustom-select-search input {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}

/* Desktop */
@media (min-width: 992px) and (max-width: 1199px) {
    .singlecustom-select-trigger {
        padding: 0.625rem 1rem;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .singlecustom-select-option {
        padding: 0.625rem 1rem;
        font-size: 0.95rem;
    }

    .singlecustom-select-search input {
        padding: 0.625rem 0.875rem;
        font-size: 0.95rem;
    }
}

/* Tablet Landscape */
@media (min-width: 768px) and (max-width: 991px) {
    .singlecustom-select-trigger {
        padding: 0.5rem 0.875rem;
        font-size: 0.9rem;
        min-height: 42px;
    }

    .singlecustom-select-option {
        padding: 0.5rem 0.875rem;
        font-size: 0.9rem;
    }

    .singlecustom-select-search input {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .singlecustom-select-dropdown {
        max-height: 280px;
    }
}

/* Mobile Landscape */
@media (min-width: 481px) and (max-width: 767px) {
    .singlecustom-select-trigger {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        min-height: 40px;
    }

    .singlecustom-select-option {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .singlecustom-select-search input {
        padding: 0.5rem 0.625rem;
        font-size: 0.9rem;
    }

    .singlecustom-select-dropdown {
        max-height: 250px;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .singlecustom-select-trigger {
        padding: 0.4rem 0.625rem;
        font-size: 0.85rem;
        min-height: 46px;
    }

    .singlecustom-select-option {
        padding: 0.4rem 0.625rem;
        font-size: 0.85rem;
    }

    .singlecustom-select-search input {
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }

    .singlecustom-select-dropdown {
        max-height: 200px;
    }

    .singlecustom-select-search {
        padding: 0.4rem;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .singlecustom-select-trigger {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
        min-height: 34px;
    }

    .singlecustom-select-option {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }

    .singlecustom-select-search input {
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
    }

    .singlecustom-select-dropdown {
        max-height: 150px;
    }

    .singlecustom-select-search {
        padding: 0.3rem;
    }
}

/* Very Small Screens */
@media (max-width: 320px) {
    .singlecustom-select-trigger {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
        min-height: 32px;
    }

    .singlecustom-select-option {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }

    .singlecustom-select-search input {
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
    }

    .singlecustom-select-dropdown {
        max-height: 150px;
    }

    .singlecustom-select-search {
        padding: 0.3rem;
    }
}
