/* download-queue-styles.css - Estilos Premium para Download Queue */

/* ==================== BADGE FLOTANTE ==================== */
#download-queue-badge {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#download-queue-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

#download-queue-badge:active {
  transform: scale(0.95);
}

.queue-badge-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.queue-icon {
  font-size: 24px;
}

.queue-count {
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* Animación pulse para cuando está descargando */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 8px 48px var(--primary), 0 8px 32px rgba(0, 0, 0, 0.4);
  }
}

/* ==================== PANEL DE COLA ==================== */
#download-queue-panel {
  position: fixed;
  top: 0;
  right: -450px;
  width: 450px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
}

.queue-panel-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ==================== HEADER ==================== */
.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-light);
}

.queue-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.queue-title-icon {
  font-size: 24px;
}

.queue-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.queue-item-count {
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.queue-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.queue-close-btn:hover {
  background: var(--surface);
  color: var(--text-primary);
}

/* ==================== CONTROLES ==================== */
.queue-controls {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-light);
}

.queue-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  font-family: inherit;
}

.queue-btn span {
  font-size: 16px;
}

.queue-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.queue-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.queue-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.queue-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.queue-btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.queue-btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
}

.queue-btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.queue-btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
}

/* ==================== PROGRESO TOTAL ==================== */
.queue-progress-total {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-light);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-current {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-percentage {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.progress-bar-container {
  height: 6px;
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 6px;
  transition: width 0.3s ease;
}

/* ==================== LISTA DE ITEMS ==================== */
.queue-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

/* Scrollbar personalizado */
.queue-items-container::-webkit-scrollbar {
  width: 8px;
}

.queue-items-container::-webkit-scrollbar-track {
  background: transparent;
}

.queue-items-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.queue-items-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Empty state */
.queue-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 40px 20px;
}

.empty-icon {
  font-size: 64px;
  opacity: 0.5;
}

.queue-empty-state p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.queue-empty-state span {
  font-size: 13px;
}

/* ==================== QUEUE ITEM ==================== */
.queue-item {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 16px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  transition: all 0.2s;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.queue-item:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  transform: translateX(-4px);
}

.queue-item.downloading {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--surface-light), rgba(var(--primary-rgb), 0.05));
}

.queue-item.completed {
  border-color: #10b981;
  opacity: 0.7;
}

.queue-item.failed {
  border-color: #ef4444;
}

/* Drag handle */
.queue-item-drag-handle {
  display: flex;
  align-items: center;
  color: var(--text-tertiary);
  font-size: 16px;
  cursor: grab;
  padding: 0 4px;
  user-select: none;
}

.queue-item-drag-handle:active {
  cursor: grabbing;
}

/* Content */
.queue-item-content {
  flex: 1;
  min-width: 0;
}

.queue-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.queue-item-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item-remove {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 18px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.queue-item-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Meta info */
.queue-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.queue-item-platform {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  background: var(--surface);
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.queue-item-size {
  font-size: 12px;
  color: var(--text-secondary);
}

.queue-item-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.queue-item-status-badge.pending {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.queue-item-status-badge.downloading {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.queue-item-status-badge.completed {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.queue-item-status-badge.failed {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Progress */
.queue-item-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.progress-bar-container-small {
  flex: 1;
  height: 4px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-small {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text-small {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  min-width: 35px;
  text-align: right;
}

/* Error */
.queue-item-error {
  margin-top: 8px;
  padding: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  font-size: 11px;
  color: #ef4444;
  word-break: break-word;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  #download-queue-panel {
    width: 100%;
    right: -100%;
  }
  
  .queue-controls {
    flex-wrap: wrap;
  }
  
  .queue-btn {
    min-width: 45%;
  }
}

/* ==================== ANIMACIONES ==================== */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==================== DARK MODE ADJUSTMENTS ==================== */
@media (prefers-color-scheme: dark) {
  .queue-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .queue-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* ==================== DOWNLOAD QUEUE - GAME ACTIONS ==================== */

.game-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.game-download-btn {
  flex: 1;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.game-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.game-download-btn:active {
  transform: translateY(0);
}

.game-queue-btn {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  min-width: 44px;
}

.game-queue-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.game-queue-btn:active {
  transform: scale(0.95);
}

.game-queue-btn span {
  font-size: 16px;
}

/* Responsive para cards más pequeñas */
@media (max-width: 768px) {
  .game-actions {
    flex-direction: column;
  }
  
  .game-queue-btn {
    min-width: 100%;
  }
}

/* ==================== PROGRESO GLOBAL ==================== */

.global-progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.progress-modal {
  background: var(--surface-dark);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  min-width: 400px;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.progress-modal h3 {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.progress-modal .download-name {
  margin: 0 0 24px 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-text {
  text-align: center;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 12px 0 8px 0;
}

.progress-details {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin: 0;
}

/* ==================== GLOBAL SEARCH LOADER ==================== */
.global-search-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.3s ease;
}

.loader-content {
  background: var(--surface);
  border-radius: 16px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loader-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border: 4px solid var(--surface-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loader-text h3 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.loader-status {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin: 10px 0;
  min-height: 24px;
}

.loader-progress-container {
  background: var(--surface-light);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 20px 0;
}

.loader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 4px;
}

.loader-details {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin: 10px 0;
}

.loader-details span {
  color: var(--primary);
  font-weight: 600;
}

.loader-hint {
  background: var(--surface-light);
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.loader-cancel-btn {
  background: var(--error);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.loader-cancel-btn:hover {
  background: #d32f2f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* ==================== ACTIVE DOWNLOADS SECTION ==================== */
.queue-section-header {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.queue-item.active-download {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
  border: 1px solid rgba(102, 126, 234, 0.3);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.queue-item.active-download .queue-item-status {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse-item {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.queue-item-completed {
  padding: 8px 16px;
  background: rgba(76, 175, 80, 0.2);
  border-radius: 4px;
  color: #4caf50;
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */
@media (max-width: 768px) {
  .progress-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ==================== FOLDER DOWNLOADS ==================== */
.folder-download {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 193, 7, 0.15));
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.folder-progress-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.folder-file-name {
  font-size: 12px;
  color: #fff;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-file-count {
  font-size: 11px;
  color: #ffb74d;
  font-family: 'Courier New', monospace;
}