/* Custom Seamless Select Component */
.ath-custom-select-wrapper {
    position: relative;
    width: 100%;
    /* Odziedzicz font jeśli to możliwe, w przeciwnym razie globalne body/heading */
    font-family: inherit;
}

.ath-custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    border: none; /* Całkowite usunięcie obramowania, by zapobiec pikselowemu zwężeniu listy */
    border-radius: var(--ath-border-radius-input, 8px);
    background: var(--ath-modal-input-bg, color-mix(in srgb, currentColor 5%, transparent));
    color: inherit;
    cursor: pointer;
    font-size: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
    user-select: none;
}

/* Wariacja dla panelu admina (jaśniejsze tło) */
.wp-admin .ath-custom-select-trigger {
    background: #fff;
    border: 1px solid #8c8f94;
    box-shadow: none;
    border-radius: 3px;
    padding: 4px 8px;
    min-height: 30px;
    font-size: 13px;
}

.wp-admin .ath-custom-select-dropdown {
    border: 1px solid #8c8f94;
    border-top: none;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.wp-admin .ath-custom-option {
    padding: 6px 12px;
    font-size: 13px;
}

/* Stan aktywny - usunięcie dolnego promienia zgrania z listą */
.ath-custom-select-wrapper.is-open .ath-custom-select-trigger {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: transparent;
    background: var(--ath-card-bg, #ffffff);
    color: var(--ath-text-color, #1e293b) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); /* Mocniejszy cień zamiast białej ramki focusa */
}

.ath-custom-select-trigger:focus,
.ath-custom-select-trigger:hover {
    outline: none;
}

.ath-custom-select-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.ath-custom-select-icon {
    flex-shrink: 0;
    margin-left: 10px;
    width: 12px;
    height: 12px;
    color: color-mix(in srgb, currentColor 50%, transparent);
    transition: transform 0.3s ease;
}

.ath-custom-select-wrapper.is-open .ath-custom-select-icon {
    transform: rotate(180deg);
}

.ath-custom-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: var(--ath-card-bg, #ffffff);
    border: none;
    border-top: 1px solid color-mix(in srgb, currentColor 10%, transparent);
    border-radius: 0 0 var(--ath-border-radius-input, 8px) var(--ath-border-radius-input, 8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    max-height: 250px;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Wąski pasek scrolla */
.ath-custom-select-dropdown::-webkit-scrollbar {
    width: 6px;
}
.ath-custom-select-dropdown::-webkit-scrollbar-track {
    background: color-mix(in srgb, currentColor 2%, transparent);
}
.ath-custom-select-dropdown::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, currentColor 20%, transparent);
    border-radius: 3px;
}

.ath-custom-option {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    color: var(--ath-text-color, inherit);
    display: flex;
    align-items: center;
}

.ath-custom-option:hover,
.ath-custom-option.is-highlighted {
    background: color-mix(in srgb, var(--ath-primary-color, #2563eb) 8%, transparent);
    color: var(--ath-primary-color, #2563eb);
}

.ath-custom-option.is-selected {
    background: color-mix(in srgb, var(--ath-primary-color, #2563eb) 12%, transparent);
    color: var(--ath-primary-color, #2563eb);
    font-weight: 600;
}
