/* =============================================
   DEMO AVACONT — Estilos específicos del tour
   ============================================= */

/* ── Welcome overlay ── */
#demo-welcome {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
  text-align: center;
  padding: 24px;
  transition: opacity 0.8s ease;
}
#demo-welcome.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Animaciones de entrada escalonada estilo Apple */
#demo-welcome img,
#demo-welcome h1,
#demo-welcome p,
#demo-welcome .demo-features,
#demo-welcome .btn2 {
  opacity: 0;
  transform: translateY(16px);
  animation: welcomeFadeUp 0.9s ease forwards;
}
#demo-welcome img           { animation-delay: 0.1s; }
#demo-welcome h1            { animation-delay: 0.35s; }
#demo-welcome p             { animation-delay: 0.55s; }
#demo-welcome .demo-features{ animation-delay: 0.75s; }
#demo-welcome .btn2         { animation-delay: 1s; }

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

#demo-welcome img {
  width: 140px;
  margin-bottom: 32px;
  filter: brightness(0) invert(1);
}
#demo-welcome h1 {
  font-size: 2.6rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: #fff;
  letter-spacing: -0.02em;
}
#demo-welcome p {
  font-size: 1rem;
  width: 50%;
  margin: 0 0 36px;
  line-height: 1.7;
  color: #fff;
}
#demo-welcome .demo-features {
  display: flex;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Demo banner ── */
#demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  background: linear-gradient(90deg, #0029ff, #6c5ce7);
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  display: none;
}
#demo-banner i { font-size: 0.85rem; }
#demo-banner a {
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
}
body.demo-active {
  padding-top: 36px;
}

/* ── Highlight de elemento del tour ── */
.demo-step-highlight {
  outline: 3px solid #0029ff !important;
  outline-offset: 5px !important;
  border-radius: 10px !important;
  box-shadow: 0 0 0 6px rgba(0,41,255,0.12) !important;
  position: relative;
  z-index: 998 !important;
  transition: outline 0.3s, box-shadow 0.3s;
}

.modal .demo-step-highlight,
#notif-main-panel.demo-step-highlight {
  outline-offset: 0 !important;
}



/* Los modales del recorrido siempre caben en el viewport. El shell conserva
   sus esquinas y únicamente el contenido interno hace scroll. */
#notifDrawerOverlay {
  padding: 24px;
}







/* ── Tooltip del tour ── */
#demo-tooltip {
  position: fixed;
  background: #fff;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  width: min(300px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  min-width: 260px;
  z-index: 10002;
  border: 1px solid rgba(0,41,255,0.1);
  animation: tooltipIn 0.25s ease;
}
@keyframes tooltipIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.demo-tooltip-step {
  font-size: 0.7rem;
  font-weight: 700;
  color: #0029ff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.demo-tooltip-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #020031;
  margin-bottom: 8px;
  line-height: 1.3;
}
.demo-tooltip-body {
  font-size: 0.82rem;
  color: #555;
  line-height: 1.5;
  margin-bottom: 16px;
}
.demo-tooltip-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.demo-tooltip-skip {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: #999;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.2s;
}
.demo-tooltip-skip:hover { color: #555; }
.demo-tooltip-next {
  background: #0029ff;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.demo-tooltip-next:hover {
  background: #001fcc;
  transform: translateY(-1px);
}
.demo-tooltip-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 1px solid rgba(0,41,255,0.1);
  transform: rotate(45deg);
}
.demo-tooltip-arrow.arrow-top {
  top: -7px;
  left: 50%;
  margin-left: -6px;
  border-right: none;
  border-bottom: none;
}
.demo-tooltip-arrow.arrow-bottom {
  bottom: -7px;
  left: 50%;
  margin-left: -6px;
  border-left: none;
  border-top: none;
}
.demo-tooltip-arrow.arrow-left {
  left: -7px;
  top: 50%;
  margin-top: -6px;
  border-right: none;
  border-top: none;
}
.demo-tooltip-arrow.arrow-right {
  right: -7px;
  top: 50%;
  margin-top: -6px;
  border-left: none;
  border-bottom: none;
}

/* ── Barra de progreso del tour ── */
.demo-progress-bar {
  height: 3px;
  background: #e8eaff;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.demo-progress-fill {
  height: 100%;
  background: #0029ff;
  border-radius: 10px;
  transition: width 0.4s ease;
}

/* ── Overlay oscuro detrás del tooltip ── */
#demo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 997;
  display: none;
  pointer-events: none;
  transition: opacity 0.3s;
}
#demo-overlay.active { display: block; }

body.demo-modal-open {
  overflow: hidden;
}

/* Entrada y salida del shell completo. La animación del componente sigue
   actuando sobre el panel; esta transición aporta el movimiento del overlay. */
@keyframes demoModalFondoEntrar {
  from { opacity: 0; backdrop-filter: blur(0); }
  to { opacity: 1; backdrop-filter: blur(4px); }
}
@keyframes demoModalFondoSalir {
  from { opacity: 1; backdrop-filter: blur(4px); }
  to { opacity: 0; backdrop-filter: blur(0); }
}
@keyframes demoModalPanelSalir {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(18px) scale(.97); }
}
.modal.open {
  animation: demoModalFondoEntrar .25s ease both;
}
.modal.demo-closing {
  display: flex !important;
  animation: demoModalFondoSalir .2s ease both !important;
  pointer-events: none;
}
.modal.demo-closing .modal-contenido,
.modal.demo-closing #notif-main-panel {
  animation: demoModalPanelSalir .2s ease both !important;
}

