/* Bulk Operations Styling */

/* Checkbox Column */
.checkbox-cell {
    width: 50px;
    padding: 0.75rem 1.5rem;
    text-align: center;
}

.checkbox-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.dark .checkbox-cell input[type="checkbox"] {
    border-color: #4b5563;
}

.checkbox-cell input[type="checkbox"]:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-cell input[type="checkbox"]:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: 50%;
    background-repeat: no-repeat;
}

.checkbox-cell input[type="checkbox"]:indeterminate {
    background-color: #3b82f6;
    border-color: #3b82f6;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2 7.5a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0zm4 0a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0zm4 0a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0z'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: 50%;
    background-repeat: no-repeat;
}

/* Row Selection Highlighting */
tbody tr.row-selected {
    background-color: #eff6ff;
    border-left: 4px solid #3b82f6;
}
.dark tbody tr.row-selected {
    background-color: rgba(30, 64, 175, 0.25);
    border-left-color: #3b82f6;
}

tbody tr.row-selected:hover {
    background-color: #dbeafe;
}

tbody input[type="checkbox"]:checked {
    pointer-events: none;
}

/* Bulk Toolbar */
.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: #f0f9ff;
    border: 2px solid #93c5fd;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}
.dark .bulk-toolbar {
    background-color: #111827;
    border-color: #1f2937;
    color: #e5e7eb;
}

.bulk-toolbar.hidden {
    display: none;
}

.bulk-toolbar.visible {
    display: flex;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
    }
}

.selected-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #1e40af;
}
.dark .selected-info { color: #93c5fd; }

.selected-info svg {
    width: 20px;
    height: 20px;
}

.selected-count {
    background-color: #3b82f6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: bold;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

/* Bulk Action Buttons */
.bulk-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bulk-action-btn svg {
    width: 16px;
    height: 16px;
}

/* Delete Button */
.bulk-delete-btn {
    background-color: #ef4444;
    color: white;
}

.bulk-delete-btn:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.bulk-delete-btn:active {
    background-color: #b91c1c;
    transform: scale(0.98);
}

.bulk-delete-btn:disabled {
    background-color: #fecaca;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Status Update Dropdown */
.bulk-status-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bulk-status-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}
.dark .bulk-status-select {
    background-color: #111827;
    color: #e5e7eb;
    border-color: #4b5563;
}

.bulk-status-select:hover {
    border-color: #9ca3af;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bulk-status-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bulk-status-btn {
    background-color: #8b5cf6;
    color: white;
}

.bulk-status-btn:hover {
    background-color: #7c3aed;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.bulk-status-btn:active {
    background-color: #6d28d9;
    transform: scale(0.98);
}

.bulk-status-btn:disabled {
    background-color: #ddd6fe;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Bulk Clear Button */
.bulk-clear-btn {
    background-color: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    padding: 0.5rem 1rem;
}

.bulk-clear-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

/* Selection Counter */
.selection-counter {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #dbeafe;
    color: #1e40af;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bulk-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .bulk-actions {
        flex-direction: column;
        margin-left: 0;
    }

    .bulk-action-btn {
        width: 100%;
        justify-content: center;
    }

    .checkbox-cell {
        width: 40px;
        padding: 0.5rem 1rem;
    }

    .checkbox-cell input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}

/* Print Styles */
@media print {
    .bulk-toolbar,
    .checkbox-cell,
    .bulk-actions {
        display: none;
    }
}

/* Accessibility */
.bulk-action-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.checkbox-cell input[type="checkbox"]:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .bulk-toolbar {
        background-color: #0f172a;
        border-color: #1e3a8a;
    }

    .selected-info {
        color: #93c5fd;
    }

    .bulk-status-select {
        background-color: #1f2937;
        color: #f3f4f6;
        border-color: #374151;
    }

    .bulk-status-select:hover {
        border-color: #4b5563;
    }

    tbody tr.row-selected {
        background-color: #082f49;
        border-left-color: #3b82f6;
    }

    tbody tr.row-selected:hover {
        background-color: #0c4a6e;
    }

    .bulk-clear-btn {
        color: #d1d5db;
        border-color: #4b5563;
    }

    .bulk-clear-btn:hover {
        background-color: #1f2937;
        border-color: #6b7280;
    }
}
