/* ============================================================
   USER GUIDANCE SYSTEM — Premium CSS
   Glassmorphism • Smooth Animations • Responsive
   ============================================================ */

:root {
  /* Guide Overlay */
  --guide-overlay: rgba(15, 23, 42, 0.75);

  /* Glassmorphism Tooltip — Dark for readability */
  --guide-glass-bg: rgba(15, 23, 42, 0.92);
  --guide-glass-border: rgba(255, 255, 255, 0.12);
  --guide-glass-blur: 16px;

  /* Colors */
  --guide-primary: #c19a6b;
  --guide-primary-glow: rgba(193, 154, 107, 0.4);
  --guide-text: #ffffff;
  --guide-text-muted: rgba(255, 255, 255, 0.65);
  --guide-success: #10b981;
  --guide-spotlight-ring: rgba(193, 154, 107, 0.5);

  /* Smart Banner */
  --banner-border: rgba(245, 158, 11, 0.3);
  --banner-accent: #d97706;

  /* Micro-copy */
  --micro-text: #64748b;
  --micro-bg: rgba(241, 245, 249, 0.8);
}

/* ============================================================
   1. OVERLAY
   ============================================================ */
.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.guide-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   2. SPOTLIGHT — Vurgulanan element
   ============================================================ */
.guide-spotlight {
  position: absolute;
  z-index: 10001;
  border-radius: 12px;
  pointer-events: none;
  box-shadow:
    0 0 0 4px var(--guide-spotlight-ring),
    0 0 30px 8px rgba(193, 154, 107, 0.15),
    0 0 0 9999px var(--guide-overlay);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  animation: spotlightPulse 2s ease-in-out infinite;
}

@keyframes spotlightPulse {
  0%, 100% {
    box-shadow:
      0 0 0 4px var(--guide-spotlight-ring),
      0 0 30px 8px rgba(193, 154, 107, 0.15),
      0 0 0 9999px var(--guide-overlay);
  }
  50% {
    box-shadow:
      0 0 0 6px var(--guide-spotlight-ring),
      0 0 40px 12px rgba(193, 154, 107, 0.25),
      0 0 0 9999px var(--guide-overlay);
  }
}

/* ============================================================
   3. TOOLTIP — Glassmorphism Card
   ============================================================ */
.guide-tooltip {
  position: absolute;
  z-index: 10002;
  max-width: 380px;
  width: calc(100vw - 2rem);
  padding: 1.75rem;

  /* Glassmorphism */
  background: var(--guide-glass-bg);
  backdrop-filter: blur(var(--guide-glass-blur));
  -webkit-backdrop-filter: blur(var(--guide-glass-blur));
  border: 1px solid var(--guide-glass-border);
  border-radius: 1.25rem;

  /* Shadow */
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 1px rgba(255, 255, 255, 0.1) inset;

  /* Anim */
  animation: tooltipEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  pointer-events: auto;
}

.guide-tooltip.exiting {
  animation: tooltipExit 0.2s ease-in forwards;
}

@keyframes tooltipEnter {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tooltipExit {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(0.96); }
}

/* Step Dots */
.guide-dots {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.guide-dots-track {
  display: flex;
  gap: 6px;
}

.guide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s;
}

.guide-dot.active {
  background: var(--guide-primary);
  box-shadow: 0 0 8px var(--guide-primary-glow);
  transform: scale(1.25);
}

.guide-dot.completed {
  background: var(--guide-success);
}

.guide-step-counter {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.05em;
}

/* Tooltip Content */
.guide-tooltip-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.guide-tooltip-title {
  font-family: 'Ubuntu', 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--guide-text);
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.guide-tooltip-description {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--guide-text-muted);
  margin: 0 0 1.5rem;
}

/* Tooltip Buttons */
.guide-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.guide-btn-next {
  background: linear-gradient(135deg, #c19a6b, #d4a96e);
  color: white;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px var(--guide-primary-glow);
  flex: 1;
  text-align: center;
}

.guide-btn-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--guide-primary-glow);
}

.guide-btn-next:active {
  transform: translateY(0);
}

.guide-btn-back {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.65rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.guide-btn-back:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

.guide-skip-wrap {
  text-align: center;
  margin-top: 1rem;
}

.guide-skip {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.2s;
  padding: 4px 8px;
}

.guide-skip:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* ============================================================
   4. SMART BANNER — Next Action Guidance
   ============================================================ */
.smart-banner {
  background: linear-gradient(135deg, #fefce8, #fef3c7);
  border: 1px solid var(--banner-border);
  border-radius: 1.25rem;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  animation: bannerSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.smart-banner::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--guide-primary), #d97706);
  border-radius: 4px 0 0 4px;
}

.smart-banner-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.smart-banner-title {
  font-family: 'Ubuntu', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #1e293b;
  margin: 0 0 0.4rem;
}

.smart-banner-desc {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.smart-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #c19a6b, #a68256);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(193, 154, 107, 0.3);
}

.smart-banner-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(193, 154, 107, 0.4);
}

.smart-banner-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
  line-height: 1;
}

.smart-banner-close:hover {
  color: #64748b;
  background: rgba(0, 0, 0, 0.05);
}

