/* CRM Espreso - Interactive Manager Tour & Help System */

:root {
  --tour-teal: #0F9683;
  --tour-teal-dark: #0A6255;
  --tour-teal-light: #E4F4F1;
  --tour-coral: #EF4030;
  --tour-bg: #FFFFFF;
  --tour-text: #1E293B;
  --tour-text-muted: #64748B;
  --tour-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
}

/* 1. Backdrop Overlay */
.crm-tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 10500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: auto;
}

.crm-tour-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* 2. Highlighted Target Element */
.crm-tour-highlight {
  position: relative !important;
  z-index: 10505 !important;
  box-shadow: 0 0 0 4px var(--tour-teal), 0 0 25px rgba(15, 150, 131, 0.45) !important;
  border-radius: 8px !important;
  transition: box-shadow 0.25s ease !important;
  background-color: inherit;
}

/* 3. Tour Popover Card */
.crm-tour-popover {
  position: absolute;
  z-index: 10510;
  background: var(--tour-bg);
  color: var(--tour-text);
  border-radius: 12px;
  box-shadow: var(--tour-shadow);
  width: 380px;
  max-width: calc(100vw - 32px);
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, top 0.25s ease, left 0.25s ease;
}

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

.crm-tour-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.crm-tour-step-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--tour-teal-light);
  color: var(--tour-teal-dark);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

.crm-tour-close-btn {
  background: transparent;
  border: none;
  color: var(--tour-text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
}

.crm-tour-close-btn:hover {
  color: var(--tour-coral);
}

.crm-tour-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--tour-teal-dark);
  margin-bottom: 0.5rem;
}

.crm-tour-body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #334155;
  margin-bottom: 1.2rem;
}

/* Dots indicator */
.crm-tour-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.crm-tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #CBD5E1;
  transition: background 0.2s ease, width 0.2s ease;
}

.crm-tour-dot.active {
  background: var(--tour-teal);
  width: 16px;
  border-radius: 10px;
}

/* Footer & Buttons */
.crm-tour-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid #F1F5F9;
}

.crm-tour-btn {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.crm-tour-btn-prev {
  background: #F8FAFC;
  color: #475569;
  border-color: #E2E8F0;
}

.crm-tour-btn-prev:hover {
  background: #E2E8F0;
}

.crm-tour-btn-skip {
  background: transparent;
  color: var(--tour-text-muted);
  border: none;
  font-size: 0.8rem;
  text-decoration: underline;
  padding: 0.4rem 0.5rem;
}

.crm-tour-btn-skip:hover {
  color: var(--tour-coral);
}

.crm-tour-btn-next,
.crm-tour-btn-finish {
  background: var(--tour-teal);
  color: #FFFFFF;
}

.crm-tour-btn-next:hover,
.crm-tour-btn-finish:hover {
  background: var(--tour-teal-dark);
}

/* 4. Help Drawer / Modal */
.crm-help-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 10600;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 1rem;
}

.crm-help-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.crm-help-modal-card {
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
  width: 540px;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.crm-help-modal-header {
  background: var(--tour-teal-dark);
  color: #FFFFFF;
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.crm-help-modal-header h5 {
  margin: 0;
  font-weight: 800;
  font-size: 1.15rem;
}

.crm-help-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.crm-help-tip-box {
  background: #F8FAFC;
  border-left: 4px solid var(--tour-teal);
  padding: 0.9rem 1rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  color: #334155;
}

.crm-help-tip-box.coral {
  border-left-color: var(--tour-coral);
  background: #FFF5F5;
}

/* 5. Mobile Responsiveness */
@media (max-width: 576px) {
  .crm-tour-popover {
    position: fixed !important;
    left: 16px !important;
    right: 16px !important;
    bottom: 16px !important;
    top: auto !important;
    width: auto !important;
    max-width: none !important;
  }
}
