/* round-editor-styles.css - Estilos para las nuevas funcionalidades de edición */

/*
  JERARQUÍA DE Z-INDEX PARA EVITAR CONFLICTOS:
  
  100-499   : Elementos base (timeline, waveforms)
  500-999   : Modales laterales (video player lateral = 500)
  1000-1999 : Tooltips y overlays de edición
  9000-9999 : Loading overlays y spinners
  10000+    : Modales importantes de sistema (download assistant, etc)
  
  NOTA: Mantener estos valores consistentes en todos los archivos JS
*/

/* Botón de sobreescritura destacado */
.btn.btn-info {
  background: linear-gradient(45deg, #4a90e2, #357abd);
  /* Animación pulse eliminada para mejor UX */
}

/* Indicador de modo edición */
.editing-mode-indicator {
  position: fixed;
  top: 80px;
  right: 20px;
  background: rgba(74, 144, 226, 0.95);
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  z-index: 1001;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.5);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Editor de sequences - Modal mejorado */
.modal-content {
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  position: sticky;
  top: 0;
  background: #2d2d2d;
  z-index: 10;
  padding: 10px 0;
  margin: -10px 0 20px 0;
}

/* Cards de sequences en el editor */
#sequencesEditorContainer .card {
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

#sequencesEditorContainer .card:hover {
  border-left-color: #C6EA32;
  transform: translateX(5px);
}

/* Inputs del editor de sequences */
#sequencesEditorContainer input[type="text"] {
  font-family: 'Courier New', monospace;
  background: rgba(0, 0, 0, 0.4);
}

#sequencesEditorContainer input[type="text"]:focus {
  border-color: #C6EA32;
  box-shadow: 0 0 10px rgba(198, 234, 50, 0.3);
}

/* Botones de acción en rounds */
.card-header button {
  white-space: nowrap;
}

/* Badge de estado de sequences */
.sequences-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  margin-left: 5px;
}

.sequences-badge.valid {
  background: rgba(76, 175, 80, 0.3);
  color: #4caf50;
  border: 1px solid #4caf50;
}

.sequences-badge.invalid {
  background: rgba(255, 152, 0, 0.3);
  color: #ff9800;
  border: 1px solid #ff9800;
}

/* Tooltips informativos */
.info-tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted #C6EA32;
}

.info-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  color: #C6EA32;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 12px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Validación visual en inputs */
input.valid-input {
  border-color: #4caf50 !important;
}

input.invalid-input {
  border-color: #ff5252 !important;
}

/* Contador de sequences */
.sequences-counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(198, 234, 50, 0.1);
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: bold;
  color: #C6EA32;
}

/* Botón de cancelar edición */
.cancel-edit-btn {
  background: linear-gradient(45deg, #ff6b6b, #ff8e53);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.cancel-edit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Loading spinner para operaciones largas */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(198, 234, 50, 0.2);
  border-top-color: #C6EA32;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Resaltado de round en edición */
.card.editing-round {
  border: 2px solid #4a90e2;
  background: rgba(74, 144, 226, 0.1);
  box-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
}

/* Mensajes de ayuda */
.help-message {
  background: rgba(139, 195, 74, 0.1);
  border-left: 3px solid #8bc34a;
  padding: 12px 15px;
  border-radius: 5px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.6;
}

.help-message strong {
  color: #C6EA32;
}

/* Botón compacto para lista */
.btn-compact {
  padding: 6px 12px;
  font-size: 12px;
  margin: 2px;
}

/* Grid responsive para botones */
@media (max-width: 768px) {
  .card-header {
    flex-direction: column;
    align-items: stretch !important;
  }
  
  .card-header > div:last-child {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  
  .card-header button {
    flex: 1 1 auto;
    min-width: 120px;
  }
}

/* Iconos de estado */
.status-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: 5px;
}

.status-icon.valid {
  background: #4caf50;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.status-icon.warning {
  background: #ff9800;
  box-shadow: 0 0 8px rgba(255, 152, 0, 0.5);
}

.status-icon.error {
  background: #ff5252;
  box-shadow: 0 0 8px rgba(255, 82, 82, 0.5);
}

/* Separador visual */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(198, 234, 50, 0.3), transparent);
  margin: 20px 0;
}

