/* Modo Presentación CVS — product tour profesional */
.avs-presentation {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
}

.avs-presentation[hidden] {
  display: none !important;
}

/* Blur + oscurecimiento; el hueco se corta vía clip-path (JS) para dejar el target nítido */
.avs-presentation-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(2, 10, 8, 0.42);
  -webkit-backdrop-filter: blur(5px) saturate(0.92);
  backdrop-filter: blur(5px) saturate(0.92);
  transition: opacity 0.3s ease, background 0.3s ease;
}

html.avs-presentation-blur-full .avs-presentation-backdrop {
  background: rgba(2, 10, 8, 0.5);
  -webkit-backdrop-filter: blur(6px) saturate(0.9);
  backdrop-filter: blur(6px) saturate(0.9);
}

@media (prefers-reduced-motion: reduce) {
  .avs-presentation-backdrop {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(2, 10, 8, 0.55);
  }
}

.avs-presentation-spotlight {
  position: fixed;
  z-index: 401;
  border-radius: 20px;
  box-shadow: 0 0 0 2px rgba(140, 220, 180, 0.9), 0 12px 36px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  transition:
    top 0.28s ease,
    left 0.28s ease,
    width 0.28s ease,
    height 0.28s ease,
    opacity 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .avs-presentation-spotlight {
    transition: none;
  }
}

/* Panel: header / body scrollable / footer estable */
.avs-presentation-panel {
  position: absolute;
  z-index: 402;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  max-height: min(72vh, 560px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(165deg, rgba(7, 26, 20, 0.98), rgba(4, 16, 12, 0.97));
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
  color: #eef8f3;
  width: min(380px, calc(100vw - 28px));
  left: 20px;
  bottom: 24px;
  overflow: hidden;
  transition: left 0.3s ease, right 0.3s ease, bottom 0.3s ease, width 0.3s ease;
}

.avs-presentation-panel-header {
  flex: 0 0 auto;
  padding: 14px 16px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.avs-presentation-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 16px 8px;
  overscroll-behavior: contain;
}

.avs-presentation-panel-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
}

.avs-presentation-actions-secondary,
.avs-presentation-actions-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.avs-presentation-actions-primary {
  margin-left: auto;
}

.avs-presentation-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.avs-presentation-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9fe8bc;
  font-weight: 800;
}

.avs-presentation-live {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #081f17;
  background: #b8f0d0;
  border-radius: 999px;
  padding: 4px 10px;
}

.avs-presentation-host-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avs-presentation-voice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6a8f7c;
}

.avs-presentation-voice-dot[data-voice='thinking'] {
  background: #e0c56a;
  animation: avs-pulse 1.1s ease-in-out infinite;
}

.avs-presentation-voice-dot[data-voice='speaking'] {
  background: #50e7b2;
  animation: avs-speak 0.9s ease-in-out infinite;
}

.avs-presentation-voice-dot[data-voice='muted'] {
  background: #6b7280;
}

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

@keyframes avs-speak {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(80, 231, 178, 0.45);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(80, 231, 178, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .avs-presentation-voice-dot[data-voice='thinking'],
  .avs-presentation-voice-dot[data-voice='speaking'],
  .avs-presentation-panel {
    animation: none;
    transition: none;
  }
}

.avs-presentation-voice-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(210, 236, 220, 0.9);
}

.avs-presentation-panel h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.avs-presentation-script {
  margin: 0;
  color: #cfe3d8;
  font-size: 14.5px;
  line-height: 1.5;
  min-height: 3em;
}

.avs-presentation-progress {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.avs-presentation-progress span {
  font-size: 12px;
  font-weight: 700;
  color: rgba(210, 236, 220, 0.85);
}

.avs-presentation-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.avs-presentation-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #50e7b2, #b4f5d5);
  transition: width 0.2s ease;
}

.avs-btn {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-weight: 800;
  cursor: pointer;
  color: #eef8f3;
  background: rgba(255, 255, 255, 0.05);
  white-space: nowrap;
  flex: 0 0 auto;
}

.avs-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.avs-btn:focus-visible {
  outline: 2px solid #9fe8bc;
  outline-offset: 2px;
}

.avs-btn-primary {
  background: #eef8f3;
  color: #081f17;
  border-color: transparent;
  min-width: 9.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.avs-btn-ghost:hover:not(:disabled),
.avs-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* Cordobéz Presenter */
html.avs-presentation-focus-cordobez .cordobez-widget,
html.avs-presentation-focus-cordobez .cordobez-launcher,
html.avs-presentation-active .cordobez-widget.avs-presentation-host {
  z-index: 420 !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: none;
}

html.avs-presentation-active .cordobez-widget.avs-presentation-host .cordobez-launcher {
  pointer-events: auto;
}

html.avs-presentation-host-hero .cordobez-widget.avs-presentation-host {
  left: auto;
  right: max(18px, calc(50% - 300px));
  bottom: 118px;
  width: 180px;
  transform: scale(1.1);
  transform-origin: bottom right;
}

html.avs-presentation-host-side .cordobez-widget.avs-presentation-host {
  left: auto;
  right: 22px;
  bottom: 132px;
  width: 148px;
  transform: scale(1);
  transform-origin: bottom right;
}

html.avs-presentation-host-compact .cordobez-widget.avs-presentation-host {
  left: auto;
  right: 18px;
  bottom: 128px;
  width: 128px;
  transform: scale(0.9);
  transform-origin: bottom right;
}

html[data-avs-presenter-dock='left'] .cordobez-widget.avs-presentation-host,
html.avs-presentation-active .cordobez-widget.avs-presentation-host[data-avs-dock='left'] {
  left: 22px;
  right: auto;
  transform-origin: bottom left;
}

html[data-avs-presenter-dock='right'] .cordobez-widget.avs-presentation-host,
html.avs-presentation-active .cordobez-widget.avs-presentation-host[data-avs-dock='right'] {
  left: auto;
  right: 22px;
  transform-origin: bottom right;
}

html.avs-presentation-active .cordobez-widget.avs-presentation-host[data-state='speaking'] .cordobez-face {
  filter: drop-shadow(0 0 14px rgba(80, 231, 178, 0.35));
}

@media (max-width: 720px) {
  .avs-presentation-panel-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .avs-presentation-actions-primary {
    margin-left: 0;
  }

  .avs-presentation-actions-primary .avs-btn-primary {
    width: 100%;
  }

  html.avs-presentation-host-hero .cordobez-widget.avs-presentation-host,
  html.avs-presentation-host-side .cordobez-widget.avs-presentation-host,
  html.avs-presentation-host-compact .cordobez-widget.avs-presentation-host {
    right: 12px;
    left: auto;
    bottom: 220px;
    transform: scale(0.88);
  }
}
