/* ============================================
   HELP SYSTEM - MWR LIFE DASHBOARD
   Système d'aide hybride : Tour + Tooltips + Help Center
   ============================================ */

/* Variables spécifiques aide */
:root {
  --help-accent: #1e90ff;
  --help-bg: rgba(30, 144, 255, 0.15);
  --help-border: rgba(30, 144, 255, 0.5);
  --help-highlight: rgba(30, 144, 255, 0.3);
}

/* ============================================
   BOUTON AIDE FLOTTANT (FAB)
   ============================================ */
.help-fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e90ff, #00bfff);
  border: none;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(30, 144, 255, 0.5);
  z-index: 9990;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(30, 144, 255, 0.7);
}

.help-fab:active {
  transform: scale(0.95);
}

/* ============================================
   TOOLTIPS CONTEXTUELS
   ============================================ */
.help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(30, 144, 255, 0.2);
  color: #1e90ff;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: help;
  margin-left: 8px;
  border: 1px solid rgba(30, 144, 255, 0.4);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.help-trigger:hover {
  background: rgba(30, 144, 255, 0.4);
  transform: scale(1.1);
}

#tooltipContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10001;
}

.help-tooltip {
  position: fixed;
  max-width: 320px;
  background: linear-gradient(135deg, #161B22, #1a1f2e);
  border: 1px solid var(--help-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: auto;
}

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

.help-tooltip-title {
  font-weight: 700;
  color: #1e90ff;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.help-tooltip-content {
  color: #E6EDF3;
  font-size: 0.9rem;
  line-height: 1.5;
}

.help-tooltip-tip {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: #8B949E;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.help-tooltip-tip::before {
  content: "💡";
  flex-shrink: 0;
}

/* ============================================
   POPUP PREMIERE VISITE
   ============================================ */
.welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

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

.welcome-popup {
  width: 480px;
  max-width: 90%;
  background: linear-gradient(135deg, #161B22, #1a1f2e);
  border: 2px solid rgba(30, 144, 255, 0.4);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  animation: popIn 0.4s ease;
}

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

.welcome-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.welcome-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #E6EDF3;
  margin-bottom: 12px;
}

.welcome-description {
  color: #8B949E;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 28px;
}

.welcome-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.welcome-btn {
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.welcome-btn-skip {
  background: rgba(255, 255, 255, 0.1);
  color: #8B949E;
}

.welcome-btn-skip:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #E6EDF3;
}

.welcome-btn-start {
  background: linear-gradient(135deg, #1e90ff, #00bfff);
  color: white;
}

.welcome-btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(30, 144, 255, 0.5);
}

/* ============================================
   TOUR GUIDE
   ============================================ */
.tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  pointer-events: none;
}

.tour-spotlight {
  position: fixed;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  transition: all 0.5s ease;
}

.tour-spotlight::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid #1e90ff;
  border-radius: 12px;
  animation: tour-pulse 2s infinite;
}

@keyframes tour-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(30, 144, 255, 0.6);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(30, 144, 255, 0);
  }
}

.tour-popup {
  position: fixed;
  width: 400px;
  max-width: calc(100vw - 40px);
  background: linear-gradient(135deg, #161B22, #1a1f2e);
  border: 2px solid rgba(30, 144, 255, 0.5);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  z-index: 10002;
  animation: tour-fadeIn 0.3s ease;
  pointer-events: auto;
}

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

.tour-step-indicator {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  justify-content: center;
}

.tour-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.tour-step-dot.active {
  background: #1e90ff;
  transform: scale(1.2);
}

.tour-step-dot.completed {
  background: #00ff7f;
}

.tour-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #E6EDF3;
  margin-bottom: 12px;
}

.tour-description {
  font-size: 0.95rem;
  color: #8B949E;
  line-height: 1.6;
  margin-bottom: 20px;
}

.tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tour-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-size: 0.9rem;
}

