/* ═══════════════════════════════════════════════════════════════════════
   Tabla I/O — Onboarding Tutorial Popup & Help Button Styles
   File: css/tutorial-popup.css
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── 1. Popup Overlay ──────────────────────────────────────────────── */
.tutorial-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10050;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s ease;
  padding: 16px;
}

.tutorial-overlay.active {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ─── 2. Popup Card ─────────────────────────────────────────────────── */
.tutorial-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--bg-surface, var(--bg-card, var(--bg-primary, #0d0d0d)));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45),
              0 0 30px rgba(234, 101, 0, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto;
}

.tutorial-overlay.active .tutorial-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ─── 3. Popup Header ───────────────────────────────────────────────── */
.tutorial-header {
  padding: 24px 24px 16px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}

.tutorial-header-icon,
.tutorial-header .tutorial-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle, rgba(234, 101, 0, 0.12));
  border-radius: 50%;
  color: var(--accent, #ea6500);
  box-shadow: 0 0 20px rgba(234, 101, 0, 0.15);
  line-height: 1;
}

.tutorial-header h2,
.tutorial-header-title,
.tutorial-title {
  margin: 0;
  font-family: 'Outfit', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary, #f0f0f0);
  letter-spacing: -0.01em;
  line-height: 1.3;
}


.tutorial-header p,
.tutorial-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary, #888888);
  line-height: 1.4;
}

/* Optional Close Icon Button in top-right of card */
.tutorial-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-tertiary, #555555);
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  line-height: 1;
}

