/* ========================================
   CUSTOM DROPDOWN COMPONENT
   Theme-matching modern dropdown
   ======================================== */

.custom-dropdown {
    position: relative;
    width: 100%;
}

/* Dropdown Trigger Button */
.custom-dropdown-trigger {
    /* Premium Glassmorphism Background */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(248, 250, 251, 0.9) 100%);

    /* Border and Spacing */
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1rem, 3vw, 1.25rem);
    padding-right: 3rem;

    /* Layout */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    /* Typography */
    font-size: max(16px, 1rem);
    font-weight: 500;
    color: var(--color-text);

    /* Interaction */
    cursor: pointer;
    user-select: none;

    /* Subtle Shadow */
    box-shadow: 0 2px 8px rgba(26, 43, 74, 0.04);

    /* Smooth Transitions */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Effect */
.custom-dropdown-trigger:hover {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(0, 184, 148, 0.03) 100%);
    border-color: var(--color-accent);
    box-shadow: 0 4px 16px rgba(0, 184, 148, 0.12);
    transform: translateY(-2px);
}

/* Active/Open State */
.custom-dropdown.active .custom-dropdown-trigger {
    background: #ffffff;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(0, 184, 148, 0.12),
        0 4px 20px rgba(0, 184, 148, 0.15);
}

/* Dropdown Value Text */
.custom-dropdown-value {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text);
}

/* Placeholder State */
.custom-dropdown-value.placeholder {
    color: var(--color-text-light);
    font-style: italic;
    font-weight: 400;
}

/* Dropdown Arrow Icon */
.custom-dropdown-arrow {
    flex-shrink: 0;
    color: var(--color-text-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-dropdown-trigger:hover .custom-dropdown-arrow {
    color: var(--color-accent);
}

/* Rotate Arrow When Open */
.custom-dropdown.active .custom-dropdown-arrow {
    transform: rotate(180deg);
    color: var(--color-accent);
}

/* Dropdown Menu */
.custom-dropdown-menu {
    /* Positioning */
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 1000;

    /* Premium Glassmorphism */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(248, 250, 251, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    /* Border and Radius */
    border: 2px solid var(--color-accent);
    border-radius: 12px;

    /* Premium Shadow */
    box-shadow: 0 8px 32px rgba(0, 184, 148, 0.15),
        0 4px 16px rgba(26, 43, 74, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);

    /* Layout */
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    max-height: 300px;
    overflow-y: auto;

    /* Hidden by Default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);

    /* Smooth Animations */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Show Menu When Active */
.custom-dropdown.active .custom-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Options */
.custom-dropdown-option {
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1rem, 3vw, 1.25rem);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

/* Option Hover Effect */
.custom-dropdown-option:hover {
    background: linear-gradient(135deg,
            rgba(0, 184, 148, 0.08) 0%,
            rgba(0, 184, 148, 0.04) 100%);
    color: var(--color-accent);
    padding-left: clamp(1.25rem, 3.5vw, 1.5rem);
}

/* Selected Option */
.custom-dropdown-option.selected {
    background: linear-gradient(135deg,
            rgba(0, 184, 148, 0.12) 0%,
            rgba(0, 184, 148, 0.06) 100%);
    color: var(--color-accent);
    font-weight: 600;
}

/* Selected Option Indicator */
.custom-dropdown-option.selected::before {
    content: '✓';
    position: absolute;
    left: clamp(0.5rem, 1.5vw, 0.75rem);
    font-size: 1.1em;
    color: var(--color-accent);
}

.custom-dropdown-option.selected {
    padding-left: clamp(2rem, 5vw, 2.5rem);
}

/* Placeholder Option Styling */
.custom-dropdown-option[data-value=""] {
    color: var(--color-text-light);
    font-style: italic;
    font-weight: 400;
}

/* Scrollbar Styling for Menu */
.custom-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-menu::-webkit-scrollbar-track {
    background: rgba(225, 232, 237, 0.3);
    border-radius: 3px;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 3px;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-hover);
}

/* Smooth Enter Animation */
@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-dropdown.active .custom-dropdown-menu {
    animation: dropdownSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .custom-dropdown-menu {
        max-height: 250px;
    }

    .custom-dropdown-option {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
}