.tour-btn-skip {
  background: transparent;
  color: #8B949E;
}

.tour-btn-skip:hover {
  color: #E6EDF3;
}

.tour-btn-prev {
  background: rgba(255, 255, 255, 0.1);
  color: #E6EDF3;
  margin-right: 8px;
}

.tour-btn-prev:hover {
  background: rgba(255, 255, 255, 0.15);
}

.tour-btn-next {
  background: linear-gradient(135deg, #1e90ff, #00bfff);
  color: white;
}

.tour-btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 144, 255, 0.4);
}

.tour-nav-buttons {
  display: flex;
  gap: 8px;
}

/* ============================================
   HELP CENTER PANEL
   ============================================ */
.help-center-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.help-center-overlay.open {
  opacity: 1;
  visibility: visible;
}

.help-center-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100%;
  height: 100%;
  background: #0D1117;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10001;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.help-center-panel.open {
  transform: translateX(0);
}

.help-center-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.help-center-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #E6EDF3;
  margin: 0;
}

.help-center-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #8B949E;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.help-center-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #E6EDF3;
}

.help-center-search {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.help-search-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #E6EDF3;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.help-search-input::placeholder {
  color: #8B949E;
}

.help-search-input:focus {
  outline: none;
  border-color: var(--help-accent);
  background: rgba(30, 144, 255, 0.05);
}

.help-center-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.help-quick-actions {
  margin-bottom: 24px;
}

.help-quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(30, 144, 255, 0.1), rgba(0, 191, 255, 0.05));
  border: 1px solid rgba(30, 144, 255, 0.3);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.help-quick-action:hover {
  background: linear-gradient(135deg, rgba(30, 144, 255, 0.2), rgba(0, 191, 255, 0.1));
  transform: translateX(5px);
}

.help-quick-action-icon {
  font-size: 1.3rem;
}

.help-quick-action-text {
  color: #E6EDF3;
  font-weight: 500;
}

.help-section {
  margin-bottom: 24px;
}

.help-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #8B949E;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-left: 4px;
}

.help-article {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.help-article:hover {
  background: rgba(30, 144, 255, 0.1);
  transform: translateX(5px);
}

.help-article-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.help-article-title {
  color: #E6EDF3;
  font-size: 0.9rem;
}

/* Article détaillé */
.help-article-detail {
  padding: 20px;
}

.help-article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1e90ff;
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.help-article-back:hover {
  transform: translateX(-3px);
}

.help-article-detail-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #E6EDF3;
  margin-bottom: 16px;
}

.help-article-detail-content {
  color: #8B949E;
  line-height: 1.7;
  font-size: 0.95rem;
}

.help-article-detail-content p {
  margin-bottom: 12px;
}

.help-article-detail-content ul {
  margin: 12px 0;
  padding-left: 20px;
}

.help-article-detail-content li {
  margin-bottom: 8px;
}

/* FAQ */
.help-faq-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.help-faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  color: #E6EDF3;
  font-weight: 500;
  transition: all 0.2s ease;
}

.help-faq-question:hover {
  background: rgba(255, 255, 255, 0.03);
}

.help-faq-arrow {
  transition: transform 0.3s ease;
  color: #8B949E;
}

.help-faq-item.open .help-faq-arrow {
  transform: rotate(180deg);
}

.help-faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.help-faq-item.open .help-faq-answer {
  max-height: 200px;
}

.help-faq-answer-content {
  padding: 0 16px 14px;
  color: #8B949E;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .help-fab {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }

  .tour-popup {
    width: calc(100% - 32px);
    left: 16px !important;
    right: 16px !important;
    bottom: 20px !important;
    top: auto !important;
  }

  .help-center-panel {
    width: 100%;
  }

  .welcome-popup {
    width: calc(100% - 32px);
    padding: 24px;
  }

  .help-tooltip {
    max-width: 280px;
  }
}
