/**
 * Walkthrough/Tutorial Overlay Styles
 * Interactive tour showing users the Sync → Journal → Analytics flow
 */

.walkthrough-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  pointer-events: none;
}

.walkthrough-overlay * {
  pointer-events: auto;
}

.walkthrough-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.walkthrough-highlight {
  position: absolute;
  border: 2px solid var(--brand, #2DD4BF);
  border-radius: 12px;
  box-shadow:
    0 0 0 4px rgba(45, 212, 191, 0.2),
    0 0 0 9999px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10001;
}

.walkthrough-highlight.visible {
  opacity: 1;
}

.walkthrough-tooltip {
  position: absolute;
  background: var(--bg-surface, #1E293B);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.1));
  border-radius: 16px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(45, 212, 191, 0.1);
  padding: 0;
  max-width: 400px;
  width: max-content;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10002;
}

.walkthrough-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.walkthrough-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.1));
}

.walkthrough-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text, #FFFFFF);
}

.walkthrough-close {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary, #94A3B8);
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.walkthrough-close:hover {
  color: var(--text, #FFFFFF);
  background: rgba(148, 163, 184, 0.1);
}

.walkthrough-body {
  padding: 1.5rem;
}

.walkthrough-body p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary, #CBD5E1);
}

.walkthrough-footer {
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border, rgba(148, 163, 184, 0.1));
}

.walkthrough-progress {
  margin-bottom: 1rem;
}

.progress-text {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary, #94A3B8);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.progress-bar {
  height: 4px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2DD4BF 0%, #14B8A6 100%);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.walkthrough-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.walkthrough-actions .btn {
  min-width: 80px;
}

.walkthrough-overlay.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

.walkthrough-overlay.fade-out .walkthrough-tooltip {
  opacity: 0;
  transform: translateY(-10px);
}

.walkthrough-overlay.fade-out .walkthrough-highlight {
  opacity: 0;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .walkthrough-tooltip {
    position: fixed !important;
    top: auto !important;
    left: 1rem !important;
    right: 1rem !important;
    bottom: 2rem !important;
    transform: translateY(0) !important;
    max-width: none !important;
    width: auto !important;
  }

  .walkthrough-tooltip.visible {
    transform: translateY(0) !important;
  }

  .walkthrough-highlight {
    display: none !important;
  }
}

/* Button styles (if not already defined) */
.btn {
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2DD4BF 0%, #14B8A6 100%);
  color: #0F172A;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 212, 191, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary, #94A3B8);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
}

.btn-ghost:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text, #FFFFFF);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}
