/* ═══════════════════════════════════════════════════════════════════════
    Cognotik Video Tour — tour-specific styles
    Extends /assets/styles/main.css. All colors, radii, shadows, motion and
    typography come from main.css design tokens; this file only maps them
    onto tour components and defines the few primitives (.container, .btn)
    the tour markup relies on.
    ═══════════════════════════════════════════════════════════════════════ */

/* ── Tour-local tokens, mapped onto main.css tokens ────────────────── */
:root {
     --tour-sidebar-width: 260px;
     --tour-progress-height: 4px;

     /* Chrome offsets: menubar height comes from menubar.css */
     --tour-menubar-height: var(--mb-height, 56px);
     --tour-navbar-height: 48px;

     --tour-surface-hover: var(--surface-hover);
     --tour-surface-active: var(--surface-2);
     --tour-border-light: var(--border-strong);
     --tour-text-dim: var(--text-faint);
     --tour-accent-glow: rgba(139, 92, 246, 0.18);
     --tour-overlay-bg: color-mix(in srgb, var(--bg) 88%, transparent);
}

/* ── Shared primitives (previously supplied by the legacy site CSS) ── */
.container {
     width: 100%;
     max-width: var(--content-width);
     margin: 0 auto;
     padding: 0 clamp(1.1rem, 4vw, 2.5rem);
}

.btn {
     display: inline-flex;
     align-items: center;
     justify-content: center;
     gap: 0.5rem;
     padding: 0.65rem 1.25rem;
     font-family: var(--font-sans);
     font-size: 0.95rem;
     font-weight: 600;
     line-height: 1.2;
     border: 1px solid transparent;
     border-radius: var(--radius-sm);
     cursor: pointer;
     text-decoration: none;
     transition: transform var(--fast) var(--ease),
                 box-shadow var(--med) var(--ease),
                 background var(--med) var(--ease),
                 border-color var(--med) var(--ease),
                 color var(--fast) var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
     background: var(--gradient);
     color: #08091a;
     box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover { box-shadow: 0 10px 28px rgba(139, 92, 246, 0.5); }

.btn-secondary {
     background: var(--surface);
     color: var(--text);
     border-color: var(--border-strong);
}

.btn-secondary:hover {
     background: var(--surface-hover);
     border-color: var(--primary);
}

.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.02rem; }

/* ── App wrapper ───────────────────────────────────────────────────── */
#app {
     min-height: calc(100vh - var(--tour-menubar-height));
}

/* ── Tour Nav Bar (sits below the sticky site menubar) ─────────────── */
#tour-nav-bar {
     position: sticky;
     top: var(--tour-menubar-height);
     z-index: 800;
     background: color-mix(in srgb, var(--bg) 88%, transparent);
     -webkit-backdrop-filter: blur(12px) saturate(140%);
     backdrop-filter: blur(12px) saturate(140%);
     border-bottom: 1px solid var(--border);
     box-shadow: var(--shadow-sm);
}

.tour-nav-inner {
     height: var(--tour-navbar-height);
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 1rem;
}

.tour-nav-title {
     font-family: var(--font-sans);
     font-size: 0.85rem;
     font-weight: 700;
     color: var(--text-muted);
     letter-spacing: 0.06em;
     text-transform: uppercase;
}

#header-nav {
     display: flex;
     gap: 8px;
}

.nav-btn {
     display: inline-flex;
     align-items: center;
     gap: 6px;
     padding: 6px 14px;
     background: transparent;
     color: var(--text-muted);
     border: 1px solid var(--border);
     border-radius: var(--radius-sm);
     font-size: 0.85rem;
     font-family: var(--font-sans);
     cursor: pointer;
     transition: all var(--fast) var(--ease);
}

.nav-btn:hover {
     color: var(--text);
     background: var(--tour-surface-hover);
     border-color: var(--tour-border-light);
     text-decoration: none;
}

.nav-btn svg { flex-shrink: 0; }

/* ── Progress Bar ──────────────────────────────────────────────────── */
#tour-progress {
     position: relative;
     height: var(--tour-progress-height);
     background: var(--surface);
     z-index: 799;
}

#tour-progress-bar {
     height: 100%;
     width: 0;
     background: var(--gradient);
     transition: width var(--med) var(--ease);
}

#tour-progress-steps {
     position: absolute;
     top: 50%;
     left: 0;
     right: 0;
     transform: translateY(-50%);
     display: flex;
     justify-content: space-between;
     padding: 0 48px;
     pointer-events: none;
}

.progress-step {
     width: 12px;
     height: 12px;
     border-radius: 50%;
     background: var(--border-strong);
     border: 2px solid var(--surface);
     cursor: pointer;
     pointer-events: auto;
     transition: all var(--fast) var(--ease);
     padding: 0;
}

