/* eNOTF Custom Dropdown Styles */

.enotf-dropdown-wrapper {
    position: relative;
    width: 100%;
    display: block !important;
}

.enotf-dropdown-container {
    position: relative;
    cursor: pointer;
    user-select: none;
    display: flex !important;
    align-items: center;
    padding: 0.375rem 0.5rem;
    background: transparent;
    color: #fff;
    border: 0;
    border-radius: 0;
    font-size: 1.2rem;
    min-height: calc(1.5em + 0.75rem + 2px);
    width: 100%;
    visibility: visible !important;
    --bs-form-select-bg-img: none;
    background-image: none;
}

/* Border nur auf der Login-Seite */
#edivi__login .enotf-dropdown-container {
    border: 1px solid #495057;
    background-color: #333333;
}

.enotf-dropdown-container:focus {
    outline: 0;
    box-shadow: 0 0 0 1px #5783cf !important;
}

.enotf-dropdown-container.open {
    box-shadow: 0 0 0 1px #5783cf !important;
}

.enotf-dropdown-container.disabled {
    box-shadow: none !important;
    caret-color: transparent;
    user-select: none;
    pointer-events: none;
    cursor: default;
}

/* eNOTF specific: edivi__input-check functionality */
#edivi__container .edivi__box .enotf-dropdown-container {
    transition: border-left 0.3s ease-in-out;
}

#edivi__container .edivi__box .enotf-dropdown-container.edivi__input-check {
    border-left: 3px solid red;
}

#edivi__container .edivi__box .enotf-dropdown-container.edivi__input-checked {
    border-left: 3px solid #55b530;
}

/* Hide border-left on inputs/selects within a group that has edivi__group-check */
#edivi__container .edivi__box .edivi__group-check~.col .enotf-dropdown-container.edivi__input-check,
#edivi__container .edivi__box .edivi__group-check~.col .enotf-dropdown-container.edivi__input-checked {
    border-left: 0 !important;
}

.enotf-dropdown-display {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 20px;
}

.enotf-dropdown-arrow {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    color: #999;
    pointer-events: none;
}

.enotf-dropdown-container.open .enotf-dropdown-arrow {
    /* Icon wird dynamisch per JavaScript gewechselt */
}

.enotf-dropdown-container.disabled .enotf-dropdown-arrow {
    display: none;
}

.enotf-custom-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #444;
    border: 1px solid #555;
    border-radius: 4px;
    max-height: 300px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    padding: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.enotf-dropdown-search {
    width: 100%;
    margin-bottom: 8px;
    padding: 6px 10px;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    flex-shrink: 0;
}

.enotf-dropdown-search:focus {
    outline: 0;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.1rem rgba(13, 110, 253, 0.25);
}

.enotf-dropdown-search::placeholder {
    color: #999;
}

.enotf-dropdown-options {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 240px;
}

.enotf-dropdown-options::-webkit-scrollbar {
    width: 8px;
}

.enotf-dropdown-options::-webkit-scrollbar-track {
    background: #333;
    border-radius: 4px;
}

.enotf-dropdown-options::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

.enotf-dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.enotf-dropdown-option {
    padding: 8px 12px;
    cursor: pointer;
    color: white;
    border-bottom: 1px solid #555;
    transition: background-color 0.15s ease;
}

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

.enotf-dropdown-option:hover {
    background-color: #555;
}

.enotf-dropdown-option.selected {
    background-color: #0d6efd;
    font-weight: 500;
}

.enotf-dropdown-option.selected:hover {
    background-color: #0b5ed7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .enotf-custom-dropdown {
        max-height: 200px;
    }

    .enotf-dropdown-options {
        max-height: 150px;
    }
}

/* Dark theme specific adjustments */
[data-bs-theme="dark"] .enotf-dropdown-container {
    background-color: #333333;
    border-color: #495057;
}

[data-bs-theme="dark"] .enotf-custom-dropdown {
    background-color: #444;
    border-color: #555;
}

[data-bs-theme="dark"] .enotf-dropdown-option {
    color: white;
    border-bottom-color: #555;
}

/* Animation for dropdown opening */
@keyframes dropdownSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.enotf-custom-dropdown {
    animation: dropdownSlideDown 0.2s ease;
}