/* ============================================
   Onboarding & Help System Styles
   FazeOne Plus Marketing Platform
   ============================================ */

/* ============================================
   CSS Variables (inherit from main styles.css)
   ============================================ */
:root {
  --onboarding-primary: var(--primary, #005da0);
  --onboarding-accent: var(--accent, #009c73);
  --onboarding-success: var(--success, #009c73);
  --onboarding-bg: var(--bg-dark, #0a1a1f);
  --onboarding-surface: var(--surface, rgba(255, 255, 255, 0.05));
  --onboarding-glass-border: var(--glass-border, rgba(255, 255, 255, 0.15));
  --onboarding-text: var(--text-primary, #ffffff);
  --onboarding-text-secondary: var(--text-secondary, rgba(255, 255, 255, 0.75));
  --onboarding-text-muted: var(--text-muted, rgba(255, 255, 255, 0.5));
}

/* ============================================
   Help Button (for app header)
   ============================================ */
.help-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--onboarding-surface);
  border: 1px solid var(--onboarding-glass-border);
  border-radius: 8px;
  color: var(--onboarding-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.help-btn:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.12));
  color: var(--onboarding-text);
  border-color: var(--onboarding-primary);
}

.help-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Floating help button */
.help-btn-floating {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--onboarding-primary), var(--onboarding-accent));
  border: none;
  color: white;
  box-shadow: 0 4px 24px rgba(0, 93, 160, 0.4);
  z-index: 9000;
}

.help-btn-floating:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 32px rgba(0, 93, 160, 0.5);
}

.help-btn-floating svg {
  width: 24px;
  height: 24px;
}

/* ============================================
   Wizard Progress Indicators
   ============================================ */
.wizard-progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--onboarding-glass-border);
  transition: all 0.3s ease;
}

.progress-dot.active {
  background: var(--onboarding-primary);
  width: 24px;
  border-radius: 5px;
}

.progress-dot.completed {
  background: var(--onboarding-success);
}

/* ============================================
   Step Indicators
   ============================================ */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.step-indicator-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--onboarding-text-muted);
}

.step-indicator-item.active {
  color: var(--onboarding-text);
}

.step-indicator-item.completed {
  color: var(--onboarding-success);
}

.step-indicator-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--onboarding-surface);
  border: 2px solid var(--onboarding-glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
}

.step-indicator-item.active .step-indicator-number {
  background: var(--onboarding-primary);
  border-color: var(--onboarding-primary);
  color: white;
}

.step-indicator-item.completed .step-indicator-number {
  background: var(--onboarding-success);
  border-color: var(--onboarding-success);
  color: white;
}

.step-indicator-line {
  flex: 1;
  height: 2px;
  background: var(--onboarding-glass-border);
}

.step-indicator-line.completed {
  background: var(--onboarding-success);
}

/* ============================================
   Tooltip Enhancements
   ============================================ */
.tooltip-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  background: var(--onboarding-primary);
  border-radius: 50%;
  border: 2px solid var(--onboarding-bg);
  animation: tooltipBadgePulse 2s ease-in-out infinite;
}

@keyframes tooltipBadgePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

.has-tooltip {
  position: relative;
}

/* ============================================
   Tour Enhancements
   ============================================ */
.tour-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--onboarding-glass-border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
}

.tour-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--onboarding-primary), var(--onboarding-accent));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.tour-confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confettiFall 3s ease-in forwards;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(-100vh) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

/* ============================================
   Quick Start Cards
   ============================================ */
.quick-start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.quick-start-card {
  background: var(--onboarding-surface);
  border: 1px solid var(--onboarding-glass-border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.quick-start-card:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.12));
  border-color: var(--onboarding-primary);
  transform: translateY(-2px);
}

