.ydn-custom-select {
    --ydn-select-bg: var(--bg-tertiary, var(--bg-secondary, var(--card-bg, #ffffff)));
    --ydn-select-bg-elevated: var(--bg-secondary, var(--card-bg, #ffffff));
    --ydn-select-text: var(--text-primary, var(--text-color, #0f172a));
    --ydn-select-muted: var(--text-muted, var(--text-secondary, #64748b));
    --ydn-select-border: var(--border-color, rgba(15, 23, 42, 0.12));
    --ydn-select-accent: var(--primary, var(--cta-color, #0369a1));
    --ydn-select-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    position: relative;
    display: block;
    width: 100%;
}

[data-theme="dark"] .ydn-custom-select {
    --ydn-select-shadow: 0 22px 48px rgba(2, 6, 23, 0.52);
}

.ydn-custom-select--inline {
    display: inline-block;
    width: auto;
    vertical-align: middle;
}

.ydn-custom-select__native {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.ydn-custom-select__trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 2.75rem 0.75rem 1rem;
    border: 1.5px solid var(--ydn-select-border);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, var(--ydn-select-bg) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    color: var(--ydn-select-text);
    font: inherit;
    line-height: 1.4;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

[data-theme="dark"] .ydn-custom-select__trigger {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.96) 0%, var(--ydn-select-bg) 100%);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.28);
}

.ydn-custom-select__trigger:hover {
    border-color: rgba(3, 105, 161, 0.42);
    box-shadow: 0 14px 30px rgba(3, 105, 161, 0.14);
}

.ydn-custom-select__trigger:focus-visible,
.ydn-custom-select.is-open .ydn-custom-select__trigger,
.ydn-custom-select:focus-within .ydn-custom-select__trigger {
    border-color: var(--ydn-select-accent);
    box-shadow: 0 0 0 4px rgba(3, 105, 161, 0.14);
    outline: none;
    background: var(--ydn-select-bg-elevated);
}

.ydn-custom-select.is-invalid .ydn-custom-select__trigger {
    border-color: var(--ydn-select-border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.ydn-custom-select.is-disabled .ydn-custom-select__trigger {
    opacity: 0.72;
    cursor: not-allowed;
    box-shadow: none;
}

.ydn-custom-select__label {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.ydn-custom-select.is-placeholder .ydn-custom-select__label {
    color: var(--ydn-select-muted);
}

.ydn-custom-select__icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 10px;
    height: 10px;
    margin-top: -6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    color: var(--ydn-select-muted);
    transition: transform 0.2s ease, color 0.2s ease, margin-top 0.2s ease;
    pointer-events: none;
}

.ydn-custom-select.is-open .ydn-custom-select__icon {
    margin-top: -1px;
    transform: rotate(-135deg);
    color: var(--ydn-select-accent);
}

.ydn-custom-select__dropdown {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5000;
    display: none;
    width: 100%;
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--ydn-select-shadow);
    backdrop-filter: blur(16px);
}

[data-theme="dark"] .ydn-custom-select__dropdown {
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(148, 163, 184, 0.14);
}

.ydn-custom-select__dropdown.is-open {
    display: block;
}

.ydn-custom-select__option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ydn-select-text);
    font: inherit;
    line-height: 1.4;
    text-align: left;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
    cursor: pointer;
}

.ydn-custom-select__option:hover,
.ydn-custom-select__option:focus-visible {
    background: rgba(3, 105, 161, 0.08);
    color: var(--ydn-select-accent);
    outline: none;
}

[data-theme="dark"] .ydn-custom-select__option:hover,
[data-theme="dark"] .ydn-custom-select__option:focus-visible {
    background: rgba(59, 130, 246, 0.14);
}

.ydn-custom-select__option.is-selected {
    background: rgba(3, 105, 161, 0.12);
    color: var(--ydn-select-accent);
    font-weight: 600;
}

[data-theme="dark"] .ydn-custom-select__option.is-selected {
    background: rgba(59, 130, 246, 0.18);
}

.ydn-custom-select__option.is-disabled {
    color: var(--ydn-select-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.ydn-custom-select__option.is-disabled:hover,
.ydn-custom-select__option.is-disabled:focus-visible {
    background: transparent;
    color: var(--ydn-select-muted);
}

.ydn-custom-select--sm .ydn-custom-select__trigger {
    min-height: 38px;
    padding: 0.5rem 2.25rem 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

.ydn-custom-select--sm .ydn-custom-select__icon {
    right: 0.75rem;
    width: 8px;
    height: 8px;
}

.ydn-custom-select__dropdown::-webkit-scrollbar {
    width: 8px;
}

.ydn-custom-select__dropdown::-webkit-scrollbar-thumb {
    border-radius: 9999px;
    background: rgba(148, 163, 184, 0.6);
}
