/* ==========================================================================
   CONTROL CENTER — GUÍA INTERACTIVA (VERCEL DESIGN SYSTEM)
   Ultra-minimalista, tipografía Geist, 100% monocromo.
   - Modo Oscuro: Bordes y detalles blancos (#ffffff), fondo negro (#000000).
   - Modo Claro: Bordes y detalles negros (#000000), fondo blanco (#ffffff).
   - Borde de enfoque sutil de 1px (no exagerado), border-radius geométrico de 6px.
   ========================================================================== */

/* 1. Capa de recorte Spotlight perimétrico */
.sgi-tour-spotlight {
  position: fixed;
  z-index: 9000;
  pointer-events: none;
  border-radius: 6px;
  opacity: 0;
  box-shadow: 0 0 0 1px #ffffff, 0 0 0 9999px rgba(0, 0, 0, 0.75);
  transition: top 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
              left 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
              width 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
              height 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-radius 0.18s ease,
              opacity 0.16s ease;
}

html[data-theme="light"] .sgi-tour-spotlight {
  box-shadow: 0 0 0 1px #000000, 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

.sgi-tour-spotlight.is-on {
  opacity: 1;
}

/* 2. Tarjeta flotante Vercel / Geist */
.sgi-tour-card {
  position: fixed;
  z-index: 9010;
  width: 360px;
  max-width: min(92vw, 360px);
  background: var(--bg-surface, #000000);
  border: 1px solid var(--border-default, #333333);
  border-radius: 6px;
  padding: 16px 18px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-sans, 'Geist', -apple-system, BlinkMacSystemFont, sans-serif);
  color: var(--text-primary, #ededed);
  box-sizing: border-box;
}

html[data-theme="light"] .sgi-tour-card {
  background: #ffffff;
  border-color: var(--border-default, #eaeaea);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  color: #000000;
}

.sgi-tour-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 3. Flecha indicadora milimétrica (Rotated Square 45° con bordes nativos 1px) */
.sgi-tour-card::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--bg-surface, #000000);
  z-index: 2;
  transform: rotate(45deg);
  box-sizing: border-box;
}

html[data-theme="light"] .sgi-tour-card::before {
  background: #ffffff;
}

/* Apuntando hacia ARRIBA (cuando la tarjeta está DEBAJO del elemento) */
.sgi-tour-card[data-side='bottom']::before {
  top: -6px;
  left: calc(var(--sgi-tour-arrow-x, 50%) - 5px);
  border-top: 1px solid var(--border-default, #333333);
  border-left: 1px solid var(--border-default, #333333);
  border-bottom: none;
  border-right: none;
}

html[data-theme="light"] .sgi-tour-card[data-side='bottom']::before {
  border-top-color: #eaeaea;
  border-left-color: #eaeaea;
}

/* Apuntando hacia ABAJO (cuando la tarjeta está ARRIBA del elemento) */
.sgi-tour-card[data-side='top']::before {
  bottom: -6px;
  left: calc(var(--sgi-tour-arrow-x, 50%) - 5px);
  border-bottom: 1px solid var(--border-default, #333333);
  border-right: 1px solid var(--border-default, #333333);
  border-top: none;
  border-left: none;
}

html[data-theme="light"] .sgi-tour-card[data-side='top']::before {
  border-bottom-color: #eaeaea;
  border-right-color: #eaeaea;
}

/* Apuntando hacia la IZQUIERDA (cuando la tarjeta está a la DERECHA del elemento) */
.sgi-tour-card[data-side='right']::before {
  left: -6px;
  top: 22px;
  border-bottom: 1px solid var(--border-default, #333333);
  border-left: 1px solid var(--border-default, #333333);
  border-top: none;
  border-right: none;
}

html[data-theme="light"] .sgi-tour-card[data-side='right']::before {
  border-bottom-color: #eaeaea;
  border-left-color: #eaeaea;
}

/* Apuntando hacia la DERECHA (cuando la tarjeta está a la IZQUIERDA del elemento) */
.sgi-tour-card[data-side='left']::before {
  right: -6px;
  top: 22px;
  border-top: 1px solid var(--border-default, #333333);
  border-right: 1px solid var(--border-default, #333333);
  border-bottom: none;
  border-left: none;
}

html[data-theme="light"] .sgi-tour-card[data-side='left']::before {
  border-top-color: #eaeaea;
  border-right-color: #eaeaea;
}

.sgi-tour-card[data-side='center']::before,
.sgi-tour-card[data-side='mobile']::before {
  display: none;
}

/* 4. Cabecera limpia Vercel */
.sgi-tour-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sgi-tour-card__step {
  font-family: var(--font-mono, 'Geist Mono', monospace);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary, #666666);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

html[data-theme="light"] .sgi-tour-card__step {
  color: #888888;
}

.sgi-tour-card__skip {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-tertiary, #666666);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: color 0.15s ease;
  font-family: inherit;
}

html[data-theme="light"] .sgi-tour-card__skip {
  color: #888888;
}

.sgi-tour-card__skip:hover {
  color: var(--text-primary, #ededed);
  text-decoration: underline;
}

html[data-theme="light"] .sgi-tour-card__skip:hover {
  color: #000000;
}

/* 5. Tipografía de contenido (Plana, sin contenedores adicionales) */
.sgi-tour-card__title {
  margin: 0 0 6px 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary, #ededed);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

html[data-theme="light"] .sgi-tour-card__title {
  color: #000000;
}

.sgi-tour-card__desc {
  margin: 0 0 14px 0;
  font-size: 13px;
  color: var(--text-secondary, #888888);
  line-height: 1.55;
}

html[data-theme="light"] .sgi-tour-card__desc {
  color: #666666;
}

/* 6. Barra micro-progreso (Monocromo Vercel: blanco en dark, negro en light) */
.sgi-tour-card__track {
  height: 2px;
  background: var(--border-subtle, #222222);
  border-radius: 999px;
  margin-bottom: 12px;
  overflow: hidden;
}

html[data-theme="light"] .sgi-tour-card__track {
  background: #eaeaea;
}

.sgi-tour-card__fill {
  height: 100%;
  background: #ffffff;
  border-radius: 999px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="light"] .sgi-tour-card__fill {
  background: #000000;
}

/* 7. Footer de navegación */
.sgi-tour-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.sgi-tour-card__hint {
  font-family: var(--font-mono, 'Geist Mono', monospace);
  font-size: 10.5px;
  color: var(--text-tertiary, #666666);
}

html[data-theme="light"] .sgi-tour-card__hint {
  color: #888888;
}

.sgi-tour-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 8. Botones nativos Vercel */
.sgi-tour-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  outline: none;
  white-space: nowrap;
}

.sgi-tour-btn:active {
  transform: scale(0.98);
}

.sgi-tour-btn--ghost {
  background: transparent;
  color: var(--text-secondary, #888888);
  border: 1px solid var(--border-default, #333333);
}

html[data-theme="light"] .sgi-tour-btn--ghost {
  color: #666666;
  border-color: #eaeaea;
}

.sgi-tour-btn--ghost:hover {
  color: var(--text-primary, #ededed);
  border-color: var(--text-primary, #ededed);
  background: var(--bg-hover, #1a1a1a);
}

html[data-theme="light"] .sgi-tour-btn--ghost:hover {
  color: #000000;
  border-color: #000000;
  background: #f5f5f5;
}

.sgi-tour-btn--primary {
  background: var(--btn-primary-bg, #ffffff);
  color: var(--btn-primary-text, #000000);
  border: 1px solid var(--btn-primary-bg, #ffffff);
}

html[data-theme="light"] .sgi-tour-btn--primary {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

.sgi-tour-btn--primary:hover {
  background: var(--btn-primary-hover, #cccccc);
  border-color: var(--btn-primary-hover, #cccccc);
}

html[data-theme="light"] .sgi-tour-btn--primary:hover {
  background: #222222;
  border-color: #222222;
}

/* 9. Enlace sutil en el pie de página */
.v-footer-link {
  background: none;
  border: none;
  color: var(--text-tertiary, #666666);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s ease;
}

.v-footer-link:hover {
  color: var(--text-primary, #ededed);
  text-decoration: underline;
}

html[data-theme="light"] .v-footer-link {
  color: #888888;
}

html[data-theme="light"] .v-footer-link:hover {
  color: #000000;
}

/* 10. Dispositivos móviles (Acoplado inferior limpio) */
@media (max-width: 640px) {
  .sgi-tour-card {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sgi-tour-spotlight,
  .sgi-tour-card,
  .sgi-tour-card__fill {
    transition: none !important;
    animation: none !important;
  }
}
