/* ScriptFlow Teleprompter by Vladware - self-contained CSS (no CDN) */

.vladware-scriptflow,
.vladware-scriptflow * {
  box-sizing: border-box;
}

.vsf-app {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: #111827;
  background: #ffffff;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;

  /* Keep footer pinned at the bottom even when there are no scripts */
  display: flex;
  flex-direction: column;
  min-height: 80vh;
}

.vsf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.vsf-title {
  margin: 0;
  padding: 0;

  font-family: Oswald, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  font-weight: inherit;
  line-height: 1.2;
  font-size: 20px;
  margin: 0;
}

.vsf-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin: 2px 0 0 0;
}

.vsf-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Busy indicator for imports */
.vsf-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.vsf-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(17, 24, 39, .18);
  border-top-color: rgba(17, 24, 39, .75);
  border-radius: 999px;
  animation: vsf-spin 900ms linear infinite;
}

@keyframes vsf-spin {
  to {
    transform: rotate(360deg);
  }
}

.vsf-btn {
  border: 1.2px solid #868686;
  background: #ffffff;
  color: #111827;
  border-radius: 5px;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.vsf-btn:hover {
  background: #334155;
  border: 1.2px solid #334155;
  color: #ffffff;
}

.vsf-btn:active {
  transform: translateY(1px);
}

.vsf-btn.primary {
  background: #0073e6;
  border: 1.2px solid #0073e6;
  color: #ffffff;
  transition: background-color 120ms ease, color 120ms ease;
}

.vsf-btn.primary:hover {
  background: #334155;
  border: 1.2px solid #334155;

}

.vsf-btn.danger {
  background: #334155;
  border: 1.2px solid #334155;
  color: #ffffff;
  transition: background-color 120ms ease, color 120ms ease;
}

.vsf-btn.danger:hover {
  background: #991b1b;
  border: 1.2px solid #991b1b;
}

.vsf-main {
  padding: 16px;
  flex: 1;
}

.vsf-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.vsf-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 1px 10px rgba(0, 0, 0, .04);
}

.vsf-card h3 {
  margin: 0 0 6px 0;
  font-size: 14px;
}

.vsf-meta {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 10px;
}

.vsf-card .vsf-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.vsf-empty {
  padding: 28px 8px;
  text-align: center;
  color: #6b7280;
}

.vsf-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.vsf-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
}

.vsf-input,
.vsf-textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.vsf-textarea {
  min-height: 260px;
  resize: vertical;
  line-height: 1.5;
}

.vsf-input:focus,
.vsf-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.vsf-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

/* Prompter immersive overlay */
.vsf-prompter-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
}

/* Top bar full width con glass */
.vsf-prompter-topbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2147483003;

  background: rgba(20, 23, 28, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  border-bottom: 1px solid rgba(255,255,255,.10);
  padding: 10px 14px;
  box-sizing: border-box;
}