/* Urgency Variants */
.smart-banner[data-urgency="high"] {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border-color: rgba(239, 68, 68, 0.3);
}
.smart-banner[data-urgency="high"]::before {
  background: linear-gradient(180deg, #ef4444, #dc2626);
}

.smart-banner[data-urgency="success"] {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: rgba(16, 185, 129, 0.3);
}
.smart-banner[data-urgency="success"]::before {
  background: linear-gradient(180deg, #10b981, #059669);
}

.smart-banner[data-urgency="info"] {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: rgba(59, 130, 246, 0.3);
}
.smart-banner[data-urgency="info"]::before {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
}

@keyframes bannerSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   5. HELP TOOLTIP — Contextual ? Icons
   ============================================================ */
.help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
  font-size: 0.6rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 6px;
  vertical-align: middle;
  border: none;
  font-family: 'Inter', sans-serif;
  line-height: 1;
}

.help-trigger:hover {
  background: var(--guide-primary);
  color: white;
  transform: scale(1.15);
}

.help-popover {
  position: absolute;
  z-index: 9999;
  max-width: 280px;
  padding: 1rem 1.25rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.15);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #475569;
  font-family: 'Inter', sans-serif;
  animation: popoverEnter 0.25s ease-out both;
}

.help-popover.exiting {
  animation: popoverExit 0.15s ease-in forwards;
}

.help-popover::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-right: none;
  border-bottom: none;
  transform: rotate(45deg);
}

.help-popover-title {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

@keyframes popoverEnter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes popoverExit {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(4px); }
}

/* ============================================================
   6. FLOATING HELP WIDGET — FAB + Panel
   ============================================================ */
.help-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c19a6b, #a68256);
  color: white;
  border: none;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    0 4px 14px rgba(193, 154, 107, 0.4),
    0 0 0 3px rgba(193, 154, 107, 0.15);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-fab:hover {
  transform: scale(1.1);
  box-shadow:
    0 6px 20px rgba(193, 154, 107, 0.5),
    0 0 0 5px rgba(193, 154, 107, 0.2);
}

.help-fab.open {
  transform: rotate(45deg) scale(1.05);
  background: #64748b;
  box-shadow: 0 4px 14px rgba(100, 116, 139, 0.3);
}

.help-panel {
  position: fixed;
  bottom: 84px;
  right: 24px;
  z-index: 9999;
  width: 320px;
  max-height: 480px;
  overflow: hidden;
  background: white;
  border-radius: 1.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
}

.help-panel.open {
  display: flex;
  animation: panelSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.help-panel.closing {
  animation: panelSlideDown 0.2s ease-in forwards;
}

.help-panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.help-panel-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(193, 154, 107, 0.15), rgba(193, 154, 107, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.help-panel-header h3 {
  margin: 0;
  font-family: 'Ubuntu', 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #1e293b;
}

.help-panel-header p {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
}

.help-panel-body {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem 0;
}

/* Panel Menu Items */
.help-menu-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Inter', sans-serif;
}

.help-menu-item:hover {
  background: #f8fafc;
}

.help-menu-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.help-menu-icon.faq    { background: rgba(59, 130, 246, 0.1);  color: #3b82f6; }
.help-menu-icon.tour   { background: rgba(193, 154, 107, 0.1); color: #c19a6b; }
.help-menu-icon.msg    { background: rgba(16, 185, 129, 0.1);  color: #10b981; }

.help-menu-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: #1e293b;
}

.help-menu-sublabel {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 1px;
}

/* FAQ Section */
.help-faq-section {
  display: none;
}

.help-faq-section.open {
  display: block;
}

.help-faq-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--guide-primary);
  width: 100%;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s;
}

.help-faq-back:hover {
  background: #f8fafc;
}

.faq-item {
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.2s;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item:hover {
  background: #f8fafc;
}

.faq-question {
  padding: 0.85rem 1.5rem;
  font-weight: 700;
  font-size: 0.82rem;
  color: #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', sans-serif;
}

.faq-chevron {
  font-size: 0.7rem;
  color: #94a3b8;
  transition: transform 0.3s;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.65;
  max-height: 0;
  overflow: hidden;
  padding: 0 1.5rem;
  transition: max-height 0.35s ease, padding 0.35s ease;
  font-family: 'Inter', sans-serif;
}

.faq-item.open .faq-answer {
  max-height: 250px;
  padding: 0 1.5rem 1rem;
}

@keyframes panelSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes panelSlideDown {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(12px) scale(0.95); }
}

/* ============================================================
   7. MICRO-COPY
   ============================================================ */
.micro-help {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--micro-text);
  background: var(--micro-bg);
  padding: 5px 10px;
  border-radius: 6px;
  border-left: 2px solid var(--guide-primary);
  font-family: 'Inter', sans-serif;
  animation: microFadeIn 0.3s ease both;
}

@keyframes microFadeIn {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   8. RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .guide-tooltip {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    max-width: 100%;
    width: 100%;
    border-radius: 1.5rem 1.5rem 0 0;
    animation: mobileSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    padding: 1.5rem 1.5rem 2rem;
  }

  .guide-tooltip.exiting {
    animation: mobileSlideDown 0.25s ease-in forwards;
  }

  @keyframes mobileSlideUp {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes mobileSlideDown {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(100%); }
  }

  .help-panel {
    width: calc(100vw - 2rem);
    right: 1rem;
    left: 1rem;
    bottom: 80px;
    max-height: 60vh;
  }

  .smart-banner {
    padding: 1.15rem 1.25rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
  }

  .smart-banner-title {
    font-size: 0.9rem;
  }

  .smart-banner-desc {
    font-size: 0.8rem;
  }

  .help-fab {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .guide-tooltip {
    padding: 1.25rem 1.25rem 1.75rem;
  }

  .guide-tooltip-title {
    font-size: 1.05rem;
  }

  .guide-tooltip-description {
    font-size: 0.82rem;
  }
}
