/**
 * modules/tutorials/assets/tutorials.css
 *
 * Video tutorials module styling.
 * Scoped with tutorial-* prefixes to avoid colliding with core classes.
 */

/* Responsive 16:9 Video Embed Player */
.tutorial-player-wrapper {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #000;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.tutorial-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.tutorial-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Tutorial Cards & Thumbnail */
.tutorial-thumb-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: hsl(var(--muted));
    overflow: hidden;
    border-top-left-radius: calc(var(--radius) - 2px);
    border-top-right-radius: calc(var(--radius) - 2px);
}

.tutorial-thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease-in-out;
}

.tutorial-card:hover .tutorial-thumb-container img {
    transform: scale(1.03);
}

.tutorial-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.tutorial-card:hover .tutorial-play-overlay {
    opacity: 1;
}

.tutorial-play-overlay svg {
    width: 3rem;
    height: 3rem;
    color: white;
    drop-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tutorial-card:hover .tutorial-play-overlay svg {
    transform: scale(1);
}

.tutorial-duration-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    letter-spacing: 0.025em;
    pointer-events: none;
}

.tutorial-level-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    line-height: 1.25;
}

.tutorial-level-all {
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
}

.tutorial-level-beginner {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.tutorial-level-intermediate {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.tutorial-level-advanced {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Prose measure per AGENTS.md rule 6 (72ch measure on rendered text) */
.tutorial-prose {
    max-width: 72ch;
    line-height: 1.625;
    color: hsl(var(--foreground));
}

.tutorial-prose p {
    margin-bottom: 1rem;
}

.tutorial-prose h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.tutorial-prose h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.tutorial-prose ul, .tutorial-prose ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.tutorial-prose ul {
    list-style-type: disc;
}

.tutorial-prose ol {
    list-style-type: decimal;
}

.tutorial-prose code {
    font-size: 0.875em;
    background-color: hsl(var(--muted));
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

.tutorial-prose pre {
    background-color: hsl(var(--muted));
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.tutorial-prose strong {
    font-weight: 600;
}

/**
 * Distraction-free course player shell (pageChrome = 'minimal').
 *
 * Fixed-height flex column: a dark top bar, then a sidebar + main pane that
 * each scroll independently. Hardcoded colors rather than `dark:` utilities
 * because the app itself is light-only (AGENTS.md rule 5) — this one bar is a
 * deliberate exception, not a dark mode.
 */
.tutorial-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: hsl(var(--background));
}

.tutorial-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.625rem 1rem;
    background-color: #14171f;
    color: #e7e9ee;
    flex-shrink: 0;
}

.tutorial-topbar-group {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.tutorial-topbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    color: #c4cad6;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.tutorial-topbar-icon:hover,
.tutorial-topbar[open] .tutorial-topbar-icon {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tutorial-topbar-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #aeb4c2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.tutorial-topbar-menu {
    right: 0;
    left: auto;
    margin-top: 0.5rem;
}

.tutorial-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.tutorial-sidebar {
    width: 320px;
    flex-shrink: 0;
    overflow-y: auto;
    background-color: hsl(var(--background));
    border-right: 1px solid hsl(var(--border));
}

@media (max-width: 900px) {
    .tutorial-sidebar {
        display: none;
    }
}

.tutorial-sidebar-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    border-left: 3px solid transparent;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.35;
}

.tutorial-sidebar-item:hover {
    background-color: hsl(var(--muted) / 0.6);
    color: hsl(var(--foreground));
}

.tutorial-sidebar-item.is-current {
    background-color: hsl(var(--primary) / 0.08);
    border-left-color: hsl(var(--primary));
    color: hsl(var(--foreground));
    font-weight: 600;
}

.tutorial-outline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    border-radius: 9999px;
    border: 1.5px solid hsl(var(--border));
    font-size: 0.65rem;
    line-height: 1;
    flex-shrink: 0;
    color: transparent;
}

.tutorial-outline-icon.is-current {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.15);
}

.tutorial-outline-icon.is-done {
    border-color: hsl(var(--success));
    background-color: hsl(var(--success));
    color: hsl(var(--success-foreground));
}

.tutorial-main {
    flex: 1 1 auto;
    overflow-y: auto;
    min-width: 0;
}