/**
 * Tag Input Styles
 * Beautiful tag input component for admin forms
 * 
 * @version 1.0.0
 */

/* Tag Input Container */
.tag-input-container {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
    min-height: 120px;
    transition: all 0.2s ease;
}

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

/* Tag Input Header */
.tag-input-header {
    margin-bottom: 12px;
}

.tag-input-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
    display: block;
}

/* Tags Display Area */
.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
    padding: 8px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 12px;
}

.tags-display.empty {
    justify-content: center;
    align-items: center;
    color: #9ca3af;
    font-size: 13px;
}

/* Individual Tag */
.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #3b82f6;
    color: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    animation: tagSlideIn 0.2s ease;
}

.tag-item:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Tag Remove Button */
.tag-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: white;
    transition: all 0.2s ease;
    padding: 0;
}

.tag-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Tag Input Field */
.tag-input-field {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.tag-input-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tag-input-field::placeholder {
    color: #9ca3af;
}

/* Tag Counter */
.tag-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.tag-count {
    font-weight: 600;
    color: #3b82f6;
}

/* Remove All Button */
.btn-remove-all-tags {
    background: #ef4444;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove-all-tags:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-remove-all-tags:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

/* Animations */
@keyframes tagSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.tag-item.removing {
    animation: tagSlideOut 0.2s ease forwards;
}

/* Responsive */
@media (max-width: 576px) {
    .tag-input-container {
        padding: 10px;
    }
    
    .tags-display {
        gap: 6px;
        padding: 6px;
    }
    
    .tag-item {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .tag-input-container {
        background: #1f2937;
        border-color: #374151;
    }
    
    .tags-display {
        background: #111827;
    }
    
    .tag-input-field {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .tag-input-label,
    .tag-counter {
        color: #9ca3af;
    }
}

/* Tag Input Wrapper (for relative positioning) */
.tag-input-wrapper {
    position: relative;
}

/* Suggestions Dropdown */
.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    animation: suggestionsSlideIn 0.15s ease;
}

/* Suggestion Item */
.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: #eff6ff;
    color: #2563eb;
}

.suggestion-item.selected {
    font-weight: 500;
}

/* Suggestions Scrollbar */
.tag-suggestions::-webkit-scrollbar {
    width: 6px;
}

.tag-suggestions::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.tag-suggestions::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.tag-suggestions::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

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

/* Dark Mode for Suggestions */
@media (prefers-color-scheme: dark) {
    .tag-suggestions {
        background: #1f2937;
        border-color: #374151;
    }

    .suggestion-item {
        color: #d1d5db;
        border-bottom-color: #374151;
    }

    .suggestion-item:hover,
    .suggestion-item.selected {
        background: #374151;
        color: #60a5fa;
    }
}
