/* ==========================================================
   TELEPROMPTER PROFESIONAL DE ENTREVISTAS
   ========================================================== */

.teleprompter-card {
  background: #080c14;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Modo Tarjeta Completa en el Cockpit (Single Screen) */
.teleprompter-card.full-screen-card {
  height: 100%;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.teleprompter-card.full-screen-card .teleprompter-viewport {
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 2rem 2.5rem;
  align-items: flex-start;
}

.teleprompter-card.full-screen-card .teleprompter-content-column {
  max-width: 820px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.teleprompter-card.full-screen-card .teleprompter-placeholder {
  margin: auto 0;
}

/* Barra superior de herramientas del teleprompter */
.teleprompter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.teleprompter-badge-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.teleprompter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #60a5fa;
}

.teleprompter-stats {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.teleprompter-stats span {
  color: var(--text-secondary);
  font-weight: 600;
}

.teleprompter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.font-size-group {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 2px 6px;
  gap: 4px;
}

.font-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.font-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.font-size-label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  min-width: 32px;
  text-align: center;
}

.btn-tool {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tool:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-tool.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

/* Área de Lectura del Teleprompter */
.teleprompter-viewport {
  padding: 2.5rem 2rem;
  display: flex;
  justify-content: center;
  min-height: 260px;
  max-height: 520px;
  overflow-y: auto;
  position: relative;
  background: #080c14;
}

/* Scrollbar personalizado súper discreto */
.teleprompter-viewport::-webkit-scrollbar {
  width: 6px;
}
.teleprompter-viewport::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.teleprompter-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Ancho óptimo de lectura (680px - 760px) centrado */
.teleprompter-content-column {
  max-width: 740px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Texto de la respuesta en Teleprompter */
.teleprompter-text {
  font-size: 26px; /* Ajustable dinámicamente */
  line-height: 1.6;
  font-weight: 500;
  color: #f8fafc;
  letter-spacing: -0.01em;
  text-rendering: optimizeLegibility;
  font-family: var(--font-sans);
  word-spacing: 0.04em;
  white-space: pre-wrap;
  transition: font-size 0.15s ease-out;
}

/* Efecto de resaltado suave al leer */
.teleprompter-text p {
  margin-bottom: 1rem;
}

/* Estado Vacío / Esperando */
.teleprompter-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  color: var(--text-muted);
  padding: 3rem 1rem;
}

.placeholder-icon {
  width: 48px;
  height: 48px;
  opacity: 0.4;
  color: var(--accent-primary);
}

.teleprompter-placeholder p {
  font-size: 1.05rem;
  max-width: 440px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .teleprompter-footer-bar {
    display: none !important;
  }
}

/* Barra de progreso de lectura inferior */
.teleprompter-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: rgba(10, 14, 23, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================
   MODO LECTURA LIMPIO / PANTALLA COMPLETA (FOCUS MODE)
   ========================================================== */
body.teleprompter-focus-mode {
  overflow: hidden;
}

body.teleprompter-focus-mode .app-header,
body.teleprompter-focus-mode .interview-status-bar,
body.teleprompter-focus-mode .controls-card,
body.teleprompter-focus-mode .question-card,
body.teleprompter-focus-mode .main-content > *:not(#interview-tab) {
  display: none !important;
}

body.teleprompter-focus-mode .main-content {
  padding: 0;
  max-width: 100vw;
  height: 100vh;
}

body.teleprompter-focus-mode .interview-layout {
  max-width: 100vw;
  height: 100vh;
  gap: 0;
}

body.teleprompter-focus-mode .teleprompter-card {
  height: 100vh;
  border-radius: 0;
  border: none;
  background: #05080f;
}

body.teleprompter-focus-mode .teleprompter-viewport {
  height: calc(100vh - 110px);
  max-height: none;
  padding: 3.5rem 2rem 2rem 2rem;
  align-items: flex-start;
}

body.teleprompter-focus-mode .teleprompter-text {
  font-size: 32px;
  line-height: 1.7;
}

/* Floating Exit Button for Focus Mode */
.focus-mode-exit-btn {
  display: none;
}

body.teleprompter-focus-mode .focus-mode-exit-btn {
  display: inline-flex;
}

/* ==========================================================
   RESPUESTA EN VIVO — REDISEÑO
   ========================================================== */
.teleprompter-placeholder h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.teleprompter-placeholder p {
  font-size: 0.98rem;
  color: var(--text-secondary);
  max-width: 460px;
  line-height: 1.6;
}

.teleprompter-placeholder kbd {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 6px;
  padding: 1px 7px;
}

.tp-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #93c5fd;
  background: radial-gradient(circle at 30% 20%, rgba(37, 99, 235, 0.35), rgba(37, 99, 235, 0.08) 70%);
  border: 1px solid rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 40px rgba(37, 99, 235, 0.18);
  margin-bottom: 4px;
}

.tp-answer {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  width: 100%;
  animation: tpFadeUp 0.25s ease-out;
}

.tp-answer[hidden],
.tp-thinking[hidden],
.tp-meta[hidden],
.tp-question[hidden] {
  display: none;
}

.tp-question {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid var(--accent-secondary);
  border-radius: 12px;
  padding: 12px 16px;
}

.tp-question-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fdba74;
  margin-bottom: 4px;
}

.tp-question p {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-secondary);
  font-style: italic;
  overflow-wrap: anywhere;
}

.tp-thinking {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 1rem;
  padding: 6px 2px;
}

.tp-dots {
  display: inline-flex;
  gap: 5px;
}

.tp-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #f97316);
  animation: tpBounce 1s infinite ease-in-out;
}

