/**
 * Download Queue UI Styles
 */

/* Queue Button */
.queue-btn {
  position: relative;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.queue-btn:hover {
  background: #334155;
  border-color: #475569;
}

.queue-icon {
  font-size: 20px;
}

.queue-badge {
  display: none;
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: bold;
  min-width: 20px;
  text-align: center;
}

/* Queue Panel */
.queue-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.queue-panel.hidden {
  display: none;
}

.queue-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.queue-content {
  position: relative;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #334155;
}

.queue-header h2 {
  margin: 0;
  font-size: 20px;
  color: #f1f5f9;
}

.queue-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.queue-close:hover {
  color: #f1f5f9;
}

/* Stats */
.queue-stats {
  display: flex;
  gap: 16px;
  padding: 16px 24px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.queue-stats .stat {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 14px;
}

.queue-stats .stat b {
  color: #0ea5e9;
  font-size: 16px;
}

/* Actions */
.queue-actions {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid #334155;
  flex-wrap: wrap;
}

.queue-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

.btn-primary:hover {
  background: #0284c7;
}

.btn-secondary {
  background: #334155;
  color: #f1f5f9;
}

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

/* Queue List */
.queue-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.queue-empty {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
  font-size: 16px;
}

/* Queue Item */
.queue-item {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.queue-item:hover {
  border-color: #475569;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.item-status {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-priority {
  font-size: 12px;
  padding: 4px 8px;
  background: #334155;
  border-radius: 4px;
}

.item-info {
  margin-bottom: 12px;
}

.item-url {
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 4px;
  word-break: break-all;
}

.item-title {
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 500;
}

/* Progress Bar */
.item-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #334155;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #06b6d4);
  transition: width 0.3s;
}

.progress-text {
  font-size: 12px;
  color: #cbd5e1;
  min-width: 40px;
  text-align: right;
}

/* Error */
.item-error {
  background: #7f1d1d;
  border: 1px solid #991b1b;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 12px;
  color: #fca5a5;
  font-size: 13px;
}

/* Actions */
.item-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.item-actions button {
  background: #334155;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.item-actions button:hover {
  background: #475569;
  border-color: #64748b;
}

/* Time */
.item-time {
  color: #64748b;
  font-size: 11px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #334155;
}

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

.queue-list::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 4px;
}

.queue-list::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.queue-list::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
  .queue-content {
    width: 95%;
    max-height: 90vh;
  }

  .queue-stats {
    flex-wrap: wrap;
  }

  .queue-actions {
    flex-direction: column;
  }

  .queue-actions button {
    width: 100%;
  }
}
