/* ── Design Tokens (Aligned with InstructionDesigner.html) ── */
:root {
    --magenta: #B71B9E;
    --magenta-soft: #fdf2fa;
    --midnight: #00195E;
    --midnight-deep: #0a1647;
    --orange: #FF9900;
    --orange-soft: #fff7e6;
    --bg: #f0f2f5;
    --card: #ffffff;
    --card-border: #e2e8f0;
    --text: #1a1a2e;
    --muted: #64748b;
    --radius: 1.25rem;
    --shadow: 0 10px 30px rgba(0, 25, 94, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

h1,
h2,
h3,
.topbar-title,
.info-label,
.slide-number,
.info-title {
    font-family: 'Outfit', sans-serif;
}

/* ── Course Player Layout ── */
.player-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background: linear-gradient(135deg, #f8f9fc 0%, #eef2f7 100%);
}

/* ── Top Bar ── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: white;
    border-bottom: 1px solid var(--card-border);
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.topbar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--midnight);
    letter-spacing: -0.01em;
}

.topbar-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: var(--magenta-soft);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--midnight), var(--magenta));
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Main Content Area ── */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    padding: 1.5rem;
    gap: 1.5rem;
}

/* ── Slide Display ── */
.slide-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.slide-container {
    max-width: 1000px;
    width: 100%;
    animation: slideIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-image-wrapper {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 25, 94, 0.12);
    border: 1px solid var(--card-border);
    background: white;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slide-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: var(--magenta);
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(183, 27, 158, 0.15);
    border: 1px solid var(--magenta-soft);
}

.slide-number {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--midnight);
    color: white;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 25, 94, 0.3);
}

/* ── Info Panel (Right side) ── */
.info-panel {
    width: 420px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    overflow-y: auto;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-section {
    border-radius: 1rem;
}

.info-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

.info-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--midnight);
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

.info-ost {
    font-size: 0.95rem;
    color: var(--magenta);
    font-weight: 700;
    line-height: 1.5;
    padding: 1rem;
    background: var(--magenta-soft);
    border-radius: 0.75rem;
    border-left: 4px solid var(--magenta);
}

.info-script {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.7;
    padding: 1rem;
    background: #f1f5f9;
    /* Soft blue-gray for script */
    border-radius: 0.75rem;
    border-left: 4px solid var(--midnight);
    font-style: italic;
}

.info-anim {
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.6;
    padding: 1rem;
    background: var(--orange-soft);
    border-radius: 0.75rem;
    border-left: 4px solid var(--orange);
}

.info-anim ul {
    list-style: none;
}

.info-anim li {
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.5rem;
}

.info-anim li::before {
    content: '⚡';
}

/* ── Bottom Nav ── */
.bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: white;
    border-top: 1px solid var(--card-border);
    z-index: 100;
    min-height: 70px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--card-border);
    background: white;
    color: var(--midnight);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Outfit', sans-serif;
}

.nav-btn:hover:not(:disabled) {
    background: var(--midnight-soft);
    border-color: var(--midnight);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.nav-btn.primary {
    background: linear-gradient(135deg, var(--midnight), #1e293b);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 25, 94, 0.2);
}

.nav-btn.primary:hover {
    box-shadow: 0 8px 25px rgba(0, 25, 94, 0.3);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #1e293b, var(--midnight));
}

.slide-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.slide-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
}

.slide-dot.active {
    background: var(--magenta);
    transform: scale(1.4);
    box-shadow: 0 0 10px rgba(183, 27, 158, 0.3);
}

.slide-dot.visited:not(.active) {
    background: var(--midnight);
    opacity: 0.6;
}

/* ── Completion Overlay ── */
.completion-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 25, 94, 0.8);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.completion-overlay.show {
    display: flex;
}

.completion-card {
    text-align: center;
    padding: 4rem 3rem;
    border-radius: 2rem;
    background: white;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3);
    max-width: 540px;
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.completion-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--orange), var(--magenta));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.completion-card h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--midnight);
    font-weight: 800;
}

.completion-card p {
    color: var(--muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    line-height: 1.5;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .info-panel {
        width: 340px;
    }
}

@media (max-width: 950px) {
    .main-content {
        flex-direction: column;
        overflow-y: auto;
        padding: 1rem;
    }

    .info-panel {
        width: 100%;
        overflow-y: visible;
        max-height: none;
    }

    .slide-area {
        min-height: 300px;
    }

    .player-wrapper {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
}