/* Custom Select Dropdown - بديل كامل للعنصر الافتراضي */
/* لا يوجد لون أزرق نهائياً */

.custom-select-wrapper {
    position: relative;
    width: 100%;
    min-width: 160px !important;
}

.custom-select-trigger {
    position: relative;
    width: 100%;
    min-width: 160px !important;
    padding: 6px 12px;
    border: 2px solid #333;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    text-align: right;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 38px;
    user-select: none;
    transition: all 0.2s ease;
    white-space: nowrap !important;
    overflow: visible !important;
}

.custom-select-trigger:hover {
    border-color: #555;
}

.custom-select-trigger.active {
    border-color: #333;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select-trigger .arrow {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #333;
    transition: transform 0.2s ease;
    margin-left: 10px;
}

.custom-select-trigger.active .arrow {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    min-width: auto;
    background: white;
    display: none;
    border: 0;
    border-radius: 4px;
    max-height: 0;
    overflow: hidden;
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    box-shadow: none;
}

.custom-select-options.active {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    border: 2px solid #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.custom-option {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
    background: white;
    transition: background-color 0.15s ease;
    min-height: 42px;
    display: flex;
    align-items: center;
    white-space: nowrap !important;
    overflow: visible !important;
}

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

.custom-option:hover {
    background-color: #f0f0f0;
    color: #333;
}

.custom-option.selected {
    background-color: #f5f5f5;
    color: #333;
    font-weight: 500;
}

.custom-option.selected:hover {
    background-color: #ebebeb;
}

/* إخفاء العنصر الأصلي */
.custom-select-wrapper select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* Custom Scrollbar */
.custom-select-options::-webkit-scrollbar {
    width: 8px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 0;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Focus State */
.custom-select-trigger:focus {
    outline: none;
    border-color: #333;
}

/* Disabled State */
.custom-select-wrapper.disabled .custom-select-trigger {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.custom-select-wrapper.disabled .custom-option {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .custom-select-trigger {
        padding: 14px 15px;
        font-size: 15px;
    }

    .custom-option {
        padding: 14px 15px;
        font-size: 15px;
        min-height: 48px;
    }

    .custom-select-options {
        max-height: 250px;
    }
}

/* Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-select-options.active {
    animation: slideDown 0.2s ease;
}

/* إزالة أي تنسيق أزرق */
.custom-select-wrapper *,
.custom-select-wrapper *:focus,
.custom-select-wrapper *:active,
.custom-select-wrapper *::selection {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* No Blue Color Anywhere */
.custom-option:focus,
.custom-option:active {
    background-color: #f0f0f0 !important;
    color: #333 !important;
}
