/* ============================================================
   Minuto Lector – Estilos del reproductor
   ============================================================ */

/* ── Variables (sobreescritas desde PHP inline) ── */
:root {
  --ml-color: #e63946;
  --ml-color-light: #e6394622;
  --ml-bg: #1a1a2e;
  --ml-text: #f0f0f0;
  --ml-muted: #aaa;
  --ml-radius: 8px;
  --ml-shadow: 0 -4px 24px rgba(0,0,0,0.25);
  --ml-transition: 0.25s ease;
}

/* ── Botón trigger dentro del artículo ── */
.minuto-lector-trigger-wrap {
  margin: 0 0 22px;
}

.minuto-lector-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--ml-color);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 9px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ml-transition), transform var(--ml-transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  letter-spacing: 0.02em;
}

.minuto-lector-trigger:hover {
  background: #c1121f;
  transform: translateY(-1px);
}

.minuto-lector-trigger.ml-active {
  background: #333;
}

/* ── Barra flotante ── */
#minuto-lector-bar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 99999;
  background: var(--ml-bg);
  color: var(--ml-text);
  box-shadow: var(--ml-shadow);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#minuto-lector-bar.ml-hidden {
  transform: translateY(120%);
}

.ml-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

/* ── Título ── */
.ml-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 160px;
  min-width: 0;
}

.ml-post-title {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ml-text);
}

/* ── Onda animada ── */
.ml-icon-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
  flex-shrink: 0;
}

.ml-icon-wave span {
  display: block;
  width: 3px;
  background: var(--ml-color);
  border-radius: 2px;
  animation: mlWave 1.2s ease-in-out infinite;
  transform-origin: bottom;
}

.ml-icon-wave span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.ml-icon-wave span:nth-child(2) { height: 14px; animation-delay: 0.1s; }
.ml-icon-wave span:nth-child(3) { height: 18px; animation-delay: 0.2s; }
.ml-icon-wave span:nth-child(4) { height: 12px; animation-delay: 0.3s; }
.ml-icon-wave span:nth-child(5) { height: 8px;  animation-delay: 0.4s; }

@keyframes mlWave {
  0%, 100% { transform: scaleY(0.4); }
  50%       { transform: scaleY(1); }
}

#minuto-lector-bar:not(.ml-playing) .ml-icon-wave span {
  animation-play-state: paused;
}

/* ── Barra de progreso ── */
.ml-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 2 1 200px;
}

.ml-progress-bar {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.15);
  border-radius: 99px;
  overflow: hidden;
}

.ml-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--ml-color);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.ml-progress-label {
  font-size: 0.75rem;
  color: var(--ml-muted);
  min-width: 34px;
  text-align: right;
}

/* ── Controles ── */
.ml-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ml-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  color: var(--ml-text);
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: background var(--ml-transition), transform var(--ml-transition);
  padding: 0;
}

.ml-btn:hover {
  background: rgba(255,255,255,0.18);
  transform: scale(1.08);
}

.ml-btn-primary {
  background: var(--ml-color) !important;
  border-color: transparent !important;
  width: 44px;
  height: 44px;
}

.ml-btn-primary:hover {
  background: #c1121f !important;
}

.ml-btn-close {
  background: transparent !important;
  border-color: transparent !important;
  color: var(--ml-muted);
}

.ml-btn-close:hover {
  color: var(--ml-text);
  background: rgba(255,255,255,0.08) !important;
}

/* ── Velocidad ── */
.ml-speed-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.ml-speed-label {
  font-size: 0.75rem;
  color: var(--ml-muted);
}

.ml-speed-select {
  background: rgba(255,255,255,0.1);
  color: var(--ml-text);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.ml-speed-select option {
  background: #1a1a2e;
  color: #f0f0f0;
}

/* ── Resaltado de párrafo activo ── */
.ml-paragraph-active {
  background-color: var(--ml-color-light) !important;
  border-left: 3px solid var(--ml-color) !important;
  padding-left: 12px !important;
  border-radius: 0 4px 4px 0 !important;
  transition: background 0.3s, border-color 0.3s;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .ml-bar-inner {
    padding: 8px 12px;
    gap: 8px;
  }
  .ml-title { flex: 1 1 100%; order: -1; }
  .ml-progress-wrap { flex: 1 1 100%; order: 0; }
  .ml-controls { order: 1; }
  .ml-speed-wrap { order: 2; }
  .ml-btn-close { order: 3; margin-left: auto; }
  .ml-post-title { font-size: 0.78rem; }
}