.tutorial-close-btn:hover {
  color: var(--text-primary, #f0f0f0);
  background: var(--bg-tertiary, #111111);
}

/* ─── 3.5 Tabs ──────────────────────────────────────────────────────── */
.tutorial-tabs {
  display: flex;
  margin: 0 24px 16px 24px;
  gap: 8px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  padding-bottom: 8px;
}

.tutorial-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary, #666);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tutorial-tab-btn:hover {
  background: var(--bg-tertiary, rgba(255, 255, 255, 0.05));
  color: var(--text-secondary, #aaa);
}

.tutorial-tab-btn.active {
  background: var(--accent-subtle, rgba(234, 101, 0, 0.15));
  color: var(--accent, #ea6500);
}

/* ─── 4. Popup Body ─────────────────────────────────────────────────── */
.tutorial-body {
  padding: 0 24px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color, rgba(255, 255, 255, 0.15)) transparent;
}

.tutorial-body::-webkit-scrollbar {
  width: 6px;
}

.tutorial-body::-webkit-scrollbar-track {
  background: transparent;
}

.tutorial-body::-webkit-scrollbar-thumb {
  background: var(--border-color, rgba(255, 255, 255, 0.15));
  border-radius: 3px;
}

/* Feature Blocks */
.tutorial-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-secondary, #0a0a0a);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.tutorial-feature:hover {
  background: var(--bg-tertiary, #111111);
  border-color: rgba(234, 101, 0, 0.25);
  transform: translateY(-1px);
}

.tutorial-feature-icon {
  font-size: 1.15rem;
  font-weight: 700;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle, rgba(234, 101, 0, 0.12));
  color: var(--accent, #ea6500);
  border-radius: 8px;
  flex-shrink: 0;
}

.tutorial-feature-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tutorial-feature-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #f0f0f0);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.tutorial-feature-desc,
.tutorial-feature-description {
  font-size: 0.85rem;
  color: var(--text-secondary, #888888);
  line-height: 1.45;
  margin: 0;
}

/* Keyboard Shortcut Badges */
.tutorial-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-subtle, rgba(234, 101, 0, 0.15));
  color: var(--accent, #ea6500);
  border: 1px solid var(--accent, #ea6500);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  line-height: 1.2;
  vertical-align: middle;
  letter-spacing: -0.02em;
}

/* Divider Line */
.tutorial-divider {
  height: 1px;
  width: 100%;
  background: var(--border-color, rgba(255, 255, 255, 0.08));
  border: none;
  margin: 4px 0;
  flex-shrink: 0;
}

/* ─── 5. Popup Footer ───────────────────────────────────────────────── */
.tutorial-footer {
  padding: 16px 24px 24px 24px;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  background: var(--bg-secondary, #0a0a0a);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tutorial-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary, #888888);
  user-select: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.tutorial-checkbox-row:hover {
  color: var(--text-primary, #f0f0f0);
}

.tutorial-checkbox-row input[type="checkbox"],
.tutorial-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  min-height: 16px !important;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.2));
  border-radius: 4px;
  background: var(--bg-tertiary, #111111);
  cursor: pointer;
  position: relative;
  outline: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
}

.tutorial-checkbox-row input[type="checkbox"]:checked,
.tutorial-checkbox:checked {
  background: var(--accent, #ea6500);
  border-color: var(--accent, #ea6500);
}

.tutorial-checkbox-row input[type="checkbox"]:checked::after,
.tutorial-checkbox:checked::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  display: block;
}

.tutorial-checkbox-row input[type="checkbox"]:focus-visible,
.tutorial-checkbox:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-subtle, rgba(234, 101, 0, 0.3));
}

/* Footer Action Buttons Container */
.tutorial-footer-actions,
.tutorial-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: 100%;
}

/* Secondary / Skip Button */
.tutorial-btn-skip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary, #888888);
  background: transparent;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.tutorial-btn-skip:hover {
  color: var(--text-primary, #f0f0f0);
  background: var(--bg-tertiary, #111111);
  border-color: var(--text-secondary, #888888);
}

.tutorial-btn-skip:active {
  transform: translateY(0);
}

/* Primary / OK Button */
.tutorial-btn-ok {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: var(--accent, #ea6500);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(234, 101, 0, 0.25);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.tutorial-btn-ok:hover {
  background: var(--accent-hover, #f97316);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(234, 101, 0, 0.35);
}

.tutorial-btn-ok:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(234, 101, 0, 0.2);
}

/* ─── 6. Help Icon Button ───────────────────────────────────────────── */
.tutorial-help-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary, #0a0a0a);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  color: var(--text-secondary, #888888);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
  outline: none;
  text-decoration: none;
  margin: 0;
}

.tutorial-help-btn:hover {
  border-color: var(--accent, #ea6500);
  color: var(--accent, #ea6500);
  background: var(--accent-subtle, rgba(234, 101, 0, 0.1));
  box-shadow: 0 0 10px rgba(234, 101, 0, 0.35);
  transform: scale(1.06);
}

.tutorial-help-btn:focus-visible {
  outline: 2px solid var(--accent, #ea6500);
  outline-offset: 2px;
}

.tutorial-help-btn:active {
  transform: scale(0.96);
}

/* ─── 7. Mobile Responsiveness (<500px) ────────────────────────────── */
@media (max-width: 500px) {
  .tutorial-overlay {
    padding: 12px;
  }

  .tutorial-card {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
  }

  .tutorial-header {
    padding: 20px 16px 12px 16px;
    gap: 8px;
  }

  .tutorial-header-icon,
  .tutorial-header .tutorial-icon {
    width: 40px;
    height: 40px;
    font-size: 1.6rem;
  }

  .tutorial-header h2,
  .tutorial-header-title,
  .tutorial-title {
    font-size: 1.2rem;
  }

  .tutorial-body {
    padding: 0 16px 16px 16px;
    max-height: 55vh;
    gap: 10px;
  }

  .tutorial-feature {
    padding: 10px 12px;
    gap: 10px;
  }

  .tutorial-feature-icon {
    min-width: 32px;
    height: 32px;
    font-size: 1.1rem;
  }

  .tutorial-feature-title {
    font-size: 0.9rem;
  }

  .tutorial-feature-desc,
  .tutorial-feature-description {
    font-size: 0.8rem;
  }

  .tutorial-footer {
    padding: 14px 16px 18px 16px;
    gap: 14px;
  }

  .tutorial-footer-actions,
  .tutorial-actions {
    gap: 8px;
  }

  .tutorial-btn-ok,
  .tutorial-btn-skip {
    padding: 9px 14px;
    font-size: 0.85rem;
  }
}

/* ─── 8. Accessibility (Reduced Motion) ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .tutorial-overlay,
  .tutorial-card,
  .tutorial-feature,
  .tutorial-btn-ok,
  .tutorial-btn-skip,
  .tutorial-help-btn {
    transition: none !important;
    animation: none !important;
  }
}