/* Destacado de pattern editado */
.pattern-highlight {
  background: rgba(198, 234, 50, 0.05);
  border: 1px solid rgba(198, 234, 50, 0.2);
  padding: 8px;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

/* Botón de acción principal */
.btn-primary-action {
  background: linear-gradient(45deg, #C6EA32, #8BC34A);
  font-size: 16px;
  padding: 12px 24px;
  box-shadow: 0 4px 15px rgba(198, 234, 50, 0.3);
}

.btn-primary-action:hover {
  box-shadow: 0 6px 20px rgba(198, 234, 50, 0.5);
  transform: translateY(-3px);
}

/* Scroll suave para contenedores */
#sequencesEditorContainer {
  scroll-behavior: smooth;
}

#sequencesEditorContainer::-webkit-scrollbar {
  width: 8px;
}

#sequencesEditorContainer::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

#sequencesEditorContainer::-webkit-scrollbar-thumb {
  background: rgba(198, 234, 50, 0.5);
  border-radius: 10px;
}

#sequencesEditorContainer::-webkit-scrollbar-thumb:hover {
  background: rgba(198, 234, 50, 0.8);
}

/* Animación de guardado exitoso */
@keyframes saveSuccess {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
  }
  100% {
    transform: scale(1);
  }
}

.save-success {
  animation: saveSuccess 0.5s ease-out;
}

/* Mejoras de accesibilidad */
.btn:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #C6EA32;
  outline-offset: 2px;
}

/* Dark mode mejorado para inputs */
input[type="text"],
input[type="number"] {
  color: #fff;
}

input[type="text"]::placeholder,
input[type="number"]::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Mejora de contraste para textos */
.card-subtitle {
  color: #b0b0b0;
}

/* Estado deshabilitado */
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ========================================
   LISTA DE GOLPES - NO PISAR TIMELINE
   ======================================== */

/* Contenedor de lista de golpes */
#sequencesList {
  margin-top: 20px;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 15px;
}

/* Scrollbar personalizado */
#sequencesList::-webkit-scrollbar {
  width: 8px;
}

#sequencesList::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

#sequencesList::-webkit-scrollbar-thumb {
  background: rgba(198, 234, 50, 0.5);
  border-radius: 10px;
}

#sequencesList::-webkit-scrollbar-thumb:hover {
  background: rgba(198, 234, 50, 0.8);
}

/* Cards de golpes en la lista */
#sequencesList .card {
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s;
}

#sequencesList .card:hover {
  background: rgba(198, 234, 50, 0.1);
  transform: translateX(5px);
}

/* Asegurar que la lista no sea muy ancha */
#sequencesList .card-header {
  flex-wrap: wrap;
  gap: 10px;
}

/* Estado vacío de la lista */
#sequencesList .empty-state {
  text-align: center;
  padding: 30px;
  opacity: 0.5;
  font-style: italic;
}

/* ========================================
   MULTI-VIDEO MANAGER - LISTA DE VIDEOS
   ======================================== */

/* Sección de videos cargados */
#loaded-videos-section {
  margin-top: 20px;
}

/* Grid de videos */
.loaded-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

/* Card de video individual */
.video-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(198, 234, 50, 0.2);
  border-radius: 10px;
  padding: 15px;
  transition: all 0.3s;
  cursor: pointer;
}

.video-card:hover {
  background: rgba(198, 234, 50, 0.08);
  border-color: rgba(198, 234, 50, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(198, 234, 50, 0.2);
}

.video-card-active {
  background: rgba(198, 234, 50, 0.15);
  border-color: #C6EA32;
  box-shadow: 0 0 20px rgba(198, 234, 50, 0.3);
}

.video-card-active:hover {
  transform: translateY(0);
}

/* Header del card */
.video-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.video-icon {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
}

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

.video-name {
  font-weight: bold;
  color: #C6EA32;
  font-size: 15px;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-stats {
  font-size: 12px;
  color: #888;
  line-height: 1.6;
}

/* Acciones del card */
.video-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(198, 234, 50, 0.1);
}

.active-badge {
  background: linear-gradient(45deg, #C6EA32, #8BC34A);
  color: #000;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Contador de videos */
#video-count {
  color: #C6EA32;
  font-weight: bold;
}

/* Estado vacío */
.loaded-videos-grid .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  opacity: 0.5;
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .loaded-videos-grid {
    grid-template-columns: 1fr;
  }
  
  .video-card-actions {
    flex-wrap: wrap;
  }
  
  .video-card-actions button {
    flex: 1;
    min-width: 100px;
  }
}

/* Animación de carga */
@keyframes videoCardAppear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.video-card {
  animation: videoCardAppear 0.3s ease-out;
}

/* Highlight al pasar el mouse */
.video-card-active .video-icon {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

