/* App9: Línea Temporal - Estilos específicos de la app */

/* ========== IFRAME COMPATIBILITY ========== */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#app-root {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ========== CSS VARIABLES ========== */
/* Configuración de colores del timeline (override de defaults del módulo compartido) */
:root {
  --timeline-interval-color: #4A9EFF;
  --timeline-pulse-color: currentColor;
  --timeline-line-color: #666;
  --controls-offset-y: 20px;
}

[data-theme="dark"] {
  --timeline-line-color: #999;
}

/* Los estilos de timeline, pulsos, números y barras de intervalos
   están ahora en libs/app-common/timeline-intervals.css */

/* App9 requirement: only interval-number above uses temporal color */
.timeline .interval-number.above {
  color: #FFBB33;
}

/* ========== BPM INPUT ========== */
.inputs {
  display: flex;
  justify-content: center;
  padding: 30px 0 50px 30px;
  margin: 0;
}

.inputs .bpm-inline {
  position: relative;
}

/* ========== CONTROLES ========== */
.controls-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 40px;
  gap: 20px;
}

.play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: transparent;
  color: var(--selection-color, #FFBB33);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.play-btn:hover:not(:disabled) {
  background: var(--selection-color, #FFBB33);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 187, 51, 0.3);
}

.play-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.play-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.play-btn.playing {
  animation: playingPulse 1s ease-in-out infinite;
}

@keyframes playingPulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(255, 187, 51, 0.4);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 187, 51, 0.6);
  }
}

.play-btn svg {
  width: 28px;
  height: 28px;
  margin-left: 4px; /* Alineación visual del triángulo */
}

/* ========== OCULTAR BOTONES INNECESARIOS ========== */
/* App9 solo necesita el botón Play */
.controls #tapTempoBtn,
.controls #loopBtn,
.controls #randomBtn,
.controls #resetBtn {
  display: none !important;
}

/* Centrar botón Play en los controles */
.controls {
  justify-content: center !important;
}

/* ========== DURATION BAR (INTERVAL BLOCK) ========== */
.interval-block {
  position: absolute;
  top: 50%;
  height: 24px;
  background: var(--selection-color, #FFBB33);
  opacity: 0.25;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  pointer-events: none;
  z-index: 5;
  user-select: none;
  transform: translateY(-50%);
  transition-property: width, opacity;
  transition-timing-function: linear;
}

.interval-block.active {
  opacity: 0.8;
  box-shadow: 0 0 8px var(--selection-color);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .timeline-wrapper {
    max-width: 100%;
    padding: 0 15px;
    margin: 40px auto 30px;
  }

  .timeline {
    height: 100px;
  }

  .timeline .pulse {
    width: 10px;
    height: 10px;
  }

  .timeline .pulse-number {
    font-size: 2rem;
    top: calc(50% + 25px);
  }

  .timeline .interval-number {
    font-size: 2rem;
  }

  .play-btn {
    width: 56px;
    height: 56px;
  }

  .play-btn svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .timeline .pulse-number {
    font-size: 1.6rem;
    top: calc(50% + 20px);
  }

  .timeline .interval-number {
    font-size: 1.6rem;
  }

  .timeline .pulse {
    width: 8px;
    height: 8px;
  }
}
