/* ====================================
   Custom Multi-Select Component
   ==================================== */

.custom-multiselect {
    position: relative;
    width: 100%;
    margin-top: 1rem;
}

/* Orijinal select'i gizle */
.custom-multiselect select.original-select {
    display: none;
}

/* Custom Select Button */
.custom-multiselect__button {
    width: 100%;
    padding: 15px 20px;
    background: #f4f5f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 15px;
    color: #333;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.custom-multiselect__button:hover {
    border-color: #121C27;
    background: #f8f8f8;
}

.custom-multiselect__button.active {
    border-color: #121C27;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Button Text */
.custom-multiselect__button-text {
    flex: 1;
    color: #666;
    font-weight: 400;
}

.custom-multiselect__button-text.has-selection {
    color: #121C27;
    font-weight: 500;
}

/* Arrow Icon */
.custom-multiselect__arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.custom-multiselect__button.active .custom-multiselect__arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.custom-multiselect__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #121C27;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.custom-multiselect__dropdown.active {
    max-height: 320px;
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
}

/* Close Button Header (Sticky) */
.custom-multiselect__close-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    gap: 12px;
}

.custom-multiselect__header-text {
    flex: 1;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    line-height: 1.4;
}

.custom-multiselect__close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f4f5f8;
    color: #666;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    font-weight: 300;
    flex-shrink: 0;
}

.custom-multiselect__close-btn:hover {
    background: #121C27;
    color: #ffffff;
    transform: scale(1.05);
}

.custom-multiselect__close-btn:active {
    transform: scale(0.95);
}

/* Dropdown Options List */
.custom-multiselect__options {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

/* Option Item */
.custom-multiselect__option {
    padding: 0;
    margin: 0;
}

/* Option Label (Checkbox Container) */
.custom-multiselect__label {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.custom-multiselect__label:hover {
    background: #f5f5f5;
}

/* Checkbox Input */
.custom-multiselect__checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* Custom Checkbox */
.custom-multiselect__checkmark {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid #d0d0d0;
    border-radius: 3px;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    background: #ffffff;
}

.custom-multiselect__checkbox:checked ~ .custom-multiselect__checkmark {
    background: #121C27;
    border-color: #121C27;
}

/* Checkmark Icon */
.custom-multiselect__checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-multiselect__checkbox:checked ~ .custom-multiselect__checkmark::after {
    display: block;
}

/* Option Text */
.custom-multiselect__option-text {
    flex: 1;
    font-size: 15px;
    color: #333;
    line-height: 1.4;
}

/* "Tümünü Seç" Option - Special Styling */
.custom-multiselect__option--select-all .custom-multiselect__label {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 4px;
    font-weight: 600;
    background: #fafafa;
}

.custom-multiselect__option--select-all .custom-multiselect__label:hover {
    background: #f0f0f0;
}

.custom-multiselect__option--select-all .custom-multiselect__checkmark {
    border-color: #121C27;
}

/* Disabled State (when "Tümünü Seç" is active) */
.custom-multiselect__label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.custom-multiselect__label.disabled .custom-multiselect__checkmark {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

/* Scrollbar Styling */
.custom-multiselect__dropdown::-webkit-scrollbar {
    width: 8px;
}

.custom-multiselect__dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-multiselect__dropdown::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 4px;
}

.custom-multiselect__dropdown::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-multiselect__button {
        padding: 12px 16px;
        font-size: 14px;
    }

    .custom-multiselect__option-text {
        font-size: 14px;
    }

    .custom-multiselect__label {
        padding: 10px 16px;
    }

    .custom-multiselect__dropdown.active {
        max-height: 280px;
    }

    /* Mobilde close button daha büyük olsun */
    .custom-multiselect__close-btn {
        width: 36px;
        height: 36px;
        font-size: 30px;
    }

    .custom-multiselect__close-header {
        padding: 10px 12px;
    }

    .custom-multiselect__header-text {
        font-size: 13px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-multiselect__dropdown.active {
    animation: fadeIn 0.3s ease;
}
