/* ============================================================
   ESTILOS ESPECÍFICOS DEL GRABADOR Y EDITOR DE GIF / MP4
   ============================================================ */

/* Contenedor en cuadrícula de la aplicación (2 columnas o 1 columna según estado) */
.studio-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .studio-layout {
    grid-template-columns: 1fr;
  }
}

/* Tarjeta / Panel base */
.panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background-color: var(--bg-elevated);
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.panel-body {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ============================================================
   ESTADO 1: PANEL DE INICIO DE GRABACIÓN & DROPZONE
   ============================================================ */
.recorder-hero {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 2px dashed var(--border-color-hover);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.recorder-hero:hover, .recorder-hero.drag-over {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--primary-light) 100%);
  box-shadow: var(--shadow-glow);
}

.hero-icon-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 0.25rem;
  position: relative;
  animation: floatPulse 3s ease-in-out infinite;
}

@keyframes floatPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.03); }
}

.hero-text h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.hero-text p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
}

/* Configuración rápida antes de grabar */
.quick-settings-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background-color: var(--bg-main);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  max-width: 650px;
  width: 100%;
}

.quick-setting-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.quick-setting-item label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-buttons {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 400px;
  color: var(--text-subtle);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hero-divider::before, .hero-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border-color);
}

/* ============================================================
   ESTADO 2: GRABACIÓN EN CURSO (MODO LIVE / OVERLAY)
   ============================================================ */
.recording-active-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.05) 100%);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.recording-pulse-indicator {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pulse-dot {
  width: 16px;
  height: 16px;
  background-color: var(--recording-red);
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--recording-glow);
  animation: pulseDot 1.4s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.recording-timer {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.05em;
}

.recording-live-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Cuenta atrás flotante modal */
.countdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.countdown-number {
  font-family: var(--font-heading);
  font-size: 7rem;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 40px rgba(56, 189, 248, 0.6);
  animation: countZoom 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

@keyframes countZoom {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}

/* ============================================================
   ESTADO 3: EDITOR DE VÍDEO Y RECORTE (TRIMMER)
   ============================================================ */
.preview-container {
  position: relative;
  background-color: var(--bg-main);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  max-height: 540px;
  overflow: hidden;
  padding: 1.5rem;
}

/* Lienzo compuesto con fondo decorativo y marco */
.canvas-wrapper {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--transition);
}

.mockup-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  background-color: #000000;
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.mockup-header {
  height: 32px;
  background: #1e2536;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mockup-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mockup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.mockup-title {
  font-size: 0.72rem;
  color: #94a3b8;
  margin: 0 auto;
  font-family: var(--font-sans);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  max-width: 200px;
}

.video-player {
  max-width: 100%;
  max-height: 440px;
  display: block;
  object-fit: contain;
  background-color: #000000;
}

/* Línea de tiempo y recortador */
.timeline-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.35rem;
}

.timeline-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.time-badge {
  font-family: var(--font-mono);
  font-weight: 600;
  background: var(--bg-input);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.trim-duration-badge {
  color: var(--accent);
  background: var(--primary-light);
  border-color: rgba(56, 189, 248, 0.25);
}

/* Barra de línea de tiempo con controladores deslizantes */
.timeline-track-container {
  position: relative;
  height: 48px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  user-select: none;
}

.timeline-waveform-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
  opacity: 0.35;
  pointer-events: none;
}

.waveform-bar {
  width: 3px;
  border-radius: 2px;
  background-color: var(--accent);
}

.timeline-selected-range {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  right: 0%;
  background: rgba(56, 189, 248, 0.18);
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  pointer-events: none;
}

.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 2px;
  background-color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  z-index: 10;
  pointer-events: none;
}

/* Deslizadores de corte */
.trim-slider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  background: var(--accent);
  cursor: ew-resize;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.trim-slider::after {
  content: "";
  width: 2px;
  height: 16px;
  background: #ffffff;
  border-radius: 1px;
}
.trim-slider.handle-start { left: 0%; transform: translateX(0); }
.trim-slider.handle-end { right: 0%; transform: translateX(0); }

/* Controles de reproducción bajo la línea de tiempo */
.playback-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.playback-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.speed-selector-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--bg-input);
  padding: 0.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.speed-btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
}
.speed-btn:hover {
  color: var(--text-main);
}
.speed-btn.active {
  background: var(--primary);
  color: #ffffff;
}

/* ============================================================
   PANEL LATERAL: CONFIGURACIÓN DE EXPORTACIÓN Y FORMATOS
   ============================================================ */
.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

.tab-btn {
  flex: 1;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-elevated);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background-color: var(--bg-elevated);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-group label span.label-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Selector de paletas de fondo */
.bg-palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}

.palette-item {
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  position: relative;
}
.palette-item:hover {
  transform: scale(1.08);
}
.palette-item.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px var(--accent);
}

/* Barra de progreso de generación */
.export-progress-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.progress-bar-track {
  height: 10px;
  background-color: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  width: 0%;
  border-radius: 999px;
  transition: width 0.15s ease-out;
}

/* ============================================================
   SECCIÓN INFORMATIVA Y DE GUÍA (SEO & VALOR AÑADIDO)
   ============================================================ */
.seo-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}
