/* Bulk Category Assignment Styles */

/* Modal Enhancements */
#bulk-category-modal .modal-dialog {
    max-width: 800px;
}

#bulk-category-modal .modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
}

#bulk-category-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

#bulk-category-modal .modal-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#bulk-category-modal .close {
    color: white;
    opacity: 0.8;
    text-shadow: none;
}

#bulk-category-modal .close:hover {
    opacity: 1;
}

/* Operation Type Selection */
.btn-group-toggle .btn {
    border-radius: 8px !important;
    margin: 0 2px;
    transition: all 0.3s ease;
}

.btn-group-toggle .btn.active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-group-toggle .btn-outline-primary.active {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-color: #4CAF50;
}

.btn-group-toggle .btn-outline-warning.active {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    border-color: #ff9800;
}

.btn-group-toggle .btn-outline-danger.active {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    border-color: #f44336;
}

/* Selected Photos Preview */
.selected-photos-summary {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.selected-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.selected-photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.selected-photo-item:hover {
    transform: scale(1.05);
    border-color: rgba(102, 126, 234, 0.5);
}

.selected-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selected-photo-item .photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 0.25rem;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.selected-photo-item:hover .photo-overlay {
    opacity: 1;
}

.selected-photo-item.more-photos {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: bold;
}

.more-count {
    font-size: 1.2rem;
    line-height: 1;
}

.more-text {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Progress Section */
.progress-section {
    background: rgba(76, 175, 80, 0.1);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.progress {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #4CAF50, #45a049);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-details {
    margin-top: 0.5rem;
}

/* Results Section */
.results-section {
    background: rgba(76, 175, 80, 0.1);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.results-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    padding: 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
}

.failures-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.failures-list {
    max-height: 150px;
    overflow-y: auto;
}

.failure-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.2);
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Error Section */
.error-section {
    background: rgba(244, 67, 54, 0.1);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(244, 67, 54, 0.2);
}

/* Modal Footer */
.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 0 15px 15px;
}

.footer-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.footer-actions .btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Category Selector Integration */
#bulk-category-selector {
    min-height: 200px;
}

#bulk-category-selector .category-selector {
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

#bulk-category-selector .category-selector-display {
    padding: 1rem;
    min-height: 60px;
}

#bulk-category-selector .selected-category-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    margin: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

#bulk-category-selector .badge-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#bulk-category-selector .badge-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    #bulk-category-modal .modal-dialog {
        max-width: 95%;
        margin: 1rem;
    }
    
    .selected-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .btn-group-toggle {
        flex-direction: column;
    }
    
    .btn-group-toggle .btn {
        margin: 2px 0;
        border-radius: 8px !important;
    }
    
    .footer-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .footer-actions .btn {
        width: 100%;
    }
}

/* Animation for modal appearance */
#bulk-category-modal.fade .modal-dialog {
    transform: scale(0.8) translateY(-50px);
    transition: all 0.3s ease;
}

#bulk-category-modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

/* Loading states */
.bulk-loading {
    opacity: 0.6;
    pointer-events: none;
}

.bulk-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success/Error states */
.bulk-success {
    border-color: #4CAF50 !important;
    background: rgba(76, 175, 80, 0.1) !important;
}

.bulk-error {
    border-color: #f44336 !important;
    background: rgba(244, 67, 54, 0.1) !important;
}

/* Confirmation Modal Styles */
#confirm-modal .modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
}

#confirm-modal .modal-header {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

#confirm-modal .alert {
    border-radius: 10px;
    border: none;
    font-weight: 500;
}

#confirm-modal .btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#confirm-modal .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}