/* ============================================================
   MÓDULO 2 — Vista de Cola de Turnos (Sala de Espera)
   Pantalla pública / display TV de la sala
   ============================================================ */

/* ── Page Shell ──────────────────────────────────────────── */
.queue-page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  background: var(--color-bg);
  font-family: var(--font-display);
  overflow: hidden;
}

/* ── Top Bar ─────────────────────────────────────────────── */
.queue-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 2.5rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-surface);
}

.queue-topbar-brand {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.queue-topbar-brand span {
  color: var(--color-teal);
}

.queue-topbar-clock {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--color-text-primary);
  letter-spacing: 0.05em;
  text-align: center;
}

.queue-topbar-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.queue-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-green);
  animation: pulse-live 2s ease infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

.queue-live-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Main Grid ───────────────────────────────────────────── */
.queue-main {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(460px, 1.18fr);
  gap: 0;
  overflow: hidden;
}

@media (max-width: 800px) {
  .queue-main {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .queue-now-serving {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .waiting-media-panel {
    min-height: 360px;
  }
}

/* ── NOW SERVING panel (left / primary) ─────────────────── */
.queue-now-serving {
  padding: 1.5rem 1.75rem 1.75rem 2rem;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.queue-section-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.queue-current-card {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-teal-border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  position: relative;
  overflow: hidden;
}

.queue-current-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-teal);
}

.queue-current-number {
  font-family: var(--font-mono);
  font-size: clamp(3.5rem, 8vw, 5.4rem);
  font-weight: 500;
  color: var(--color-teal);
  line-height: 1;
  letter-spacing: -0.04em;
  animation: tick-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes tick-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.queue-current-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.queue-current-service {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.queue-current-module {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.queue-current-highlight {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.38rem 0.95rem;
  background: var(--color-teal-glow);
  border: 1px solid var(--color-teal-border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--color-teal);
  font-weight: 500;
}

/* Voice/audio announcement indicator */
.queue-announce-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.75rem 1rem;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.queue-announce-waves {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
}

.queue-announce-waves span {
  display: block;
  width: 3px;
  border-radius: 99px;
  background: var(--color-teal);
  animation: wave 1.2s ease-in-out infinite;
}

.queue-announce-waves span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.queue-announce-waves span:nth-child(2) { height: 12px; animation-delay: 0.15s; }
.queue-announce-waves span:nth-child(3) { height: 18px; animation-delay: 0.3s; }
.queue-announce-waves span:nth-child(4) { height: 12px; animation-delay: 0.45s; }
.queue-announce-waves span:nth-child(5) { height: 6px;  animation-delay: 0.6s; }

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

.queue-announce-text {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  flex: 1;
}

.queue-sound-button {
  border: 1px solid var(--color-teal-border);
  border-radius: 999px;
  background: var(--color-teal-glow);
  color: var(--color-teal);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.queue-sound-button:hover {
  border-color: var(--color-teal);
}

.queue-sound-button[hidden] {
  display: none;
}

/* Recent history row */
.queue-recent-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.queue-recent-chip {
  padding: 4px 12px;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--color-text-muted);
}

/* ── QUEUE LIST panel (below current turn) ───────────────── */
.queue-list-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-raised);
}

.queue-list-header {
  padding: 1rem 1.2rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-list-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.queue-list-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.72rem 0.85rem;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  animation: slide-in-right 0.3s ease both;
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.queue-item--next {
  border-color: var(--color-teal-border);
  background: var(--color-teal-glow);
}

.queue-item-pos {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

.queue-item-number {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-text-primary);
  width: 58px;
  flex-shrink: 0;
}

.queue-item--next .queue-item-number {
  color: var(--color-teal);
}

.queue-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.queue-item-service {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Video panel (right) ─────────────────────────────────── */
.waiting-media-panel {
  min-height: 0;
  padding: 1.5rem 2rem 1.75rem 1.75rem;
  background: #101418;
  display: flex;
}

.waiting-room-video {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  background: #000;
  box-shadow: 0 18px 50px rgba(0,0,0,0.3);
}

@media (max-height: 720px) and (min-width: 801px) {
  .queue-topbar {
    padding-block: 0.7rem;
  }

  .queue-now-serving,
  .waiting-media-panel {
    padding-block: 1rem;
  }

  .queue-current-number {
    font-size: clamp(3rem, 7vw, 4.5rem);
  }
}

.queue-item-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.queue-item-vip {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-amber);
  background: var(--color-amber-glow);
  border: 1px solid var(--color-amber-border);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ── Bottom Ticker ───────────────────────────────────────── */
.queue-ticker {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  padding: 0.7rem 0;
  overflow: hidden;
  white-space: nowrap;
}

.queue-ticker-track {
  display: inline-flex;
  gap: 3rem;
  animation: ticker-scroll 30s linear infinite;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.queue-ticker-item {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.queue-ticker-item::before {
  content: '·';
  color: var(--color-teal);
  font-size: 1.2rem;
  line-height: 0;
}

/* ── Empty / Idle state ──────────────────────────────────── */
.queue-idle-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--color-text-muted);
  height: 100%;
}

.queue-idle-number {
  font-family: var(--font-mono);
  font-size: 4rem;
  color: var(--color-border-strong);
  line-height: 1;
}

.queue-idle-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