/* Contenedor interno alineado a 1080px */
.vsf-prompter-topbar-inner{
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vsf-prompter-topbar-inner .vsf-title{
  margin: 0;          /* elimina márgenes del h1 */
  line-height: 1;     /* evita que se vea más alto que los botones */
  display: block;
}

.vsf-topbar-left{
  display: flex;
  align-items: center;
  gap: 12px;

  flex: 1 1 auto;   /* CLAVE: ocupa el espacio y empuja el botón derecho */
  min-width: 0;     /* CLAVE: permite ellipsis */
}

.vsf-topbar-right{
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

/* Título del guión en el TopBar del prompter */
.vsf-prompter-topbar-inner .vsf-prompter-title{
  margin: 0;
  padding: 0;

  flex: 1 1 auto;
  min-width: 0;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  font-family: inherit;
  font-weight: inherit;
  font-size: 15px;
  line-height: 1.2;   /* CLAVE para centrado óptico */

  color: rgba(255,255,255,.90);

  display: block;
}

/* Botones top bar */
.vsf-topbar-actions{
  display:flex;
  align-items:center;
  gap: 10px;
}

.vsf-topbar-btn{
  height: 40px;
  border-radius: 999px;
  padding: 0 8px;

  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);

  color: rgba(255,255,255,.92);
  font-weight: 800;
  font-size: 13px;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;

  cursor: pointer;
}

.vsf-topbar-btn:hover{
  background: rgba(255,255,255,.14);
}

.vsf-topbar-btn svg{
  display:block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Salir: sutilmente más visible */
.vsf-topbar-btn-exit{
  background: rgba(255,255,255,.10);
}
.vsf-topbar-btn-exit:hover{
  background: rgba(255,255,255,.16);
}

.vsf-prompter-scroll {
  position: relative;
  flex: 1;
  overflow: auto;
  scroll-behavior: auto;

  /* Ancho de columna (por defecto 42%) controlado por slider */
  --vsf-width: 42%;

  /* padding lateral = (100% - ancho)/2  */
  padding-left: 24px;
  padding-right: 24px;

  /* Créditos tipo cine (entrada/salida) */
  padding-top: 90vh;
  padding-bottom: calc(90vh + 130px);
  /* incluye espacio extra por controles */
}

/* Si por alguna razón no hay controles, usamos solo el padding cinematográfico */
.vsf-prompter-scroll:not(.with-controls) {
  padding-bottom: 90vh;
}

.vsf-prompter-text {
  max-width: var(--vsf-width, 980px);
  width: 100%;
  margin: 0 auto;
  font-size: 48px;
  line-height: 1.25;
  letter-spacing: 0.2px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.vsf-prompter-controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147483001;

  /* Espacio respecto al borde inferior de la pantalla */
  padding: 14px 14px;

  box-sizing: border-box;
  pointer-events: none;
  /* clave: para que solo el dock reciba clicks */
}

.vsf-dock {
  /* max-width: 1080px;  <-- removed to let it shrink */
  width: fit-content;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;

  /* Glass / floating capsule */
  background: rgba(20, 23, 28, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;

  padding: 14px 16px;

  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);

  pointer-events: auto;
  /* vuelve clicable el dock */
}

.vsf-dock-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.vsf-sliders {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px 16px;
}

@media (min-width: 920px) {
  .vsf-sliders {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
  }
}

.vsf-slider {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vsf-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  font-weight: 700;
}

.vsf-slider-value {
  color: rgba(255, 255, 255, .9);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  font-size: 12px;
}

.vsf-dock-hint {
  max-width: auto;
  margin: 8px auto 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: .9;
}

.vsf-hint {
  margin-left: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
}

/* Botones */
.vsf-icon-btn,
.vsf-mini-btn {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .92);
  border-radius: 999px;
  height: 40px;
  min-width: 40px;
  padding: 0 8px;
  font-weight: 800;
  cursor: pointer;
}

.vsf-icon-btn:hover,
.vsf-mini-btn:hover {
  background: rgba(255, 255, 255, .14);
}

/* Botón principal de Play/Pause */
.vsf-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #196ee6;
  border: 1px solid rgba(25, 110, 230, .6);
  color: #fff;
  border-radius: 999px;
  height: 46px;
  min-width: 46px;
  padding: 0 10px;
  font-weight: 900;
  cursor: pointer;
}

/* Iconos: por defecto muestra Play */
.vsf-play-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vsf-ico-pause {
  display: none;
}

/* Cuando está reproduciendo: muestra Pause */
.vsf-is-playing .vsf-ico-play {
  display: none;
}

.vsf-is-playing .vsf-ico-pause {
  display: inline-flex;
}

/* Asegurar que el SVG hereda el color del botón */
.vsf-play-btn svg {
  fill: currentColor;
}

.vsf-play-btn {
  transition:
    transform 120ms ease-out,
    filter 120ms ease-out;
}

.vsf-play-btn:hover {
  filter: brightness(1.03);
  /* se mantiene */
  transform: scale(0.90);
  /* reduce un tantico */
}

.vsf-mini-btn {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  font-weight: 900;
  font-size: 14px;
}

