/* Custom Select Styles */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    position: relative;
    width: 100%;
    cursor: pointer;
}

.custom-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 13.5px 0;
    font-size: 18px;
    border: none;
    border-bottom: 1px solid var(--border-secondary);
    background-color: transparent;
    color: var(--text-primary);
    transition: border-color 0.3s;
    cursor: pointer;
}

.custom-select__trigger span {
    flex: 1;
    text-align: left;
}

.custom-select__trigger span.placeholder {
    color: var(--text-tertiary);
}

.arrow-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.arrow-icon {
    width: 16px;
    height: 16px;
    transform: rotate(-90deg);
    transition: transform 0.3s ease;
}

.custom-select.open .arrow-icon {
    transform: rotate(90deg);
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* Кастомный скролл для дропдауна */
.custom-options::-webkit-scrollbar {
    width: 6px;
}

.custom-options::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 6px;
}

.custom-options::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.custom-options::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}

/* Поддержка для Firefox */
.custom-options {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.custom-select.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    display: block;
    padding: 12px 16px;
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-secondary);
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background-color: var(--bg-secondary, #f8f9fa);
}

.custom-option.selected {
    background-color: var(--accent-primary);
    color: white;
}

.custom-option[data-placeholder="true"] {
    color: var(--text-tertiary);
    font-style: italic;
}

/* Focus styles for accessibility */
.custom-select__trigger:focus {
    outline: none;
    border-bottom-color: var(--accent-primary);
}

/* Error state styles */
.custom-select-wrapper .custom-select.error .custom-select__trigger,
.custom-select-wrapper.error .custom-select__trigger {
    border-bottom-color: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-select__trigger {
        padding: 15px 0;
        font-size: 16px;
    }
    
    .custom-option {
        padding: 10px 12px;
        font-size: 14px;
    }
}