.tp-dots i:nth-child(2) { animation-delay: 0.15s; }
.tp-dots i:nth-child(3) { animation-delay: 0.3s; }

.teleprompter-text {
  white-space: normal;
  position: relative;
  padding-left: 18px;
  border-left: 3px solid rgba(37, 99, 235, 0.55);
  font-weight: 500;
  line-height: 1.55;
  color: #f8fafc;
}

.teleprompter-text:empty {
  display: none !important;
}

.teleprompter-text .tp-line {
  margin: 0 0 0.55em;
}

.teleprompter-text .tp-line:last-child {
  margin-bottom: 0;
}

.teleprompter-text.is-final {
  border-left-color: var(--accent-success);
}

.teleprompter-text.is-error {
  border-left-color: var(--accent-danger);
}

.tp-error {
  font-size: 1rem;
  color: #fca5a5;
  font-weight: 500;
}

.tp-caret {
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.12em;
  border-radius: 2px;
  background: var(--accent-secondary);
  animation: tpBlink 0.9s steps(1) infinite;
}

.tp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tp-meta-fast {
  color: #34d399;
  font-weight: 700;
}

.tp-meta-sep {
  opacity: 0.5;
}

@keyframes tpBlink {
  50% { opacity: 0; }
}

@keyframes tpBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-6px); opacity: 1; }
}

@keyframes tpFadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .tp-answer { gap: 0.8rem; }
  .tp-question { padding: 8px 12px; }
  .tp-question p { font-size: 0.85rem; }
  .teleprompter-text { padding-left: 12px; }
  .tp-empty-icon { width: 48px; height: 48px; border-radius: 14px; }
  .tp-empty-icon svg { width: 22px; height: 22px; }
  .teleprompter-placeholder h3 { font-size: 0.98rem; }
  .teleprompter-placeholder p { font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-dots i, .tp-caret, .tp-answer { animation: none; }
}

.tp-meta-profile {
  color: #fdba74;
}

/* ==========================================================
   CELULAR: barra del teleprompter sin desbordes y avisos compactos
   ========================================================== */
@media (max-width: 900px) {
  .teleprompter-toolbar {
    flex-wrap: wrap;
    row-gap: 6px;
    column-gap: 8px;
    padding: 6px 10px;
  }

  .teleprompter-badge-group {
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
  }

  .teleprompter-stats,
  .teleprompter-stats span {
    white-space: nowrap;
  }

  .teleprompter-controls {
    gap: 6px;
    flex: 0 1 auto;
    margin-left: auto;
    max-width: 100%;
  }

  .teleprompter-controls .btn-tool span {
    display: none;
  }

  .teleprompter-controls .btn-tool {
    padding: 0 9px;
    min-width: 34px;
    height: 30px;
    justify-content: center;
  }

  .font-size-group {
    flex-shrink: 0;
  }

  /* Avisos: arriba, anchos al contenido y sin tapar el teleprompter */
  .toast-container {
    top: calc(max(4px, env(safe-area-inset-top)) + 58px);
    bottom: auto;
    left: 10px;
    right: 10px;
    align-items: center;
    gap: 6px;
  }

  .toast {
    width: auto;
    max-width: 100%;
    padding: 8px 12px;
    font-size: 0.78rem;
    line-height: 1.35;
    gap: 8px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
  }

  .toast-icon {
    flex-shrink: 0;
  }
}

@media (max-width: 380px) {
  .teleprompter-tag {
    font-size: 0.64rem;
  }

  .teleprompter-stats {
    font-size: 0.64rem;
  }

  .font-btn {
    width: 24px;
  }
}
