/**
 * vim: et:ts=4:sw=4:sts=4
 *
 * LICENSE: GNU Affero General Public License, version 3 (AGPL-3.0-or-later)
 * Copyright 2023-2026 Josh Y Oshiro
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 */

#tutorial-launch-row {
  width: min(1200px, 100%);
  display: flex;
  justify-content: center;
}

#tutorial-open-btn {
  min-width: 240px;
  font-size: 1rem;
}

body.tutorial-open {
  overflow: hidden;
}

#tutorial-overlay[hidden] {
  display: none !important;
}

#tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 10, 15, 0.86);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: tutorialFadeIn 180ms ease;
}

#tutorial-overlay.closing {
  animation: tutorialFadeOut 180ms ease;
}

.tutorial-dialog {
  width: min(1180px, 100%);
  height: min(92vh, 900px);
  background: linear-gradient(180deg, #171b24 0%, #0f131a 100%);
  border: 1px solid #394356;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tutorial-header,
.tutorial-footer {
  padding: 14px 18px;
  border-bottom: 1px solid #283243;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tutorial-footer {
  border-bottom: 0;
  border-top: 1px solid #283243;
  justify-content: space-between;
}

.tutorial-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tutorial-kicker {
  color: #8aa2d3;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tutorial-title {
  font-size: 1.45rem;
  font-weight: 700;
}

.tutorial-slide-counter {
  margin-left: auto;
  color: #b9c2d6;
  font-size: 0.92rem;
}

.tutorial-close {
  margin-left: 0;
}

.tutorial-body {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 0;
}

.tutorial-sidebar {
  border-right: 1px solid #283243;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

.tutorial-chip,
.tutorial-branch-btn,
.tutorial-nav-btn,
.tutorial-close {
  background: #263143;
  color: #eef3ff;
  border: 1px solid #44526a;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.tutorial-chip:hover,
.tutorial-branch-btn:hover,
.tutorial-nav-btn:hover,
.tutorial-close:hover {
  background: #314159;
}

.tutorial-chip {
  text-align: left;
}

.tutorial-main {
  padding: 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tutorial-copy {
  max-width: 72ch;
  font-size: 1.02rem;
  line-height: 1.6;
  color: #e5e9f3;
}

.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.tutorial-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.tutorial-visual-card,
.tutorial-metric-card,
.tutorial-live-status {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #2f3a4c;
  border-radius: 16px;
  padding: 14px;
}

.tutorial-visual-title,
.tutorial-metric-label {
  color: #91a8d7;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.tutorial-metric-value,
.tutorial-big-score {
  font-size: 1.3rem;
  font-weight: 700;
}

.tutorial-big-score {
  font-size: 3rem;
}

.tutorial-note {
  margin-top: 10px;
  color: #c5cfe2;
  line-height: 1.5;
}

.tutorial-placeholder {
  min-height: 180px;
  border: 1px dashed #4d5c79;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  color: #bcc8de;
}

.tutorial-screenshot {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid #3a4659;
}

.tutorial-svg {
  width: 100%;
  height: auto;
}

.tutorial-svg circle,
.tutorial-svg line {
  stroke: #98b5ff;
  stroke-width: 3;
  fill: rgba(152, 181, 255, 0.16);
}

.tutorial-search-branch,
.tutorial-search-leaf {
  opacity: 0;
  animation: tutorialReveal 1.3s ease forwards;
}

.tutorial-search-node-root {
  animation: tutorialPulse 1.6s ease-in-out infinite;
}

.tutorial-delay-1 { animation-delay: 0.10s; }
.tutorial-delay-2 { animation-delay: 0.20s; }
.tutorial-delay-3 { animation-delay: 0.30s; }
.tutorial-delay-4 { animation-delay: 0.40s; }
.tutorial-delay-5 { animation-delay: 0.50s; }
.tutorial-delay-6 { animation-delay: 0.60s; }
.tutorial-delay-7 { animation-delay: 0.70s; }
.tutorial-delay-8 { animation-delay: 0.80s; }
.tutorial-delay-9 { animation-delay: 0.90s; }

.tutorial-trend-line,
.tutorial-trend-shadow {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tutorial-trend-line {
  stroke: #8eb0ff;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: tutorialDraw 2.2s ease forwards;
}

.tutorial-trend-shadow {
  stroke: rgba(142, 176, 255, 0.2);
}

.tutorial-pipeline-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tutorial-pipeline-step {
  background: #20293a;
  border: 1px solid #3b4962;
  border-radius: 999px;
  padding: 10px 14px;
}

.tutorial-pipeline-arrow {
  color: #9eb7eb;
  font-size: 1.35rem;
  animation: tutorialPulse 1.2s ease-in-out infinite;
}

.tutorial-nn-stack {
  display: grid;
  gap: 10px;
}

.tutorial-nn-layer {
  padding: 12px 14px;
  background: linear-gradient(90deg, #20293a, #2c3b56);
  border-radius: 12px;
  border: 1px solid #44526e;
}

.tutorial-orbit-wrap {
  min-height: 220px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-orbit {
  position: absolute;
  border: 1px solid #536584;
  border-radius: 999px;
}

.tutorial-orbit-a {
  width: 180px;
  height: 180px;
  animation: tutorialSpin 8s linear infinite;
}

.tutorial-orbit-b {
  width: 110px;
  height: 110px;
  animation: tutorialSpinReverse 5.5s linear infinite;
}

.tutorial-orbit-center {
  width: 90px;
  height: 90px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a3550;
  border: 1px solid #5b6e94;
  font-weight: 700;
}

.tutorial-branch-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tutorial-nav-group {
  display: flex;
  gap: 10px;
}

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

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

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

@keyframes tutorialDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes tutorialPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.75; }
}

@keyframes tutorialSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes tutorialSpinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@media (max-width: 900px) {
  .tutorial-body {
    grid-template-columns: 1fr;
  }

  .tutorial-sidebar {
    border-right: 0;
    border-bottom: 1px solid #283243;
  }

  .tutorial-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .tutorial-nav-group {
    width: 100%;
  }

  .tutorial-nav-group button {
    flex: 1 1 0;
  }
}
