/**
 * BATCH OPERATIONS MODULE STYLES
 * Styling for multi-select, bulk actions, and progress tracking
 * 
 * Features:
 * - Floating batch toolbar
 * - Checkbox styling
 * - Selected item highlighting
 * - Progress modal
 * - Modal dialogs
 * - Dark mode support
 * - Responsive design
 * 
 * @version 1.0.0
 * @date 2025-11-27
 */

/* ===== BATCH TOOLBAR ===== */
.batch-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  padding: 1rem 2rem;
}

.batch-toolbar.active {
  transform: translateY(0);
}

.batch-toolbar.hidden {
  display: none;
}

.batch-toolbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.batch-toolbar-left,
.batch-toolbar-actions,
.batch-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.batch-count {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ===== BATCH BUTTONS ===== */
.batch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.batch-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.batch-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.batch-btn-primary {
  background: #3b82f6;
  color: white;
}

.batch-btn-primary:not(:disabled):hover {
  background: #2563eb;
}

.batch-btn-secondary {
  background: white;
  color: #1f2937;
}

.batch-btn-secondary:not(:disabled):hover {
  background: #f9fafb;
}

.batch-btn-warning {
  background: #ef4444;
  color: white;
}

.batch-btn-warning:not(:disabled):hover {
  background: #dc2626;
}

.batch-btn-ghost {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.batch-btn-ghost:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.3);
}

.batch-btn-danger {
  background: #ef4444;
  color: white;
}

.batch-btn-danger:not(:disabled):hover {
  background: #dc2626;
}

/* ===== BATCH CHECKBOXES ===== */
.batch-checkbox-container {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  background: white;
  border-radius: 6px;
  padding: 0.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.batch-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: #3b82f6;
}

.batch-select-mode .student-card,
.batch-select-mode .table-row,
.batch-select-mode .list-item,
.batch-select-mode [data-student-id] {
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
}

.batch-selected {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
}

/* ===== PROGRESS MODAL ===== */
.batch-progress-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;
  display: none;
}

.batch-progress-modal.active {
  display: block;
}

.batch-progress-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.batch-progress-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.batch-progress-header {
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.batch-progress-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.batch-progress-body {
  padding: 2rem;
}

.batch-progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.batch-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.batch-progress-text {
  text-align: center;
  color: #6b7280;
  font-size: 0.9375rem;
  margin: 0 0 1rem 0;
}

.batch-progress-details {
  margin-top: 1.5rem;
}

.completion-summary {
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #3b82f6;
}

.completion-summary.success {
  background: rgba(16, 185, 129, 0.1);
  border-left-color: #10b981;
}

.completion-summary.error {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: #ef4444;
}

.completion-summary.cancelled {
  background: rgba(245, 158, 11, 0.1);
  border-left-color: #f59e0b;
}

.completion-summary p {
  margin: 0.5rem 0;
  font-size: 0.9375rem;
  color: #374151;
}

.batch-progress-footer {
  padding: 1rem 2rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ===== BATCH MODALS ===== */
.batch-affirmation-modal,
.batch-email-modal,
.batch-export-modal,
.batch-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
}

.batch-affirmation-modal.active,
.batch-email-modal.active,
.batch-export-modal.active,
.batch-confirm-modal.active {
  display: block;
}

.batch-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.batch-modal-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
}

.batch-modal-container.batch-modal-large {
  max-width: 800px;
}

.batch-modal-container.batch-modal-small {
  max-width: 400px;
}

.batch-modal-header {
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.batch-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.batch-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.batch-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.batch-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.batch-modal-footer {
  padding: 1rem 2rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ===== AFFIRMATION SELECTION ===== */
.affirmation-search {
  margin-bottom: 1.5rem;
}

.affirmation-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9375rem;
}

.affirmation-search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.affirmation-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.5rem;
}

.affirmation-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.affirmation-item:hover {
  background: #f9fafb;
}

.affirmation-checkbox {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  accent-color: #3b82f6;
}

.affirmation-name {
  flex: 1;
  font-size: 0.9375rem;
  color: #374151;
}

.affirmation-loading,
.affirmation-error {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
}

.affirmation-error {
  color: #ef4444;
}

/* ===== EMAIL COMPOSER ===== */
.email-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.form-input,
.form-select,
.form-textarea {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: #374151;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  accent-color: #3b82f6;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ===== EXPORT OPTIONS ===== */
.export-options {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ===== DARK MODE SUPPORT ===== */
[data-theme="dark"] .batch-toolbar {
  background: linear-gradient(135deg, #1e3a8a 0%, #581c87 100%);
}

[data-theme="dark"] .batch-progress-container,
[data-theme="dark"] .batch-modal-container {
  background: #1f2937;
}

[data-theme="dark"] .batch-progress-header,
[data-theme="dark"] .batch-modal-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #581c87 100%);
}

[data-theme="dark"] .batch-progress-body,
[data-theme="dark"] .batch-modal-body {
  background: #1f2937;
  color: #f9fafb;
}

[data-theme="dark"] .batch-progress-footer,
[data-theme="dark"] .batch-modal-footer {
  background: #111827;
  border-top-color: #374151;
}

[data-theme="dark"] .batch-progress-text {
  color: #d1d5db;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

[data-theme="dark"] .form-group label {
  color: #f9fafb;
}

[data-theme="dark"] .affirmation-list {
  background: #374151;
  border-color: #4b5563;
}

[data-theme="dark"] .affirmation-item:hover {
  background: #4b5563;
}

[data-theme="dark"] .affirmation-name {
  color: #f9fafb;
}

[data-theme="dark"] .completion-summary p {
  color: #d1d5db;
}

[data-theme="dark"] .checkbox-label {
  color: #d1d5db;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .batch-toolbar-content {
    gap: 1rem;
  }
  
  .batch-toolbar-left,
  .batch-toolbar-actions,
  .batch-toolbar-right {
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .batch-toolbar {
    padding: 1rem;
  }
  
  .batch-toolbar-content {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .batch-toolbar-left,
  .batch-toolbar-actions,
  .batch-toolbar-right {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .batch-count {
    text-align: center;
    width: 100%;
  }
  
  .batch-btn {
    flex: 1;
    justify-content: center;
    min-width: 120px;
  }
  
  .batch-modal-container {
    width: 95%;
    max-width: none;
  }
  
  .batch-modal-header,
  .batch-modal-body,
  .batch-modal-footer {
    padding: 1rem;
  }
  
  .batch-progress-container {
    width: 95%;
  }
}

@media (max-width: 480px) {
  .batch-btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }
  
  .batch-btn span {
    display: none;
  }
  
  .batch-toolbar-actions {
    flex-direction: column;
  }
  
  .affirmation-list {
    max-height: 300px;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .batch-toolbar,
  .batch-progress-modal,
  .batch-affirmation-modal,
  .batch-email-modal,
  .batch-export-modal,
  .batch-confirm-modal,
  .batch-checkbox-container {
    display: none !important;
  }
  
  .batch-selected {
    background: none !important;
    border-color: inherit !important;
    box-shadow: none !important;
  }
}