.progress-step:hover {
     background: var(--primary);
     transform: scale(1.3);
}

.progress-step.active {
     background: var(--primary);
     box-shadow: 0 0 10px var(--tour-accent-glow);
}

.progress-step.completed { background: var(--primary-3); }

/* ── Panels ────────────────────────────────────────────────────────── */
.panel { display: none; }
.panel.active { display: block; }

/* ── Overview Panel ────────────────────────────────────────────────── */
#overview-panel {
     max-width: var(--content-width);
     margin: 0 auto;
     padding: 48px clamp(1.1rem, 4vw, 2.5rem) 80px;
}

.overview-intro {
     text-align: center;
     margin-bottom: 48px;
}

.section-title {
     font-size: clamp(1.6rem, 2.4vw + 1rem, 2.4rem);
     font-weight: 800;
     letter-spacing: -0.02em;
     line-height: 1.15;
     margin-bottom: 0.75rem;
     background: var(--gradient);
     -webkit-background-clip: text;
     background-clip: text;
     color: transparent;
}

.overview-intro p {
     color: var(--text-muted);
     font-size: 1.05rem;
     max-width: 68ch;
     margin: 0 auto;
}

.overview-intro p strong { color: var(--text); font-weight: 700; }

.overview-grid {
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
     gap: 20px;
}

/* ── Premium Banner ────────────────────────────────────────────────── */
.premium-banner {
     background: var(--gradient-soft);
     border: 1px solid rgba(139, 92, 246, 0.3);
     border-radius: var(--radius);
     padding: 1.25rem 1.5rem;
     margin-bottom: 1.75rem;
     display: flex;
     align-items: flex-start;
     gap: 1rem;
     flex-wrap: wrap;
     text-align: left;
}

.premium-badge {
     display: inline-flex;
     align-items: center;
     gap: 0.4rem;
     background: var(--gradient);
     color: #08091a;
     font-size: 0.78rem;
     font-weight: 800;
     padding: 0.32rem 0.85rem;
     border-radius: 2rem;
     text-transform: uppercase;
     letter-spacing: 0.05em;
     white-space: nowrap;
     flex-shrink: 0;
}

.premium-text {
     color: var(--text-muted);
     font-size: 0.95rem;
     line-height: 1.6;
     margin: 0;
     flex: 1;
     min-width: 220px;
}

.premium-text strong { color: var(--text); }

.premium-text a {
     color: var(--primary-2);
     font-weight: 600;
     text-decoration: underline;
     text-underline-offset: 2px;
}

.premium-text a:hover { color: #fff; }

/* ── Overview Card ─────────────────────────────────────────────────── */
.overview-card {
     display: flex;
     align-items: flex-start;
     gap: 16px;
     padding: 20px;
     background: linear-gradient(180deg, var(--surface), var(--surface-2));
     border: 1px solid var(--border);
     border-radius: var(--radius-lg);
     cursor: pointer;
     transition: transform var(--med) var(--ease),
                 box-shadow var(--med) var(--ease),
                 border-color var(--med) var(--ease);
     position: relative;
     overflow: hidden;
     text-decoration: none;
     color: var(--text);
     text-align: left;
}

.overview-card::before {
     content: "";
     position: absolute;
     inset: 0;
     background: linear-gradient(135deg, var(--tour-accent-glow), transparent);
     opacity: 0;
     transition: opacity var(--med) var(--ease);
     pointer-events: none;
}

.overview-card:hover,
.overview-card:focus-visible {
     border-color: rgba(139, 92, 246, 0.45);
     box-shadow: var(--shadow);
     transform: translateY(-4px);
}

.overview-card:hover::before,
.overview-card:focus-visible::before { opacity: 1; }

.overview-card:focus-visible {
     outline: 2px solid var(--primary-2);
     outline-offset: 3px;
}

.card-icon {
     font-size: 2rem;
     flex-shrink: 0;
     width: 48px;
     height: 48px;
     display: flex;
     align-items: center;
     justify-content: center;
     background: var(--tour-surface-hover);
     border-radius: var(--radius);
     position: relative;
     z-index: 1;
}

.card-body {
     flex: 1;
     min-width: 0;
     position: relative;
     z-index: 1;
}

.card-title {
     font-size: 1.05rem;
     font-weight: 700;
     margin-bottom: 6px;
     font-family: var(--font-sans);
     color: var(--text);
}

.card-description {
     font-size: 0.88rem;
     color: var(--text-muted);
     line-height: 1.55;
     margin-bottom: 10px;
     display: -webkit-box;
     -webkit-line-clamp: 3;
     -webkit-box-orient: vertical;
     overflow: hidden;
}

.card-badge {
     display: inline-block;
     font-size: 0.7rem;
     text-transform: uppercase;
     letter-spacing: 0.08em;
     color: var(--text-faint);
     background: var(--tour-surface-hover);
     padding: 3px 8px;
     border-radius: var(--radius-sm);
}

.card-play {
     flex-shrink: 0;
     color: var(--primary-2);
     opacity: 0;
     transform: translateX(-8px);
     transition: all var(--med) var(--ease);
     position: relative;
     z-index: 1;
     align-self: center;
}

.overview-card:hover .card-play {
     opacity: 1;
     transform: translateX(0);
}

/* ── Player Panel ──────────────────────────────────────────────────── */
.player-layout {
     display: flex;
     min-height: calc(100vh
         - var(--tour-menubar-height)
         - var(--tour-navbar-height)
         - var(--tour-progress-height));
}

/* ── Chapter Sidebar ───────────────────────────────────────────────── */
#chapter-sidebar {
     width: var(--tour-sidebar-width);
     flex-shrink: 0;
     background: var(--surface);
     border-right: 1px solid var(--border);
     padding: 20px 0;
     overflow-y: auto;
}

