/**
 * Dashboard Walkthrough Styles
 * Provides tooltip modals and overlay for guided dashboard tour
 */

/* ========== Walkthrough Overlay ========== */
.walkthrough-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(3px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.walkthrough-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ========== Highlighted Element ========== */
.walkthrough-highlight {
  position: relative;
  z-index: 9999 !important;
  box-shadow: 0 0 0 4px rgba(158, 240, 249, 0.5),
              0 0 20px rgba(158, 240, 249, 0.3) !important;
  border-radius: 8px;
  pointer-events: none;
  transition: box-shadow 0.3s ease;
}

/* Pulse animation for highlighted elements */
@keyframes pulse-highlight {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(158, 240, 249, 0.5),
                0 0 20px rgba(158, 240, 249, 0.3);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(158, 240, 249, 0.7),
                0 0 30px rgba(158, 240, 249, 0.5);
  }
}

.walkthrough-highlight.pulse {
  animation: pulse-highlight 2s ease-in-out infinite;
}

/* ========== Walkthrough Tooltip ========== */
.walkthrough-tooltip {
  position: fixed;
  z-index: 10000;
  background: linear-gradient(135deg, #1a1f2e, #252b3b);
  border: 2px solid var(--color-active, #9ef0f9);
  border-radius: 12px;
  padding: 0;
  max-width: 450px;
  min-width: 320px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
              0 0 20px rgba(158, 240, 249, 0.2);
  opacity: 0;
  transform: scale(0.9) translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: all;
}

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

/* Tooltip header */
.walkthrough-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(158, 240, 249, 0.2);
  background: linear-gradient(90deg, rgba(158, 240, 249, 0.1), transparent);
}

.walkthrough-tooltip-step {
  font-size: 0.85rem;
  color: var(--color-active, #9ef0f9);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.walkthrough-tooltip-close {
  background: transparent;
  border: none;
  color: #999;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}

.walkthrough-tooltip-close:hover {
  color: var(--color-subdued-white, #e0e0e0);
  background: rgba(255, 255, 255, 0.05);
}

/* Tooltip body */
.walkthrough-tooltip-body {
  padding: 24px;
}

.walkthrough-tooltip-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-subdued-white, #e0e0e0);
  margin: 0 0 12px 0;
}

.walkthrough-tooltip-content {
  font-size: 1rem;
  line-height: 1.6;
  color: #ccc;
  margin: 0;
}

/* Tooltip footer */
.walkthrough-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-top: 1px solid rgba(158, 240, 249, 0.2);
  background: rgba(0, 0, 0, 0.2);
}

.walkthrough-tooltip-progress {
  display: flex;
  gap: 6px;
  align-items: center;
}

.walkthrough-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(158, 240, 249, 0.3);
  transition: background 0.3s ease, transform 0.3s ease;
}

.walkthrough-progress-dot.active {
  background: var(--color-active, #9ef0f9);
  transform: scale(1.3);
}

.walkthrough-tooltip-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.walkthrough-btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
  text-transform: none;
  letter-spacing: normal;
}

.walkthrough-btn-skip {
  background: transparent;
  color: #999;
  border: 1px solid transparent;
}

.walkthrough-btn-skip:hover {
  color: var(--color-subdued-white, #e0e0e0);
  border-color: rgba(158, 240, 249, 0.3);
}

.walkthrough-btn-back {
  background: rgba(158, 240, 249, 0.1);
  color: var(--color-active, #9ef0f9);
  border: 1px solid rgba(158, 240, 249, 0.3);
}

.walkthrough-btn-back:hover {
  background: rgba(158, 240, 249, 0.2);
  border-color: rgba(158, 240, 249, 0.5);
}

.walkthrough-btn-next,
.walkthrough-btn-done {
  background: linear-gradient(135deg, var(--color-active, #9ef0f9), #06b6d4);
  color: #000;
  border: none;
  font-weight: 600;
}

.walkthrough-btn-next:hover,
.walkthrough-btn-done:hover {
  background: linear-gradient(135deg, #06b6d4, var(--color-active, #9ef0f9));
  box-shadow: 0 4px 12px rgba(158, 240, 249, 0.3);
}

/* Tooltip arrow (pointer) */
.walkthrough-tooltip-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  pointer-events: none;
}

/* Arrow pointing up (tooltip below element) */
.walkthrough-tooltip-arrow.top {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 12px 12px 12px;
  border-color: transparent transparent var(--color-active, #9ef0f9) transparent;
}

/* Arrow pointing down (tooltip above element) */
.walkthrough-tooltip-arrow.bottom {
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 12px 12px 0 12px;
  border-color: var(--color-active, #9ef0f9) transparent transparent transparent;
}

/* Arrow pointing left (tooltip to the right) */
.walkthrough-tooltip-arrow.left {
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 12px 12px 12px 0;
  border-color: transparent var(--color-active, #9ef0f9) transparent transparent;
}

/* Arrow pointing right (tooltip to the left) */
.walkthrough-tooltip-arrow.right {
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 12px 0 12px 12px;
  border-color: transparent transparent transparent var(--color-active, #9ef0f9);
}

/* ========== Replay Button in Saved Resources ========== */
.walkthrough-replay-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(158, 240, 249, 0.1), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(158, 240, 249, 0.3);
  border-radius: 8px;
  color: var(--color-active, #9ef0f9);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 16px 0;
  width: 100%;
  text-align: left;
}

.walkthrough-replay-btn:hover {
  background: linear-gradient(135deg, rgba(158, 240, 249, 0.2), rgba(6, 182, 212, 0.2));
  border-color: rgba(158, 240, 249, 0.5);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(158, 240, 249, 0.2);
}

.walkthrough-replay-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.walkthrough-replay-btn:hover .walkthrough-replay-icon {
  transform: rotate(360deg);
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
  .walkthrough-tooltip {
    max-width: calc(100vw - 32px);
    min-width: calc(100vw - 32px);
    left: 16px !important;
    right: 16px !important;
    width: calc(100vw - 32px) !important;
  }
  
  .walkthrough-tooltip-header,
  .walkthrough-tooltip-body,
  .walkthrough-tooltip-footer {
    padding: 16px 20px;
  }
  
  .walkthrough-tooltip-title {
    font-size: 1.1rem;
  }
  
  .walkthrough-tooltip-content {
    font-size: 0.95rem;
  }
  
  .walkthrough-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
  
  /* Hide arrows on mobile for simpler layout */
  .walkthrough-tooltip-arrow {
    display: none;
  }
}

/* ========== Accessibility ========== */
.walkthrough-tooltip:focus-visible,
.walkthrough-btn:focus-visible {
  outline: 2px solid var(--color-active, #9ef0f9);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .walkthrough-overlay,
  .walkthrough-tooltip,
  .walkthrough-highlight {
    transition: none;
    animation: none;
  }
  
  .walkthrough-highlight.pulse {
    animation: none;
  }
}

/* ========== Print Styles ========== */
@media print {
  .walkthrough-overlay,
  .walkthrough-tooltip,
  .walkthrough-highlight,
  .walkthrough-replay-btn {
    display: none !important;
  }
}
