/**
 * Tutorial UI styles
 * Responsive, clean, and accessible.
 */

.tutorial-container {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  pointer-events: none;
}

.tutorial-container.active {
  display: block;
}

.tutorial-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  animation: tutorialFadeIn 120ms ease-out;
}

.tutorial-spotlight {
  position: fixed;
  border: 3px solid #ffd95a;
  border-radius: 10px;
  box-shadow: 0 0 18px rgba(255, 217, 90, 0.45);
  transition: box-shadow 120ms ease, border-color 120ms ease;
  z-index: 9999;
  background: transparent;
}

.tutorial-spotlight.hidden {
  opacity: 0;
}

.tutorial-target-active {
  position: relative;
  z-index: 10000 !important;
}

.tutorial-tooltip {
  position: fixed;
  z-index: 10001;
  width: min(92vw, 360px);
  background: #ffffff;
  color: #1f2430;
  border: 1px solid #e9e6db;
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  padding: 14px 14px 12px;
  pointer-events: auto;
  animation: tutorialSlideIn 120ms ease;
}

.tooltip-content {
  margin-bottom: 12px;
}

.tooltip-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.tooltip-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #4a5261;
}

.tooltip-controls {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #f0ede5;
}

.tooltip-progress {
  text-align: center;
  color: #606b7b;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tooltip-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 120ms ease, opacity 120ms ease;
}

.tooltip-btn:focus-visible {
  outline: 2px solid #2c7dfa;
  outline-offset: 2px;
}

.tooltip-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.tooltip-btn.back-btn {
  background: #edf1f6;
  color: #253041;
}

.tooltip-btn.next-btn {
  background: linear-gradient(145deg, #ffdd6e, #ffc642);
  color: #272218;
}

.tooltip-btn.skip-btn {
  background: #f4f5f8;
  color: #475066;
}

.tooltip-btn:not([disabled]):hover {
  filter: brightness(0.98);
}

.tutorial-success-message {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 10002;
  max-width: min(86vw, 340px);
  background: #0d9b58;
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  font-size: 0.9rem;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

.tutorial-success-message.show {
  opacity: 1;
  transform: translateY(0);
}

.tutorial-start-btn {
  background: #5c4033;
  border: 2px solid #ffd700;
  color: #ffd700;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.22);
  transition: box-shadow 120ms ease;
}

.tutorial-start-btn:hover {
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.32);
}

.tutorial-start-btn.show {
  display: block !important;
}

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

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

@media (max-width: 768px) {
  .tutorial-tooltip {
    width: min(94vw, 420px);
    border-radius: 12px;
    padding: 12px;
  }

  .tooltip-controls {
    grid-template-columns: repeat(3, auto);
    justify-content: space-between;
  }

  .tooltip-progress {
    grid-column: 1 / -1;
    order: 4;
    margin-top: 2px;
  }

  .tutorial-start-btn {
    width: 44px;
    height: 44px;
    font-size: 20px;
    bottom: 16px;
    right: 16px;
  }
}

/* Tutorial completion dialog */
.tutorial-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 10002;
  text-align: center;
}

.tutorial-dialog h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  color: #1f2430;
}

.tutorial-dialog p {
  margin: 8px 0;
  color: #4a5261;
  line-height: 1.5;
}

.tutorial-dialog-buttons {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.tutorial-dialog-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 100ms ease;
}

.tutorial-dialog-btn.primary {
  background: linear-gradient(145deg, #ffdd6e, #ffc642);
  color: #272218;
}

.tutorial-dialog-btn:hover {
  transform: translateY(-1px);
}