.quick-start-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--onboarding-primary), var(--onboarding-accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.quick-start-icon svg {
  width: 24px;
  height: 24px;
  stroke: white;
  stroke-width: 2;
  fill: none;
}

.quick-start-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.quick-start-desc {
  font-size: 0.85rem;
  color: var(--onboarding-text-secondary);
}

/* ============================================
   Onboarding Checklist
   ============================================ */
.onboarding-checklist {
  background: var(--onboarding-surface);
  border: 1px solid var(--onboarding-glass-border);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}

.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.checklist-title {
  font-weight: 600;
  font-size: 1rem;
}

.checklist-progress {
  font-size: 0.85rem;
  color: var(--onboarding-text-secondary);
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--onboarding-bg);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.checklist-item:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.12));
}

.checklist-item.completed {
  opacity: 0.6;
}

.checklist-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--onboarding-glass-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.checklist-item.completed .checklist-checkbox {
  background: var(--onboarding-success);
  border-color: var(--onboarding-success);
}

.checklist-checkbox svg {
  width: 14px;
  height: 14px;
  stroke: white;
  stroke-width: 3;
  opacity: 0;
}

.checklist-item.completed .checklist-checkbox svg {
  opacity: 1;
}

.checklist-text {
  flex: 1;
  font-size: 0.9rem;
}

.checklist-item.completed .checklist-text {
  text-decoration: line-through;
}

/* ============================================
   Welcome Modal
   ============================================ */
.welcome-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: welcomeIn 0.3s ease;
}

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

.welcome-content {
  background: linear-gradient(135deg, var(--onboarding-bg) 0%, #0d2530 100%);
  border: 1px solid var(--onboarding-glass-border);
  border-radius: 24px;
  padding: 48px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  animation: welcomeContentIn 0.4s ease;
}

@keyframes welcomeContentIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.welcome-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--onboarding-primary), var(--onboarding-accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 93, 160, 0.4);
}

.welcome-icon svg {
  width: 40px;
  height: 40px;
  stroke: white;
  stroke-width: 2;
  fill: none;
}

.welcome-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--onboarding-text), var(--onboarding-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-subtitle {
  color: var(--onboarding-text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 32px;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================
   Feature Highlights
   ============================================ */
.feature-highlight {
  position: relative;
  animation: featureHighlight 2s ease-in-out infinite;
}

@keyframes featureHighlight {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 93, 160, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(0, 93, 160, 0);
  }
}

.new-feature-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--warning, #f2a900);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 6px;
  border-radius: 4px;
  z-index: 1;
}

/* ============================================
   Contextual Tips
   ============================================ */
.contextual-tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(0, 93, 160, 0.1);
  border: 1px solid rgba(0, 93, 160, 0.2);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0;
}

.tip-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: var(--onboarding-primary);
}

.tip-content {
  flex: 1;
}

.tip-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.tip-text {
  font-size: 0.85rem;
  color: var(--onboarding-text-secondary);
  line-height: 1.5;
}

.tip-dismiss {
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  color: var(--onboarding-text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tip-dismiss:hover {
  color: var(--onboarding-text);
}

/* ============================================
   Loading States
   ============================================ */
.onboarding-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 16px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--onboarding-glass-border);
  border-top-color: var(--onboarding-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--onboarding-text-secondary);
  font-size: 0.9rem;
}

/* ============================================
   Animations
   ============================================ */
.fade-in {
  animation: fadeIn 0.3s ease;
}

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

.slide-up {
  animation: slideUp 0.3s ease;
}

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

.scale-in {
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
  .quick-start-grid {
    grid-template-columns: 1fr;
  }

  .welcome-content {
    padding: 32px 24px;
  }

  .welcome-title {
    font-size: 1.5rem;
  }

  .welcome-subtitle {
    font-size: 1rem;
  }

  .help-btn-floating {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }

  .help-btn-floating svg {
    width: 20px;
    height: 20px;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .help-btn,
  .help-btn-floating,
  .tour-overlay,
  .tour-popup,
  .tooltip-popup,
  #help-panel,
  .welcome-modal {
    display: none !important;
  }
}
