/* Helix Select Component Styles */
/* Note: The .open class is applied to the custom element <helix-select> */

helix-select {
    position: relative;
    width: 100%;
    display: block;
}

.helix-select-trigger {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.6);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 3rem;
}

.helix-select-trigger:hover {
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.9);
}

helix-select.open .helix-select-trigger {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

.helix-select-selected {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
    color: #1f2937;
    font-weight: 500;
}

.helix-select-placeholder {
    color: #6b7280;
    font-style: italic;
}

.helix-select-tag {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.helix-select-tag-remove {
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.helix-select-tag-remove:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.helix-select-arrow {
    color: #6b7280;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

helix-select.open .helix-select-arrow {
    transform: rotate(180deg);
    color: #6366f1;
}

.helix-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.6);
    border-radius: 8px;
    margin-top: 0.25rem;
    z-index: 1100;
    max-height: 250px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: none;
    isolation: isolate;
}

/* When the custom element has the .open class, display the dropdown */
helix-select.open .helix-select-dropdown {
    display: block;
}

.helix-select-search {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
}

input[type="text"].helix-select-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.6);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: #1f2937;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.helix-select-search-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 1);
}

.helix-select-search-input::placeholder {
    color: #6b7280;
}

.helix-select-options {
    max-height: 150px;
    overflow-y: auto;
}

.helix-select-no-results {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-style: italic;
    font-size: 0.875rem;
    display: none;
}

.helix-select-option {
    padding: 0.75rem 1rem;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.helix-select-option:not(:last-child) {
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.helix-select-option:hover {
    background: rgba(99, 102, 241, 0.1);
}

.helix-select-option.selected {
    background: rgba(99, 102, 241, 0.15);
    border-left: 3px solid #6366f1;
}

.helix-select-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(99, 102, 241, 0.6);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.8);
}

.helix-select-option.selected .helix-select-checkbox {
    background: #6366f1;
    border-color: #6366f1;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.helix-select-option.selected .helix-select-checkbox i {
    color: white;
    font-size: 10px;
}

.helix-select-option-text {
    flex: 1;
    font-weight: 500;
    color: #1f2937;
}

.helix-select-option-desc {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: auto;
}

/* Scrollbar styling */
.helix-select-options::-webkit-scrollbar {
    width: 6px;
}

.helix-select-options::-webkit-scrollbar-track {
    background: rgba(99, 102, 241, 0.1);
    border-radius: 3px;
}

.helix-select-options::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 3px;
}

.helix-select-options::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.7);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .helix-select-trigger {
        background: rgba(30, 30, 40, 0.9);
        border-color: rgba(99, 102, 241, 0.6);
        color: white;
    }

    .helix-select-trigger:hover {
        background: rgba(30, 30, 40, 0.95);
    }

    helix-select.open .helix-select-trigger {
        background: rgba(30, 30, 40, 0.98);
    }

    .helix-select-selected {
        color: white;
    }

    .helix-select-placeholder {
        color: rgba(255, 255, 255, 0.6);
    }

    .helix-select-dropdown {
        background: rgba(30, 30, 40, 0.98);
        border-color: rgba(99, 102, 241, 0.6);
    }

    .helix-select-search-input {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(99, 102, 241, 0.4);
        color: white;
    }

    .helix-select-search-input:focus {
        background: rgba(255, 255, 255, 0.15);
    }

    .helix-select-search-input::placeholder {
        color: rgba(255, 255, 255, 0.5);
    }

    .helix-select-option {
        color: white;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .helix-select-option-text {
        color: white;
    }

    .helix-select-option-desc {
        color: rgba(255, 255, 255, 0.7);
    }

    .helix-select-checkbox {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.4);
    }
}
