/* Queue UI Styles */

.queue-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  color: white;
}

.queue-header h3 {
  margin: 0;
  font-size: 1.4em;
  font-weight: 600;
}

.queue-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.queue-btn-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.queue-btn-refresh:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.queue-btn-refresh svg {
  margin: 0;
}

/* Empty state styling */
.queue-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: white;
  opacity: 0.8;
}

.empty-icon {
  margin-bottom: 15px;
}

.queue-empty-state h4 {
  margin: 0 0 8px 0;
  font-size: 1.1em;
  font-weight: 500;
}

.queue-empty-state p {
  margin: 0;
  font-size: 0.9em;
  opacity: 0.7;
}

/* Progress bar styling for queue jobs */
.queue-progress-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.queue-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.queue-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.queue-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.queue-progress-info .chunks-info {
  font-size: 0.8em;
  opacity: 0.8;
}

.queue-stats {
  font-size: 0.9em;
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 15px;
}

.queue-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.queue-job {
  background: white;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.queue-job:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.queue-job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.queue-job-status {
  font-weight: 600;
  font-size: 0.85em;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
}

.queue-job-queued .queue-job-status {
  background: #fff3cd;
  color: #856404;
}

.queue-job-processing .queue-job-status {
  background: #d1ecf1;
  color: #0c5460;
  animation: pulse 1.5s ease-in-out infinite;
}

.queue-job-complete .queue-job-status {
  background: #d4edda;
  color: #155724;
}

.queue-job-failed .queue-job-status {
  background: #f8d7da;
  color: #721c24;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.queue-job-mode {
  font-size: 0.8em;
  color: #666;
  background: #f0f0f0;
  padding: 3px 8px;
  border-radius: 10px;
}

.queue-job-id {
  font-size: 0.75em;
  color: #999;
  font-family: monospace;
}

.queue-job-text {
  color: #333;
  margin: 10px 0;
  line-height: 1.5;
  font-size: 0.95em;
}

.queue-job-meta {
  display: flex;
  gap: 15px;
  font-size: 0.8em;
  color: #666;
  margin: 10px 0;
  flex-wrap: wrap;
}

.queue-job-meta span {
  background: #f5f5f5;
  padding: 3px 8px;
  border-radius: 8px;
}

.queue-job-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.queue-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.queue-btn-play {
  background: #28a745;
  color: white;
}

.queue-btn-play:hover {
  background: #218838;
  transform: translateY(-1px);
}

.queue-btn-download {
  background: #007bff;
  color: white;
}

.queue-btn-download:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.queue-btn-delete {
  background: #dc3545;
  color: white;
}

.queue-btn-delete:hover {
  background: #c82333;
  transform: translateY(-1px);
}

.queue-actions {
  display: flex;
  justify-content: flex-end;
}

.queue-btn-clear {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.queue-btn-clear:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

/* Queue Mode Toggle */
.queue-mode-toggle {
  margin: 15px 0;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px dashed #dee2e6;
}

.queue-mode-toggle label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
}

.queue-mode-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  cursor: pointer;
  accent-color: #667eea;
}

.queue-mode-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #495057;
}

.queue-mode-label svg {
  color: #667eea;
}

.queue-info {
  margin-top: 10px;
  padding: 10px;
  background: #e7f1ff;
  border-left: 4px solid #667eea;
  border-radius: 4px;
  font-size: 0.9em;
  color: #004085;
}

/* Scrollbar styling for queue list */
.queue-list::-webkit-scrollbar {
  width: 8px;
}

.queue-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.queue-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.queue-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Responsive design */
@media (max-width: 768px) {
  .queue-container {
    padding: 15px;
  }
  
  .queue-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .queue-job-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .queue-job-meta {
    flex-direction: column;
    gap: 5px;
  }
  
  .queue-job-actions {
    width: 100%;
  }
  
  .queue-btn {
    flex: 1;
    justify-content: center;
  }
}

/* Animation for new jobs */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.queue-job {
  animation: slideIn 0.3s ease;
}
