/**
 * Variable Injector - TributeJS Dropdown Styling
 * Matches Filament's design language
 */

/* Main dropdown container */
.tribute-container {
    position: absolute;
    z-index: 9999;
    min-width: 220px;
    max-width: 400px;
    max-height: 140px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid rgb(229 231 235); /* gray-200 */
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    margin-top: 0.25rem;
}

/* Dark mode */
.dark .tribute-container {
    background-color: rgb(31 41 55); /* gray-800 */
    border-color: rgb(55 65 81); /* gray-700 */
}

/* Dropdown list */
.tribute-container ul {
    list-style: none;
    margin: 0;
    padding: 0.25rem;
}

/* Dropdown item */
.tribute-container li {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease;
}

.tribute-container li:hover,
.tribute-container li.highlight {
    background-color: rgb(243 244 246); /* gray-100 */
}

.dark .tribute-container li:hover,
.dark .tribute-container li.highlight {
    background-color: rgb(55 65 81); /* gray-700 */
}

/* Variable item layout */
.variable-injector-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

/* Icon */
.variable-injector-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

/* Label */
.variable-injector-label {
    flex: 1;
    color: rgb(17 24 39); /* gray-900 */
    font-weight: 500;
}

.dark .variable-injector-label {
    color: rgb(243 244 246); /* gray-100 */
}

/* Group badge */
.variable-injector-group {
    flex-shrink: 0;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: rgb(229 231 235); /* gray-200 */
    color: rgb(107 114 128); /* gray-500 */
    border-radius: 9999px;
}

.dark .variable-injector-group {
    background-color: rgb(55 65 81); /* gray-700 */
    color: rgb(156 163 175); /* gray-400 */
}

/* No match message */
.variable-injector-no-match {
    padding: 0.75rem;
    text-align: center;
    color: rgb(107 114 128); /* gray-500 */
    font-size: 0.875rem;
    font-style: italic;
}

.dark .variable-injector-no-match {
    color: rgb(156 163 175); /* gray-400 */
}

/* Scrollbar styling */
.tribute-container::-webkit-scrollbar {
    width: 6px;
}

.tribute-container::-webkit-scrollbar-track {
    background: transparent;
}

.tribute-container::-webkit-scrollbar-thumb {
    background-color: rgb(209 213 219); /* gray-300 */
    border-radius: 3px;
}

.dark .tribute-container::-webkit-scrollbar-thumb {
    background-color: rgb(75 85 99); /* gray-600 */
}

/* Highlight matched text */
.tribute-container .tribute-match {
    font-weight: 700;
    color: rgb(var(--primary-600));
}

.dark .tribute-container .tribute-match {
    color: rgb(var(--primary-400));
}

/* Animation for dropdown appearance */
.tribute-container {
    animation: variable-injector-fade-in 0.15s ease-out;
}

@keyframes variable-injector-fade-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing hint - shows @ trigger info */
.enable-variable-injector::-moz-placeholder {
    color: rgb(156 163 175);
}
.enable-variable-injector::placeholder {
    color: rgb(156 163 175);
}

/* For Trix editor - ensure proper positioning */
trix-editor.enable-variable-injector + .tribute-container {
    margin-top: 0.5rem;
}