.vsf-mini-btn.is-active {
  background: rgba(25, 110, 230, .25);
  border-color: rgba(25, 110, 230, .55);
  color: #fff;
}

.vsf-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(520px, 100%);
  flex: 1;
}

.vsf-control label {
  font-size: 12px;
  color: rgba(255, 255, 255, .78);
  font-weight: 700;
  width: 110px;
}

.vsf-kbd {
  font-size: 12px;
  color: rgb(118, 118, 118);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  padding: 4px 8px;
}

.vsf-hidden {
  display: none !important;
}

.vsf-prompter-spacer {
  height: 90vh;
  width: 100%;
  pointer-events: none;
}



/* Mirror mode: flip vertically (teleprompter mirror) */
.vsf-mirrored .vsf-prompter-text {
  transform: scaleY(-1);
  transform-origin: center;
}

/* Small screens */
@media (max-width: 600px) {
  .vsf-prompter-text {
    font-size: 34px;
  }

  .vsf-control label {
    width: 90px;
  }

  /* Popovers full width mobile */
  .vsf-dock {
    position: relative; /* Contexto de posicionamiento */
  }

  .vsf-dock .vsf-pop {
    position: static; /* Para que el popover tome el dock como referencia */
  }

  .vsf-dock .vsf-popover {
    width: 100%;
    left: 0;
    transform: translateY(6px); /* Solo mov vertical */
    bottom: calc(100% + 14px);
  }
  
  .vsf-dock .vsf-pop.is-open .vsf-popover {
    transform: translateY(0);
  }
}

/* ===========================
   Sliders (range) más finos y pro
   =========================== */

/* Valores recomendados (ajusta 1-2px si quieres) */
:root {
  --vsf-track-h: 6px;
  /* altura de la barra (más estrecha) */
  --vsf-thumb: 18px;
  /* tamaño del circulito (2-3px más grande) */
  --vsf-track-bg: rgba(255, 255, 255, .20);
  /* gris medio, más claro que el dock */
  --vsf-fill: #196ee6;
  /* color del progreso (tu azul) */
  --vsf-thumb-border: rgba(255, 255, 255, .95);
  /* borde blanco */
}

/* Reseteo base */
.vsf-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  /* clave para estilo consistente */
  height: var(--vsf-thumb);
  cursor: pointer;
}

/* ===========================
   WEBKIT (Chrome/Edge/Safari)
   =========================== */

/* Track */
.vsf-range::-webkit-slider-runnable-track {
  height: var(--vsf-track-h);
  background: var(--vsf-track-bg);
  border-radius: 999px;
}

/* Thumb */
.vsf-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--vsf-thumb);
  height: var(--vsf-thumb);
  border-radius: 999px;
  background: var(--vsf-fill);
  border: 2px solid var(--vsf-thumb-border);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .25);
  margin-top: calc((var(--vsf-track-h) - var(--vsf-thumb)) / 2);
  /* centra el thumb */
}

/* ===========================
   FIREFOX
   =========================== */

.vsf-range::-moz-range-track {
  height: var(--vsf-track-h);
  background: var(--vsf-track-bg);
  border-radius: 999px;
}

.vsf-range::-moz-range-thumb {
  width: var(--vsf-thumb);
  height: var(--vsf-thumb);
  border-radius: 999px;
  background: var(--vsf-fill);
  border: 2px solid var(--vsf-thumb-border);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .25);
}

/* Quitar borde interno raro de Firefox */
.vsf-range::-moz-focus-outer {
  border: 0;
}

/* ===========================
   Estados (opcional)
   =========================== */
.vsf-range:focus-visible {
  outline: none;
}

.vsf-range:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(25, 110, 230, .28), 0 6px 14px rgba(0, 0, 0, .25);
}

.vsf-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vsf-pop {
  position: relative;
}

.vsf-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vsf-tool-btn svg { fill: none; }