/* ── Toast para acciones simuladas ── */
#demo-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  z-index: 99996;
  background: #020031;
  color: #fff;
  border-radius: 999px;
  padding: 11px 18px;
  box-shadow: 0 12px 36px rgba(2,0,49,0.22);
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}
#demo-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── Fila demo cliente (animación de entrada) ── */
.demo-row-new {
  animation: rowSlideIn 0.5s ease forwards;
}
@keyframes rowSlideIn {
  from { opacity: 0; transform: translateX(-20px); background: rgba(0,41,255,0.06); }
  to   { opacity: 1; transform: translateX(0);    background: transparent; }
}

/* ── Badge pulsante en notificaciones ── */
.widget-badge.demo-pulse {
  animation: badgePulse 1s ease infinite;
}
@keyframes badgePulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.25); }
}

/* ── Notif row animada ── */
.demo-notif-in {
  animation: notifFadeIn 0.3s ease both;
}
@keyframes notifFadeIn {
  from { opacity: 0; transform: translateY(-6px); background: rgba(0,41,255,0.05); }
  to   { opacity: 1; transform: translateY(0);    background: transparent; }
}

/* ── Final CTA overlay ── */
#demo-cta {
  position: fixed;
  inset: 0;
  background: rgba(0,3,50,0.88);
  backdrop-filter: blur(6px);
  z-index: 99990;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 32px;
  color: #fff;
}
#demo-cta.show { display: flex; animation: ctaIn 0.5s ease; }
@keyframes ctaIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#demo-cta .cta-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  animation: ctaBounce 1.5s ease infinite;
}
@keyframes ctaBounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
#demo-cta h2 {
  font-size: 1.9rem;
  font-weight: 800;
  margin: 0 0 12px;
  color: #fff;
}
#demo-cta p {
  font-size: 1rem;
  opacity: 0.8;
  max-width: 480px;
  margin: 0 0 32px;
  line-height: 1.6;
  color: #fff;
}
#demo-cta .cta-btns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
#demo-cta .btn-cta-primary {
  background: #0029ff;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 20px rgba(0,41,255,0.4);
}
#demo-cta .btn-cta-primary:hover {
  background: #001fcc;
  transform: translateY(-2px);
}
#demo-cta .btn-cta-secondary {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50px;
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
#demo-cta .btn-cta-secondary:hover { background: rgba(255,255,255,0.18); }
#demo-cta .cta-restart {
  margin-top: 20px;
  font-size: 0.8rem;
  opacity: 0.55;
  cursor: pointer;
  background: none;
  border: none;
  color: #fff;
  text-decoration: underline;
}

/* ── Ajustes demo sobre componentes del app ── */
#notifDrawerOverlay.open {
  display: flex;
}

#demo-client-row .nombre-wrap {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#demo-client-row .dropdown-menu-tareas,
#demo-client-row .dropdown-acciones .dropdown {
  z-index: 30;
}

#demo-client-row .dropdown.activo,
#forzar-dropdown-panel.activo {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

#tabla-clientes .tabla-row[style*="display: none"] {
  display: none !important;
}

#btn-forzar-chevron,
#btnDemoPdf,
#btnCancelarCliente {
  cursor: pointer;
}

/* ── Spinner de carga inicial ── */
#demo-loading {
  position: fixed;
  inset: 0;
  background: #f5f7fb;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  color: #0029ff;
  font-size: 0.9rem;
  font-weight: 600;
  display: none;
}

@media (max-width: 768px) {
  body.demo-active {
    padding-top: 54px;
  }

  #demo-banner {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.35;
    padding: 8px 12px;
  }

  #demo-tooltip {
    min-width: 0;
    padding: 18px;
    border-radius: 14px;
  }

  .demo-tooltip-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .demo-tooltip-next,
  .demo-tooltip-skip {
    width: 100%;
    min-height: 40px;
  }

  .demo-tooltip-arrow {
    display: none;
  }

    #notifDrawerOverlay {
    padding: 9px;
  }

  

  



  #notif-main-panel .stats-notificaciones {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #demo-cta .cta-btns,
  #demo-cta .btn-cta-primary,
  #demo-cta .btn-cta-secondary {
    width: 100%;
  }
}


/* El panel conserva el layout del producto; el tour usa un espacio separado. */
body.demo-guided-notif #notifDrawerOverlay { padding-bottom: 240px; }
body.demo-guided-notif #demo-tooltip { width: min(460px, calc(100vw - 24px)); }
body.demo-guided-notif .demo-tooltip-arrow { display: none; }
#notifDrawerOverlay .col-asunto { display: flex; align-items: center; gap: 8px; min-width: 0; }
@media (max-width: 640px) {
  body.demo-guided-notif #notifDrawerOverlay { padding-bottom: 280px; }
}
