/**
 * Keyword Tags Input Styles
 * Interactive tag-style input for keywords with positive/negative support
 */

/* Wrapper */
.keyword-tags-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Tags Container */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    min-height: 3rem;
    cursor: text;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tags-container:focus-within {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Individual Tag */
.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    transition: all 0.15s ease;
    animation: tagFadeIn 0.2s ease;
}

@keyframes tagFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Positive Keywords (Triggers) */
.keyword-tag.positive {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.keyword-tag.positive:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
}

/* Negative Keywords (Exclude) */
.keyword-tag.negative {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fb7185;
}

.keyword-tag.negative:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: rgba(244, 63, 94, 0.5);
}

.keyword-tag.negative .prefix {
    opacity: 0.6;
    margin-right: 0.125rem;
}

/* Tag Text */
.keyword-tag .text {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Remove Button */
.keyword-tag .remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin-left: 0.25rem;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    transition: opacity 0.15s, background 0.15s;
}

.keyword-tag .remove:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

/* Tag Input */
.tag-input {
    flex: 1;
    min-width: 120px;
    padding: 0.25rem 0;
    border: none;
    background: transparent;
    color: white;
    font-size: 0.875rem;
    outline: none;
}

.tag-input::placeholder {
    color: rgba(156, 163, 175, 0.6);
}

/* Shake Animation for duplicates */
.tags-container.shake {
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Help Text */
.keyword-help {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.8;
}

/* Compact variant for smaller spaces */
.keyword-tags-wrapper.compact .tags-container {
    padding: 0.5rem;
    min-height: 2.5rem;
}

.keyword-tags-wrapper.compact .keyword-tag {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
}

/* Dark theme adjustments (default is dark) */
.keyword-tags-wrapper.light .tags-container {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.keyword-tags-wrapper.light .tag-input {
    color: #1f2937;
}

.keyword-tags-wrapper.light .tag-input::placeholder {
    color: rgba(107, 114, 128, 0.6);
}