/* Popover wrapper: solo posiciona y anima */
.vsf-popover{
  position: absolute;
  bottom: calc(100% + 25px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 240px;

  /* IMPORTANTE: el padding se mueve al panel interno */
  padding: 0;

  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease-out, transform 120ms ease-out;
  z-index: 2147483005;
}

/* Estado abierto */
.vsf-pop.is-open .vsf-popover{
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.vsf-popover-panel{
  padding: 12px 12px 10px 12px;

  background: rgba(20, 23, 28, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;

  box-shadow:
    0 18px 40px rgba(0,0,0,.40),
    inset 0 1px 0 rgba(255,255,255,.12);
}

.vsf-pop-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;

  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  font-weight: 800;
}

.vsf-pop-value {
  font-size: 12px;
  color: rgba(255, 255, 255, .92);
  letter-spacing: 0;
  text-transform: none;
}

.vsf-align-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Los SVG de mini-botones heredan color */
.vsf-mini-btn svg {
  fill: currentColor;
  display: block;
}

.vsf-icon-btn svg,
.vsf-mini-btn svg {
  fill: none;
  /* CLAVE: evita relleno */
  stroke: currentColor;
  /* hereda color del botón */
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

/* Alineación: iconos centrados dentro del popover */
.vsf-pop-align .vsf-align-row{
  display: flex;
  justify-content: center; /* centra el grupo */
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* Línea guía horizontal */
.vsf-guide-line{
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  z-index: 2147482000;
  pointer-events: none;

  height: 1.5px;
  background: linear-gradient(
    to right,
    transparent,
    #0977e587,
    transparent
  );
}

/* Etiquetas GUÍA */
.vsf-guide-label{
  position: absolute;
  top: -10px;

  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;

  color: #0977e587;
}

.vsf-guide-label.left{
  left: 12px;
}

.vsf-guide-label.right{
  right: 12px;
  padding-right: 15px;
}

/* ===========================
   Mobile compact dock (<= 600px)
   =========================== */
@media (max-width: 600px) {
  /* Reduce overall bottom safe padding so the dock fits better */
  .vsf-prompter-controls {
    padding: 10px 10px;
  }

  /* Make the dock use full available width and tighten spacing */
  .vsf-dock {
    width: 100%;
    max-width: 100%;
    gap: 8px;
    padding: 10px 10px;
    border-radius: 10px;
  }

  /* Compact buttons */
  .vsf-icon-btn,
  .vsf-mini-btn,
  .vsf-play-btn {
    height: 32px;
    min-width: 32px;
    padding: 0 4px;
  }

  /* Slightly smaller icons */
  .vsf-dock svg {
    width: 20px;
    height: 20px;
  }

  /* Tighten group spacing if present */
  .vsf-dock-group {
    gap: 8px;
  }

  /* Compact slider styling inside popovers */
  :root {
    --vsf-track-h: 5px;
    --vsf-thumb: 16px;
  }

  .vsf-popover-panel {
    padding: 10px 10px;
  }

  .vsf-pop-title {
    font-size: 11px;
  }

  .vsf-pop-value {
    font-size: 12px;
  }

  /* Guide labels smaller */
  .vsf-guide-label{
    font-size: 7px; /* 9px - 2px */
  }

  .vsf-guide-label.right{
    padding-right: 0; /* quitar padding solo en móvil */
  }

  .vsf-header .vsf-actions{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }
  
  .vsf-header .vsf-title{
  gap: 25px; /* ajusta: 8px, 12px, 16px según gusto */
  }

  @media (max-width: 600px){
  /* Header en columna (título arriba, acciones abajo) */
  .vsf-header{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  /* Acciones: en línea y a la izquierda */
  .vsf-header .vsf-actions{
    width: 100%;
    display: flex;
    flex-direction: row;      /* <-- clave: en línea */
    justify-content: flex-start; 
    align-items: center;
    margin-top: 20px;
    gap: 10px;
    flex-wrap: wrap;          /* por si no cabe en pantallas muy pequeñas */
  }
}

}

/* Fin de ScriptFlow CSS */