#chapter-sidebar h3 {
     font-size: 0.75rem;
     text-transform: uppercase;
     letter-spacing: 0.1em;
     color: var(--tour-text-dim);
     padding: 0 20px;
     margin-bottom: 12px;
     font-family: var(--font-sans);
     font-weight: 700;
}

#chapter-list {
     list-style: none;
     padding: 0;
     margin: 0;
}

.chapter-item {
     display: flex;
     align-items: center;
     gap: 10px;
     padding: 10px 20px;
     cursor: pointer;
     transition: all var(--fast) var(--ease);
     border-left: 3px solid transparent;
     font-size: 0.9rem;
     color: var(--text-muted);
     font-family: var(--font-sans);
}

.chapter-item:hover {
     background: var(--tour-surface-hover);
     color: var(--text);
}

.chapter-item.active {
     background: var(--tour-surface-active);
     color: var(--text);
     border-left-color: var(--primary);
}

.chapter-item:focus-visible {
     outline: 2px solid var(--primary-2);
     outline-offset: -2px;
}

.chapter-icon { font-size: 1.1rem; flex-shrink: 0; }

.chapter-name {
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
}

/* ── Player Main ───────────────────────────────────────────────────── */
.player-main {
     flex: 1;
     min-width: 0;
     display: flex;
     flex-direction: column;
}

#player-panel .video-container {
     position: relative;
     background: #000;
     aspect-ratio: 16 / 9;
     max-height: 65vh;
     width: 100%;
}

#player-panel .video-container video {
     width: 100%;
     height: 100%;
     display: block;
     object-fit: contain;
     background: #000;
}

/* ── Video Overlay ─────────────────────────────────────────────────── */
.video-overlay {
     position: absolute;
     inset: 0;
     background: var(--tour-overlay-bg);
     display: flex;
     align-items: center;
     justify-content: center;
     z-index: 10;
     animation: tourFadeIn 300ms var(--ease);
}

.video-overlay.hidden { display: none; }

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

.overlay-content {
     text-align: center;
     max-width: 420px;
     padding: 32px;
     background: linear-gradient(180deg, var(--surface), var(--surface-2));
     border: 1px solid var(--border);
     border-radius: var(--radius-lg);
     box-shadow: var(--shadow-lg);
}

.overlay-content h3 {
     font-size: 1.4rem;
     margin-bottom: 0.6rem;
     color: var(--text);
}

.overlay-content p {
     color: var(--text-muted);
     margin-bottom: 1.5rem;
     font-size: 0.95rem;
}

.overlay-actions {
     display: flex;
     gap: 12px;
     justify-content: center;
}

/* ── Icon button ───────────────────────────────────────────────────── */
.btn-icon {
     width: 36px;
     height: 36px;
     padding: 0;
     background: var(--surface);
     color: var(--text-muted);
     border: 1px solid var(--border);
     border-radius: var(--radius-sm);
     cursor: pointer;
     display: inline-flex;
     align-items: center;
     justify-content: center;
     transition: all var(--fast) var(--ease);
}

.btn-icon:hover:not(:disabled) {
     color: var(--text);
     background: var(--tour-surface-active);
     border-color: var(--tour-border-light);
     transform: none;
}

.btn-icon:disabled {
     opacity: 0.3;
     cursor: not-allowed;
     transform: none;
}

/* ── Player Info ───────────────────────────────────────────────────── */
.player-info {
     padding: 24px 32px 40px;
     flex: 1;
     background: var(--bg);
}

