/**
 * Batch Processing Page Styles
 * AIWatermark - Batch watermarking and verification interface
 */

/* Reset and Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f8fafc;
  color: #1f2937;
  line-height: 1.6;
}

/* Container */
.batch-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: calc(100vh - 4rem);
}

.batch-content {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

/* Header */
.batch-header {
  text-align: left;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.batch-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.batch-subtitle {
  color: #6b7280;
  font-size: 1rem;
}

/* Tier Message */
.tier-message {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #fbbf24;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.tier-message-content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.tier-message-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.tier-message h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #92400e;
}

.tier-message p {
  color: #78350f;
  margin-bottom: 1rem;
}

/* Tabs */
.batch-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
  flex: 1;
  padding: 1rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: #f9fafb;
  color: #1f2937;
}

.tab-btn.active {
  color: #475569;
  border-bottom-color: #475569;
  background: #f9fafb;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Strength Selector */
.strength-selector-container {
  max-width: 800px;
  margin: 0 auto 2rem;
}

.strength-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.strength-option {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.strength-option:hover {
  border-color: #3b82f6;
}

.strength-option input[type="radio"] {
  margin-right: 0.75rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.strength-option input[type="radio"]:checked {
  accent-color: #3b82f6;
}

.strength-option:has(input:checked) {
  border-color: #3b82f6;
  background: #eff6ff;
}

.strength-option-content {
  flex: 1;
}

.strength-option-title {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.25rem;
}

.strength-option-desc {
  font-size: 0.875rem;
  color: #6b7280;
}

/* Upload Section */
.upload-section {
  margin-bottom: 2rem;
}

.upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 0.75rem;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f9fafb;
}

.upload-zone:hover {
  border-color: #475569;
  background: white;
}

.upload-zone.drag-over {
  border-color: #475569;
  background: #f0f4ff;
  border-style: solid;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.upload-zone h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1f2937;
}

.upload-zone p {
  color: #6b7280;
  margin-bottom: 1rem;
}

.upload-formats {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.upload-formats strong {
  color: #1f2937;
  margin: 0 0.25rem;
}

.upload-limit {
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Watermark Input */
.watermark-input-group {
  margin-top: 1.5rem;
}

.watermark-input-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1f2937;
}

.watermark-input-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.2s;
}

.watermark-input-group input:focus {
  outline: none;
  border-color: #475569;
  box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.1);
}

/* File Grid */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.file-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  background: white;
  transition: all 0.2s;
}

.file-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.file-card-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.file-card-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.file-card-size {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.file-card-remove {
  background: #fee2e2;
  color: #991b1b;
  border: none;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.file-card-remove:hover {
  background: #fecaca;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.btn-primary,
.btn-secondary {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: #475569;
  color: white;
}

.btn-primary:hover {
  background: #334155;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(71, 85, 105, 0.3);
}

.btn-primary:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Progress Section */
.progress-section {
  margin-bottom: 2rem;
}

.progress-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}

.overall-progress {
  margin-bottom: 2rem;
}

.progress-bar-container {
  max-width: 600px;
  margin: 0 auto;
}

.progress-bar-track {
  height: 1.5rem;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #475569 0%, #334155 100%);
  border-radius: 9999px;
  transition: width 0.3s ease;
  min-width: 0;
}

/* Shimmer animation while a GPU job is actively running */
@keyframes batchShimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.progress-bar-fill.active {
  background: linear-gradient(90deg, #334155 0%, #475569 35%, #64748b 50%, #475569 65%, #334155 100%);
  background-size: 300% 100%;
  animation: batchShimmer 2s linear infinite;
  min-width: 8px; /* always show a sliver so bar isn't empty */
}

/* Highlight the file currently being processed */
.queue-item.processing-now {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #6b7280;
}

/* File Queue */
.file-queue {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}

.queue-item-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.queue-item-info {
  flex: 1;
  min-width: 0;
}

.queue-item-name {
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-status {
  font-size: 0.875rem;
  color: #6b7280;
}

.queue-item-progress {
  width: 100%;
  height: 0.5rem;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.queue-item-progress-fill {
  height: 100%;
  background: #475569;
  transition: width 0.3s ease;
}

/* Status Badges */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.status-pending {
  background: #f3f4f6;
  color: #6b7280;
}

.status-badge.status-processing {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.status-success {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.status-error {
  background: #fee2e2;
  color: #991b1b;
}

/* Results Section */
.results-section {
  text-align: center;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
}

.results-header {
  margin-bottom: 2rem;
}

.results-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #065f46;
}

.results-summary {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
}

.results-summary-item {
  display: flex;
  flex-direction: column;
}

.results-summary-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
}

.results-summary-label {
  color: #6b7280;
}

/* Verification Summary */
.verification-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.verification-stat {
  background: white;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}

.verification-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.verification-stat-value.detected {
  color: #065f46;
}

.verification-stat-value.not-detected {
  color: #991b1b;
}

.verification-stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Verification Details */
.verification-details {
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: left;
}

.verification-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.verification-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.verification-item-icon {
  font-size: 1.5rem;
}

.verification-item-title {
  flex: 1;
  font-weight: 600;
  color: #1f2937;
}

.verification-item-details {
  padding-left: 2.25rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.verification-item-row {
  display: flex;
  margin-bottom: 0.25rem;
}

.verification-item-label {
  font-weight: 500;
  min-width: 120px;
  color: #374151;
}

.verification-item-value {
  color: #6b7280;
}

/* Export Buttons */
.export-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .batch-content {
    padding: 1rem;
  }

  .batch-header h1 {
    font-size: 1.5rem;
  }

  .batch-tabs {
    flex-direction: column;
  }

  .tab-btn {
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .tab-btn.active {
    border-left-color: #475569;
    border-bottom-color: transparent;
  }

  .upload-zone {
    padding: 2rem 1rem;
  }

  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .results-summary {
    flex-direction: column;
    gap: 1rem;
  }

  .export-buttons {
    flex-direction: column;
  }

  .export-buttons button {
    width: 100%;
  }
}
