/* Tag Search Specific Styles */

/* Tag Selection Dropdown */
#tag-selection-dropdown {
    min-width: 400px;
    max-width: 600px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
}

/* Tag Selector Modal */
#tag-selector-modal {
    animation: modalEnter 0.3s ease-out;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#tag-selector-modal .bg-white {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tag Option Hover Effects */
.tag-option:hover {
    background-color: #f8fafc;
    transition: background-color 0.15s ease;
}

.tag-option input[type="checkbox"]:checked + label {
    font-weight: 500;
    color: #7c3aed;
}

/* Selected Tag Badges */
.selected-tag-badge {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
    box-shadow: 0 1px 3px rgba(139, 92, 246, 0.3);
}

.selected-tag-badge:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
}

/* Tag Group Headers */
.tag-group-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
}

/* Search Button in Dropdown */
.tag-search-button {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    transition: all 0.2s ease;
}

.tag-search-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.tag-search-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tag Results Page Enhancements */
.tag-result-card {
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.tag-result-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
    transform: translateY(-1px);
}

/* Tag Badge Styles in Results */
.tag-badge-selected {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #7c3aed;
    border: 1px solid #c4b5fd;
    font-weight: 600;
}

.tag-badge-unselected {
    background-color: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* File Type Icons */
.file-type-icon {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border: 1px solid #c4b5fd;
}

/* Action Buttons */
.tag-action-button {
    color: #8b5cf6;
    transition: color 0.15s ease;
}

.tag-action-button:hover {
    color: #7c3aed;
}

/* Empty State Styling */
.tag-empty-state {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    #tag-selection-dropdown {
        min-width: 300px;
        max-width: 95vw;
        margin: 0 auto;
    }
    
    .tag-result-card {
        margin: 0.5rem 0;
    }
    
    .tag-result-card .flex {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Animation for Tag Selection */
@keyframes tagSelected {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.tag-option input[type="checkbox"]:checked + label {
    animation: tagSelected 0.3s ease;
}

/* Loading States */
.tag-loading {
    opacity: 0.6;
    pointer-events: none;
}

.tag-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #8b5cf6;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Enhanced Tag Filters Interface */
.tag-filter-container {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tag-filter-badge {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border: 1px solid #c4b5fd;
    transition: all 0.2s ease;
}

.tag-filter-badge:hover {
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.tag-filter-badge .remove-tag {
    transition: all 0.15s ease;
    border-radius: 50%;
}

.tag-filter-badge .remove-tag:hover {
    background-color: rgba(139, 92, 246, 0.2);
    transform: scale(1.1);
}

/* Add Tags Button */
.add-tags-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
}

.add-tags-btn:hover {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Modal Styles */
.tag-selector-modal-content {
    max-height: 80vh;
    overflow: hidden;
}

.tag-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}