.player-info-header {
     display: flex;
     align-items: flex-start;
     justify-content: space-between;
     gap: 24px;
     margin-bottom: 1rem;
}

.player-info-header h2 {
     font-size: 1.5rem;
     font-weight: 750;
     letter-spacing: -0.01em;
}

.description {
     color: var(--text-muted);
     margin-top: 6px;
     font-size: 0.95rem;
}

.player-controls {
     display: flex;
     align-items: center;
     gap: 10px;
     flex-shrink: 0;
}

.chapter-indicator {
     font-size: 0.8rem;
     color: var(--tour-text-dim);
     font-variant-numeric: tabular-nums;
     min-width: 48px;
     text-align: center;
     font-family: var(--font-mono);
}

/* ── Transcript ────────────────────────────────────────────────────── */
.transcript-panel {
     border: 1px solid var(--border);
     border-radius: var(--radius);
     overflow: hidden;
}

.transcript-panel summary {
     display: flex;
     align-items: center;
     gap: 8px;
     padding: 12px 16px;
     background: var(--surface);
     cursor: pointer;
     font-size: 0.85rem;
     font-weight: 600;
     font-family: var(--font-sans);
     color: var(--text-muted);
     transition: all var(--fast) var(--ease);
     user-select: none;
     list-style: none;
}

.transcript-panel summary::-webkit-details-marker { display: none; }

.transcript-panel summary:hover {
     color: var(--text);
     background: var(--tour-surface-hover);
}

.transcript-panel summary svg { flex-shrink: 0; }

.transcript-panel[open] summary { border-bottom: 1px solid var(--border); }

.transcript-content {
     padding: 20px;
     max-height: 300px;
     overflow-y: auto;
     font-size: 0.9rem;
     line-height: 1.7;
     color: var(--text-muted);
     background: var(--bg-alt);
}

.transcript-content p { margin-bottom: 12px; }
.transcript-content p:last-child { margin-bottom: 0; }
.transcript-content strong { color: var(--text); }
.transcript-content a { color: var(--primary-2); }

.transcript-placeholder {
     font-style: italic;
     color: var(--tour-text-dim);
}

/* ── Premium CTA Section ───────────────────────────────────────────── */
.premium-cta-section {
     background: linear-gradient(180deg, var(--surface-2) 0%, var(--bg) 100%);
     border-top: 1px solid rgba(139, 92, 246, 0.2);
     padding: 4rem 0;
}

.premium-cta-inner {
     max-width: 700px;
     margin: 0 auto;
     text-align: center;
}

.premium-cta-inner h2 {
     font-family: var(--font-sans);
     font-size: clamp(1.8rem, 3.5vw, 2.4rem);
     font-weight: 800;
     letter-spacing: -0.02em;
     background: var(--gradient);
     -webkit-background-clip: text;
     background-clip: text;
     color: transparent;
     margin-bottom: 1rem;
}

.premium-cta-inner > p {
     color: var(--text-muted);
     font-size: 1.05rem;
     line-height: 1.7;
     margin-bottom: 1.5rem;
}

.premium-cta-inner > p strong { color: var(--text); }

.premium-perks {
     list-style: none;
     padding: 0;
     margin: 0 auto 2rem;
     display: inline-flex;
     flex-direction: column;
     gap: 0.6rem;
     text-align: left;
}

.premium-perks li {
     color: var(--text-muted);
     font-size: 1rem;
     display: flex;
     align-items: center;
     gap: 0.6rem;
}

.premium-perks li svg {
     color: var(--primary-3);
     flex-shrink: 0;
}

.premium-cta-buttons {
     display: flex;
     justify-content: center;
     gap: 1rem;
     flex-wrap: wrap;
     margin-bottom: 1.5rem;
}

.premium-cta-note {
     color: var(--text-faint);
     font-size: 0.88rem;
     font-style: italic;
     margin: 0;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
     #chapter-sidebar { display: none; }
     .player-layout { flex-direction: column; }
}

@media (max-width: 768px) {
     .overview-grid { grid-template-columns: 1fr; }
     #overview-panel { padding: 32px 16px 60px; }
     .player-info { padding: 20px 16px 32px; }

     .player-info-header {
         flex-direction: column;
         gap: 12px;
     }

     .player-info-header h2 { font-size: 1.2rem; }

     .nav-btn span { display: none; }
     .nav-btn { padding: 8px; }

     #tour-progress-steps { padding: 0 16px; }
     #player-panel .video-container { max-height: none; }
}

@media (max-width: 480px) {
     .overview-card { padding: 16px; }
     .card-play { display: none; }
}

/* ── Motion preferences (main.css already neutralises transitions) ─── */
@media (prefers-reduced-motion: reduce) {
     .overview-card:hover,
     .btn:hover { transform: none; }
}