/* =========================================================
   TUTORIAL INTERACTIVO CON EFECTO SPOTLIGHT — GRUPOCASAS
   Samantha AI Interactive Guided Tour & Feature Walkthrough
   ========================================================= */

/* Bloqueo de scroll cuando el modal de bienvenida está activo */
body.gc-tut-modal-open {
  overflow: hidden !important;
}

/* =========================================================
   1. MODAL DE BIENVENIDA (Samantha Intro)
   ========================================================= */

.gc-tut-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999990;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
}

.gc-tut-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.gc-tut-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  background: #ffffff;
  border-radius: 26px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 1.75rem 1.6rem 1.2rem;
  transform: scale(0.92) translateY(15px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  overflow-x: hidden;
  color: #1e293b;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.gc-tut-overlay.is-open .gc-tut-card {
  transform: scale(1) translateY(0);
}

/* Botón Cerrar (X) */
.gc-tut-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #f8fafc;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gc-tut-close:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: scale(1.08);
}

.gc-tut-close:active {
  transform: scale(0.95);
}

/* Encabezado Bienvenida */
.gc-tut-header--intro {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 1.2rem;
}

.gc-tut-avatar-col--intro {
  flex: 0 0 130px;
  max-width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gc-tut-avatar-img {
  width: 100%;
  max-width: 130px;
  max-height: 200px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.14));
  display: block;
}

.gc-tut-intro-text {
  flex: 1;
  min-width: 0;
  padding-right: 12px;
}

.gc-tut-title {
  font-size: 1.28rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.28;
  margin: 0 0 0.55rem 0;
}

.gc-tut-highlight {
  color: #1D428A;
}

.gc-tut-desc {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.48;
  margin: 0 0 0.55rem 0;
}

.gc-tut-desc strong {
  color: #0f172a;
  font-weight: 700;
}

.gc-tut-actions--welcome {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.gc-tut-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #1D428A 0%, #2563EB 100%);
  color: #ffffff !important;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  text-decoration: none;
}

.gc-tut-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
}

.gc-tut-btn-primary:active {
  transform: scale(0.97);
}

/* Footer Bienvenida */
.gc-tut-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.85rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gc-tut-checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #64748b;
  cursor: pointer;
  user-select: none;
}

.gc-tut-checkbox-wrap input[type='checkbox'] {
  width: 15px;
  height: 15px;
  accent-color: #1D428A;
  cursor: pointer;
}

.gc-tut-skip {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 4px;
  transition: color 0.2s ease;
}

.gc-tut-skip:hover {
  color: #475569;
}

/* =========================================================
   2. OVERLAY Y EFECTO SPOTLIGHT (Enfoque en vivo)
   ========================================================= */

.gc-spotlight-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  z-index: 9999980;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.45s ease;
}

.gc-spotlight-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Halo luminoso animado sobre el botón enfocado */
.gc-spotlight-halo {
  position: absolute;
  pointer-events: none;
  border-radius: 50px;
  z-index: 9999982;
  box-shadow: 
    0 0 0 4px rgba(59, 130, 246, 0.75),
    0 0 35px rgba(59, 130, 246, 0.6),
    0 0 0 9999px rgba(2, 6, 23, 0.74);
  transition: 
    top 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    left 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 0.4s ease;
}

/* Elemento activo en el DOM (Realce y elevación tipo Emil Kowalski) */
.gc-spotlight-active-card {
  position: relative !important;
  z-index: 9999985 !important;
  transform: scale(1.025) !important;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease !important;
  box-shadow: 0 0 35px rgba(59, 130, 246, 0.55), inset 0 0 0 1.5px rgba(255, 255, 255, 0.9) !important;
  pointer-events: auto !important;
}

/* =========================================================
   3. POPOVER / TOOLTIP FLOTANTE DE SAMANTHA
   ========================================================= */

.gc-spotlight-popover {
  position: absolute;
  z-index: 9999990;
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.38),
    0 10px 25px rgba(30, 58, 138, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  padding: 1.25rem 1.35rem 1.1rem;
  color: #1e293b;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
  transform-origin: center center;
  transition: 
    top 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    left 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s ease,
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  animation: gcSpotlightPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Flecha indicadora del Popover */
.gc-spotlight-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-left: 1px solid rgba(255, 255, 255, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.85);
  transform: rotate(45deg);
  transition: left 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.gc-spotlight-popover.place-below .gc-spotlight-arrow {
  top: -8px;
}

.gc-spotlight-popover.place-above .gc-spotlight-arrow {
  bottom: -8px;
  transform: rotate(-135deg);
  border-left: 1px solid rgba(255, 255, 255, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.85);
}

/* Encabezado del Popover (Samantha Micro Avatar) */
.gc-spotlight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #f1f5f9;
}

.gc-spotlight-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gc-spotlight-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid #38BDF8;
  background: #EFF6FF;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
  flex-shrink: 0;
}

.gc-spotlight-author-info {
  display: flex;
  flex-direction: column;
}

.gc-spotlight-author-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.gc-spotlight-author-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: #2563EB;
}

.gc-spotlight-close-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gc-spotlight-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: scale(1.08);
}

.gc-spotlight-close-btn:active {
  transform: scale(0.95);
}

/* Cuerpo del Popover */
.gc-spotlight-body {
  margin-bottom: 1rem;
}

.gc-spotlight-step-badge {
  display: inline-block;
  background: rgba(37, 99, 235, 0.1);
  color: #2563EB;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.gc-spotlight-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  margin: 0 0 0.45rem 0;
}

.gc-spotlight-desc {
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

/* Tip Callout */
.gc-spotlight-tip {
  margin-top: 0.65rem;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #166534;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  line-height: 1.35;
}

/* Footer y Acciones */
.gc-spotlight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid #f1f5f9;
  gap: 10px;
}

.gc-spotlight-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.gc-spotlight-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.gc-spotlight-dot.is-active {
  width: 18px;
  border-radius: 10px;
  background: #2563EB;
}

.gc-spotlight-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gc-spotlight-btn-prev {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gc-spotlight-btn-prev:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.gc-spotlight-btn-prev:active {
  transform: scale(0.97);
}

.gc-spotlight-btn-next {
  background: linear-gradient(135deg, #1D428A 0%, #2563EB 100%);
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.gc-spotlight-btn-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.gc-spotlight-btn-next:active {
  transform: scale(0.97);
}

.gc-spotlight-btn-next.is-finish {
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.gc-spotlight-btn-next.is-finish:hover {
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
}

/* =========================================================
   4. RESPONSIVE ADAPTATIONS
   ========================================================= */

@media (max-width: 600px) {
  .gc-tut-card {
    padding: 1.4rem 1.2rem 1rem;
    border-radius: 22px;
    max-width: 95%;
  }

  .gc-tut-avatar-col--intro {
    flex: 0 0 95px;
    max-width: 95px;
  }

  .gc-tut-avatar-col--intro .gc-tut-avatar-img {
    max-width: 95px;
    max-height: 150px;
  }

  .gc-tut-title {
    font-size: 1.12rem;
  }

  .gc-tut-desc {
    font-size: 0.84rem;
  }

  .gc-spotlight-popover {
    max-width: calc(100vw - 32px);
    padding: 1.1rem 1.1rem 0.95rem;
    border-radius: 18px;
  }

  .gc-spotlight-title {
    font-size: 0.98rem;
  }

  .gc-spotlight-desc {
    font-size: 0.82rem;
  }
}
