/* CyberSchild Portal Demo — Tour, Toast, Details (portal-demo.html only) */

.demo-banner {
  background: linear-gradient(90deg, #0B1F3A 0%, #1E5A8C 100%);
  color: #e2e8f0;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.demo-banner strong { color: #5eead4; }

.demo-banner button {
  background: rgba(13, 148, 136, 0.25);
  border: 1px solid #0D9488;
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.demo-banner button:hover { background: #0D9488; }

/* Tour launcher — bottom right (Intercom / Linear style) */
.tour-launcher {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.tour-fab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.125rem;
  background: linear-gradient(135deg, #0D9488, #0f766e);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}

.tour-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(13, 148, 136, 0.5);
}

.tour-fab svg { width: 20px; height: 20px; flex-shrink: 0; }

.tour-fab.is-pulse {
  animation: tour-pulse 2s ease-in-out infinite;
}

@keyframes tour-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(13, 148, 136, 0.45); }
  50% { box-shadow: 0 4px 28px rgba(13, 148, 136, 0.75), 0 0 0 8px rgba(13, 148, 136, 0.15); }
}

.tour-hint {
  background: #fff;
  color: #334155;
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  box-shadow: 0 4px 16px rgba(11, 31, 58, 0.12);
  max-width: 220px;
  border: 1px solid #e2e8f0;
}

/* Tour overlay */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  pointer-events: none;
}

.tour-overlay.is-active { pointer-events: auto; }

.tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 31, 58, 0.55);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.tour-overlay.is-active .tour-backdrop { opacity: 1; }

.tour-spotlight {
  position: absolute;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(11, 31, 58, 0.55);
  border: 2px solid #0D9488;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.tour-popover {
  position: fixed;
  z-index: 9600;
  width: min(360px, calc(100vw - 2rem));
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(11, 31, 58, 0.2);
  border: 1px solid #e2e8f0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
}

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

.tour-popover__progress {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0D9488;
  margin-bottom: 0.5rem;
}

.tour-popover__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0B1F3A;
  margin-bottom: 0.5rem;
}

.tour-popover__text {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.tour-popover__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.tour-popover__nav { display: flex; gap: 0.5rem; }

.tour-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.tour-btn--ghost {
  background: transparent;
  color: #64748b;
}

.tour-btn--ghost:hover { color: #0B1F3A; }

.tour-btn--primary {
  background: #0D9488;
  color: #fff;
}

.tour-btn--primary:hover { background: #0f766e; }

.tour-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Toast */
.demo-toast-wrap {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  z-index: 8500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.demo-toast {
  background: #0B1F3A;
  color: #f8fafc;
  padding: 0.875rem 1rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  box-shadow: 0 8px 24px rgba(11, 31, 58, 0.25);
  border-left: 4px solid #0D9488;
  max-width: 320px;
  animation: toast-in 0.35s ease;
}

.demo-toast strong { color: #5eead4; display: block; margin-bottom: 0.25rem; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Detail drawer */
.demo-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  z-index: 8000;
  box-shadow: -8px 0 32px rgba(11, 31, 58, 0.12);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.demo-drawer.is-open { transform: translateX(0); }

.demo-drawer__header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.demo-drawer__header h3 {
  font-size: 1rem;
  color: #0B1F3A;
  margin: 0 0 0.25rem;
}

.demo-drawer__header p {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0;
}

.demo-drawer__close {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  color: #64748b;
}

.demo-drawer__body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  font-size: 0.875rem;
}

.demo-drawer__body dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
}

.demo-drawer__body dt { color: #64748b; font-weight: 500; }
.demo-drawer__body dd { color: #0B1F3A; margin: 0; }

.demo-drawer__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 58, 0.3);
  z-index: 7999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.demo-drawer__backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Interactive rows */
.panel tbody tr[data-demo-row],
.incident-item[data-demo-row] {
  cursor: pointer;
  transition: background 0.15s;
}

.panel tbody tr[data-demo-row]:hover,
.incident-item[data-demo-row]:hover {
  background: #f0fdfa;
}

.nav-item.is-tour-highlight {
  background: rgba(13, 148, 136, 0.2) !important;
}

.portal-view { display: none; }
.portal-view.is-active { display: block; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.settings-grid .full-width { grid-column: 1 / -1; }

.settings-body { padding: 18px 22px; }

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 13px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.settings-row:last-child { border-bottom: none; }

.settings-field {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.settings-field:last-child { border-bottom: none; }

.settings-label { color: #64748b; }
.settings-value { color: #0B1F3A; font-weight: 600; }

.kpi-card { opacity: 0; transform: translateY(16px); }
.kpi-card.is-visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
}

.mobile-menu-btn {
  display: none;
  background: #f1f5f9;
  border: none;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: block; }
  .sidebar.is-open { transform: translateX(0); }
  .tour-launcher { bottom: 1rem; right: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .kpi-card { opacity: 1; transform: none; }
  .tour-fab.is-pulse { animation: none; }
}