/* Custom Streamer Select Styles */
.custom-streamer-select {
    position: relative !important;
    width: 100%;
    font-family: inherit;
    z-index: 1001; /* Above standard form elements */
    transform: none !important; /* Prevent transform from affecting dropdown */
}

.select-trigger {
    background: #0f0f0f; /* Solid background to prevent bleed-through */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.select-trigger:hover {
    border-color: var(--primary-color);
    background: #1a1a1a;
}

.select-trigger .arrow {
    font-size: 0.8rem;
    transition: transform 0.3s;
    margin-right: 10px;
}

.select-dropdown {
    position: absolute !important;
    top: calc(100% + 5px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #1a1a1a !important;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    z-index: 999999 !important; /* Above everything including table headers */
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    display: none; /* Changed from flex to none, will be set to flex via JS */
    flex-direction: column;
    max-height: 380px;
    overflow: hidden;
    animation: fadeInDown 0.2s ease-out;
    text-align: right; /* Ensure RTL alignment */
    direction: rtl;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateZ(0) !important; /* Force hardware acceleration and reset transform */
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px) translateZ(0); }
    to { opacity: 1; transform: translateY(0) translateZ(0); }
}

.select-search {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    background: #1a1a1a;
    position: sticky;
    top: 0;
    z-index: 2;
}

.select-search input {
    width: 100%;
    padding: 10px 14px;
    background: #0a0a0a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #ffffff;
    outline: none;
    font-size: 0.95rem;
}

.select-search input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(168, 85, 255, 0.2);
}

.select-options {
    overflow-y: auto;
    max-height: 280px;
    background: #1a1a1a;
    padding: 5px 0;
}

.select-option {
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s;
    background: #1a1a1a;
    color: #ffffff;
}

.select-option:hover {
    background: rgba(168, 85, 255, 0.15);
}

.select-option .streamer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.select-option .streamer-info {
    display: flex;
    flex-direction: column;
}

.select-option .streamer-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 1rem;
}

.select-option .streamer-platform {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.select-option.no-results {
    justify-content: center;
    padding: 20px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* Scrollbar */
.select-options::-webkit-scrollbar {
    width: 6px;
}
.select-options::-webkit-scrollbar-track {
    background: transparent;
}
.select-options::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
.select-options::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.selected-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.selected-item img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* Placeholder avatar inside dropdown/select when لا توجد صورة */
.streamer-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    color: var(--primary-color);
    font-size: 1.1rem;
}
