/* ============= HEADER ============= */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    flex: 1;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.85;
}

.logo h1 {
    font-size: 1.8rem;
    margin: 0;
    color: white;
}

.logo p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
    color: white;
}

.navbar {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-separator {
    width: 2px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 0 0.5rem;
}

.nav-profile {
    margin-left: 0.5rem;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none !important;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    background-color: white;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-link:hover .profile-avatar {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.header-actions {
    display: flex;
    align-items: center;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: opacity 0.3s;
}

.menu-toggle:hover {
    opacity: 0.8;
}

/* ============= SIDE MENU ============= */
.side-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background-color: white;
    z-index: 2000;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.side-menu.open {
    right: 0;
}

.side-menu-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.side-menu-header h3 {
    margin: 0;
    color: var(--dark-color);
}

.close-menu {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--dark-color);
    cursor: pointer;
    line-height: 1;
}

.side-menu-links {
    list-style: none;
    padding: 0;
}

.side-menu-links li {
    border-bottom: 1px solid var(--border-color);
}

.side-menu-links a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    color: var(--dark-color);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s;
}

.side-menu-links a:hover {
    background-color: #f8fafc;
    color: #cbd5e1;
    text-decoration: none;
}

.side-menu-links i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.btn-nav {
    color: white;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.btn-nav:hover {
    text-decoration: none;
    color: #cbd5e1 !important;
    opacity: 1;
}

.btn-reset {
    background: rgba(239, 68, 68, 0.2);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.5);
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.8);
    opacity: 1;
}

/* ============= MAIN CONTAINER ============= */
.main-container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1rem;
    flex: 1;
    width: 100%;
}

/* ============= HERO SECTION ============= */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

.hero-content {
    width: 100%;
}

.hero-content h2 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-weight: 600;
}

.hero-content p {
    font-size: 1.1rem;
    color: #6b7280;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-buttons .btn {
    flex: 0 1 auto;
}

.hero-image {
    text-align: center;
    width: 100%;
    max-width: 500px;
    margin: 1rem auto 3rem auto;
}

.hero-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin: 1rem auto 3rem auto;
    flex-wrap: wrap;
}

.hero-image-wrapper .hero-image {
    margin: 0;
    max-width: 500px;
    flex-shrink: 0;
}

.btn-tutorial {
    padding: 1rem 1.8rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: white;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    height: fit-content;
}

.btn-tutorial:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.15);
}

.btn-tutorial:active {
    transform: translateY(0);
}

.hero-image img {
    max-width: 100%;
    height: auto;
    /* Blend edges into the background */
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%),
        linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-composite: intersect;
    -webkit-mask-image: -webkit-linear-gradient(top, black 85%, transparent 100%),
        -webkit-linear-gradient(left, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-composite: source-in;
}

/* ============= FEATURES SECTION ============= */
.features {
    margin-bottom: 4rem;
}

.features h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h4 {
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: #6b7280;
    margin: 0;
}

/* ============= ABOUT SECTION ============= */
.about-hero {
    text-align: center;
    margin-bottom: 4rem;
    padding: 2rem 0;
}

.about-hero h2 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.about-hero p {
    font-size: 1.1rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
}

.methodology {
    margin-bottom: 4rem;
}

.methodology h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.methodology-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.methodology-item {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.methodology-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.methodology-item h4 {
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-size: 1.3rem;
}

.methodology-item p {
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* ============= TUTORIALS SECTION ============= */
.tutorials-section,
.popular-tutorials {
    margin-bottom: 4rem;
}

.popular-tutorials {
    margin-top: 5rem;
}

.tutorials-section h2,
.popular-tutorials h3 {
    margin-bottom: 0.5rem;
}

.tutorials-grid {
    display: grid;
    gap: 2rem;
}

/* ============= BRANCHES VIEW ============= */
.breadcrumb {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f3f4f6;
    border-radius: var(--radius-md);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.95rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.branch-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.branch-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.branch-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.branch-icon {
    font-size: 2.5rem;
}

.branch-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--dark-color);
}

.branch-description {
    margin: 0;
    color: #6b7280;
    line-height: 1.6;
    flex-grow: 1;
}

.branch-courses {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

/* ============= COURSES VIEW ============= */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.course-card {
    background: white;
    padding: 1.8rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.course-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.course-header {
    margin: 0;
}

.course-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--dark-color);
}

.course-description {
    margin: 0;
    color: #6b7280;
    line-height: 1.6;
    font-size: 0.95rem;
    flex-grow: 1;
}

.course-tutorials {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.category-group {
    margin-bottom: 3rem;
}

.category-group h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.tutorials-list {
    display: grid;
    gap: 1rem;
}

.tutorial-item {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.tutorial-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.tutorial-info {
    flex: 1;
}

.tutorial-info h4 {
    margin-bottom: 0.5rem;
}

.tutorial-info h4 a {
    color: var(--dark-color);
    text-decoration: none;
}

.tutorial-info h4 a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.tutorial-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.level {
    background-color: #dbeafe;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    color: #1e40af;
    font-weight: 600;
}

.duration {
    display: flex;
    align-items: center;
}

/* ============= POPULAR TUTORIALS ============= */
.tutorials-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.tutorial-preview {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tutorial-preview:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.preview-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.tutorial-preview h4 {
    margin-bottom: 0.5rem;
}

.tutorial-preview p {
    color: #6b7280;
    margin-bottom: 1rem;
    flex: 1;
}

.tutorial-preview .btn {
    align-self: center;
}

/* ============= TUTORIELS SPÉCIFIQUES ============= */
.tutorial-container {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.tutorial-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tutorial-header h2 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.tutorial-description {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.tutorial-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tutorial-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.steps-container {
    order: 1;
}

.step {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
    display: none;
    flex-direction: column;
    animation: slideIn 0.3s ease;
}

.step:first-child {
    display: flex;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-number {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    margin: -2rem 0 0 -2rem;
}

.step-content h3 {
    margin-bottom: 1rem;
}

.step-description {
    color: #4b5563;
    white-space: pre-wrap;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.step-gif {
    margin: 1.5rem 0;
    text-align: center;
}

.step-gif img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.tips {
    background-color: #fef3c7;
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--warning-color);
}

.tips h4 {
    margin-bottom: 0.5rem;
}

.tips p {
    margin: 0;
    color: #78350f;
}

/* ============= TUTORIAL SIDEBAR ============= */
.tutorial-sidebar {
    order: 2;
}

.progress-box,
.navigation-box,
.related-content {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.progress-box h4,
.navigation-box h4,
.related-content h4 {
    margin-top: 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.navigation-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.navigation-box.beginner-mode {
    position: relative;
}

.beginner-hint {
    background: linear-gradient(135deg, #fef3c7 0%, #fef08a 100%);
    border: 2px solid var(--warning-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    margin-bottom: 0.5rem;
    animation: slideDown 0.5s ease-out;
}

.hint-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
    animation: wave 1.5s ease-in-out infinite;
}

@keyframes wave {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(20deg);
    }

    75% {
        transform: rotate(-20deg);
    }
}

#nextBtn.pulse-glow {
    position: relative;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
        transform: scale(1.05);
    }
}

#nextBtn .btn-arrow {
    display: inline-block;
    animation: slideArrow 1s ease-in-out infinite;
    margin-left: 0.5rem;
}

@keyframes slideArrow {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(5px);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============= ONE PAGE TUTORIAL ============= */
.one-page-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.one-page-content {
    display: block;
    position: relative;
    margin-top: 2rem;
    max-width: 900px;
    /* Centered narrow content for better reading */
    margin-left: auto;
    margin-right: auto;
}

.steps-scroller {
    display: block;
}

.step-card {
    background: white;
    padding: 3rem 0;
    border-bottom: 2px solid #f1f5f9;
    transition: all 0.3s ease;
}

.step-card:last-child {
    border-bottom: none;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.step-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--dark-color);
}

.step-index {
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(49, 46, 129, 0.2);
}

.step-body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.step-text p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
}

.step-visual {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.step-visual img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.tip-box {
    margin-top: 2rem;
    background: #fffbef !important;
    border: 1px solid #fde68a !important;
    border-left: 5px solid #f59e0b !important;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-md);
    display: flex !important;
    gap: 1.25rem;
    align-items: flex-start;
}

.tip-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.tip-content strong {
    display: block;
    color: #92400e;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.tip-content p {
    margin: 0 !important;
    font-size: 1.05rem;
    color: #b45309 !important;
    line-height: 1.6;
}

.inline-activity {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-xl);
    padding: 4rem;
    margin: 4rem 0;
}

.activity-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    /* margin-bottom: 3rem; */
}

.activity-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--secondary-color);
}

.activity-icon {
    font-size: 2.5rem;
}

.activity-intro {
    padding: 1rem 0 1rem 0;
    color: #475569;
    font-size: 1rem;
    line-height: 1.6;
}

.activity-intro p {
    margin: 0;
}


/* --- Dynamic Progress Sidebar & Centered Content --- */
.one-page-content {
    display: block;
    position: relative;
    margin-top: 2rem;
    max-width: 900px;
    /* Base centered width */
    margin-left: auto;
    margin-right: auto;
    transition: max-width 0.4s ease;
}

/* Wide screen: show sidebar normally */
@media (min-width: 1601px) {
    .one-page-content {
        max-width: 1000px;
    }

    .scrolling-sidebar {
        position: fixed;
        right: 4rem;
        top: 50%;
        transform: translateY(-50%);
        width: 300px;
        z-index: 100;
    }

    .minimal-progress {
        display: none;
    }
}

/* Smaller screen: minimalist bar with hover expansion */
@media (max-width: 1600px) {
    .scrolling-sidebar {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        width: 60px;
        z-index: 1000;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding-right: 1.5rem;
        background: transparent;
    }

    .scrolling-sidebar:hover {
        width: 360px;
        background: transparent;
        box-shadow: none;
        padding-right: 2rem;
    }

    .sticky-progress {
        opacity: 0;
        transform: translateX(30px);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
        width: 300px;
        position: absolute;
        background: white;
        border-radius: var(--radius-xl);
        border: 1px solid var(--border-color);
        padding: 2rem;
        box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.1);
        z-index: 5;
    }

    .scrolling-sidebar:hover .sticky-progress {
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

    .minimal-progress {
        position: absolute;
        right: 25px;
        /* Fixed distance from right edge */
        height: 70vh;
        width: 2px;
        background: rgba(226, 232, 240, 0.8);
        border-radius: 2px;
        transition: opacity 0.3s ease;
    }

    .scrolling-sidebar:hover .minimal-progress {
        opacity: 0;
    }

    /* Horizontal graduation line - sticks out to the left */
    .minimal-progress::before {
        content: '';
        position: absolute;
        top: var(--scroll-percent, 0%);
        right: 0;
        width: 40px;
        /* Length of the graduation line */
        height: 2px;
        background: var(--primary-color);
        box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
        z-index: 10;
        transition: top 0.1s linear;
    }

    .minimal-ball {
        position: absolute;
        width: 42px;
        /* Enlarged slightly */
        height: 42px;
        background: var(--primary-color);
        border: 2px solid white;
        border-radius: 50%;
        /* Positioned at the end of the graduation line (left of the vertical bar) */
        right: 40px;
        top: var(--scroll-percent, 0%);
        transform: translateY(-50%);
        box-shadow: var(--shadow-md);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: top 0.1s linear;
        z-index: 11;
        color: white;
        font-size: 0.75rem;
        font-weight: 900;
    }

    .ball-percent {
        /* Text is now centered automatically by flex */
        opacity: 1;
        pointer-events: none;
    }
}

.sticky-progress {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.progress-radial {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.circular-chart {
    display: block;
    margin: 5px auto;
    max-width: 80px;
}

.circle-bg {
    fill: none;
    stroke: #f1f5f9;
    stroke-width: 2.8;
}

.circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke: var(--primary-color);
    transition: stroke-dasharray 0.3s ease;
}

.percentage {
    fill: var(--dark-color);
    font-family: inherit;
    font-size: 8px;
    /* Using pixels for SVG coordinate system */
    text-anchor: middle;
    font-weight: 700;
}

.step-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    border-radius: 0 8px 8px 0;
}

.step-link:hover,
.step-link.active {
    color: var(--primary-color);
    background: #f1f5f9;
    border-left-color: var(--primary-color);
}

.completion-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 6rem 4rem;
    text-align: center;
    border-radius: var(--radius-xl);
    margin-top: 6rem;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease;
}

.completion-card.reveal {
    opacity: 1;
    transform: translateY(0);
}

.completion-card-onboarding {
    opacity: 1;
    transform: translateY(0);
    border: 3px solid rgba(255, 255, 255, 0.32);
}

.completion-card-onboarding p {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.completion-card-onboarding .finish-onboarding-btn {
    margin-top: 1rem;
    background: white;
    color: var(--primary-color);
}

.side-menu-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.5rem 1.5rem;
    list-style: none;
}

.side-submenu {
    list-style: none;
    padding-left: 3rem;
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.side-submenu a {
    font-size: 0.9rem !important;
    padding: 0.4rem 0 !important;
    color: #64748b !important;
}

.side-submenu a:hover {
    color: var(--primary-color) !important;
    background: transparent !important;
}

/* ============= TUTORIAL GAME ============= */
.block-card {
    margin-top: 2rem;
}

.one-page-layout .markdown.alert-tip {
    background: #fefce8;
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1.5rem;
}

.one-page-layout .markdown.alert-tip::before {
    content: "💡 Conseil";
    display: block;
    font-weight: 800;
    color: #92400e;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.one-page-layout .markdown.alert-warning {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1.5rem;
}

.one-page-layout .markdown.alert-warning::before {
    content: "⚠️ Attention";
    display: block;
    font-weight: 800;
    color: #991b1b;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.markdown blockquote {
    border-left: 4px solid #cbd5e1;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #475569;
    font-style: italic;
}

.markdown ul,
.markdown ol {
    margin: 0.5rem 0 1rem 1.5rem;
}

.markdown li {
    margin-bottom: 0px;
    line-height: 1.6;
}

.one-page-layout .exam-card {
    border: 3px solid #f59e0b;
    background: linear-gradient(to bottom right, #fff, #fefce8);
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.1);
}

.one-page-layout .exam-card .activity-header {
    background: #f59e0b;
    color: #fff;
    padding: 1.5rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    border-radius: 12px 12px 0 0;
}

.tutorial-game-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.game-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
}

.game-topbar {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    right: 1.25rem;
    z-index: 10050;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    pointer-events: none;
}

.game-step-pill,
.game-skip-btn {
    pointer-events: auto;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px);
}

.game-step-pill {
    padding: 0.65rem 1rem;
    color: #64748b;
    font-weight: 700;
    font-size: 0.95rem;
}

.game-skip-btn {
    padding: 0.7rem 1.1rem;
    color: var(--primary-color);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.game-skip-btn:hover,
.game-skip-btn:focus-visible {
    border-color: var(--primary-color);
    box-shadow: 0 10px 28px rgba(49, 46, 129, 0.16);
    transform: translateY(-1px);
    outline: none;
}

.game-instruction {
    position: absolute;
    top: 10%;
    text-align: center;
    width: 80%;
    z-index: 10;
}

.game-instruction p {
    font-size: 2.8rem;
    font-weight: 300;
    color: var(--dark-color);
    margin: 0;
    line-height: 1.3;
}

.game-main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.game-demo-wrapper {
    position: absolute;
    z-index: 100;
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-demo-gif {
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.game-demo-fallback {
    min-width: 280px;
    min-height: 180px;
    padding: 2rem;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-xl);
    background: #f8fafc;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.game-demo-fallback[hidden] {
    display: none;
}

.game-demo-fallback .fallback-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: var(--primary-color);
    font-size: 2.4rem;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.game-demo-fallback p {
    margin: 0;
    font-weight: 700;
}

.game-demo-wrapper.move-to-corner {
    top: 2rem;
    right: 2rem;
    transform: scale(0.4);
    transform-origin: top right;
}

.game-action-zone {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.move-to-corner~.game-action-zone {
    opacity: 1;
    transform: scale(1);
}

.game-success {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.5s ease;
}

.success-content {
    text-align: center;
}

.success-icon {
    font-size: 5rem;
    color: var(--success-color);
    margin-bottom: 2rem;
    transform: scale(0);
    animation: successPop 0.5s 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes successPop {
    to {
        transform: scale(1);
    }
}

/* Specific Exercises */
.game-button {
    padding: 2rem 4rem;
    font-size: 2rem;
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: var(--radius-xl);
    color: var(--primary-color);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-5px);
}

.game-progress-capsule {
    width: 400px;
    height: 30px;
    background: #f1f5f9;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.progress-capsule-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    transition: width 0.1s linear;
}

.game-folder {
    font-size: 8rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.game-folder:hover {
    transform: scale(1.1);
}

/* Scroll Exercise */
.game-scroll-mock {
    width: 300px;
    height: 150px;
    background: #f8fafc;
    border: 3px solid #e2e8f0;
    border-radius: var(--radius-lg);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mock-scrollbar-track {
    position: absolute;
    right: 10px;
    top: 10px;
    bottom: 10px;
    width: 12px;
    background: #f1f5f9;
    border-radius: 6px;
}

.mock-scrollbar-thumb {
    position: absolute;
    top: 0;
    width: 100%;
    height: 40px;
    background: var(--primary-color);
    border-radius: 6px;
    transition: top 0.1s ease;
}

.scroll-hint {
    font-size: 1.2rem;
    color: #94a3b8;
    font-weight: 600;
}

/* Context Menu Exercise */
.context-menu {
    position: absolute;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    padding: 0.5rem;
    min-width: 150px;
    z-index: 1000;
}

.menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.menu-item:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

/* Drag and Drop Exercise */
.game-drag-drop-container {
    display: flex;
    gap: 5rem;
    align-items: center;
}

.game-draggable-folder {
    font-size: 6rem;
    cursor: move;
}

.game-drop-zone {
    width: 250px;
    height: 200px;
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-xl);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.game-drop-zone.over {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
    transform: scale(1.05);
}

.drop-hint {
    color: #94a3b8;
    font-weight: 600;
}

.text-danger {
    color: #ef4444 !important;
}

@media (max-width: 800px) {
    .game-topbar {
        top: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
        gap: 0.5rem;
    }

    .game-step-pill,
    .game-skip-btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }

    .one-page-layout .scrolling-sidebar {
        display: none;
    }

    .one-page-layout .one-page-content {
        max-width: 100%;
        padding: 0 1rem;
    }

    .hero-image-wrapper {
        flex-direction: column;
        gap: 1.5rem;
        position: static;
    }

    .hero-image-wrapper .hero-image {
        max-width: 400px;
    }

    .btn-tutorial {
        position: static;
        transform: none;
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }

    .btn-tutorial:hover {
        transform: translateY(-2px);
    }

    .btn-tutorial:active {
        transform: translateY(0);
    }
}

/* ============= PREVIEW MODE ============= */
.preview-mode .header,
.preview-mode .footer,
.preview-mode .footer-divider {
    display: none !important;
}

.preview-mode .main-container {
    margin-top: 0 !important;
    padding-top: 1rem !important;
}

/* ============= BEGINNER SITE WALKTHROUGH ============= */
.site-tour-mock {
    width: min(920px, 88vw);
    min-height: 460px;
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    color: #172033;
}

.site-tour-browserbar {
    height: 44px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
}

.site-tour-browserbar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
}

.site-tour-browserbar strong {
    margin-left: 0.5rem;
    color: var(--primary-color);
}

.site-tour-header {
    height: 74px;
    background: #312e81;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.site-tour-header nav {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.site-tour-hero {
    text-align: center;
    padding: 3rem 2rem 1.5rem;
}

.site-tour-hero.small {
    padding-top: 5rem;
}

.site-tour-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 2rem;
}

.site-tour-card,
.site-tour-exercise,
.site-tour-done,
.site-tour-course section,
.site-tour-course aside {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.25rem;
}

.site-tour-card.active {
    min-height: 240px;
    border-color: var(--primary-color);
    box-shadow: 0 16px 36px rgba(49, 46, 129, 0.12);
}

.site-tour-card.muted,
.site-tour-lesson-row.muted {
    opacity: 0.55;
}

.site-tour-course {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem;
    padding: 2rem;
}

.site-tour-course aside {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.site-tour-lesson-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid #edf2f7;
}

.site-tour-exercise,
.site-tour-done {
    width: min(560px, 78vw);
    margin: 3rem auto;
}

.site-tour-exercise label {
    display: block;
    padding: 0.7rem 0;
}

.site-tour-focus {
    position: relative;
    display: inline-flex;
    justify-content: center;
    margin-top: 1rem;
}

.site-tour-focus.inline {
    margin-top: 0;
}

.site-tour-arrow {
    position: absolute;
    top: -2.4rem;
    left: 50%;
    transform: translateX(-50%);
    color: #ef4444;
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    animation: siteTourArrow 0.85s ease-in-out infinite alternate;
    text-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.site-tour-focus.inline .site-tour-arrow {
    top: 50%;
    left: -2.5rem;
    transform: translateY(-50%);
}

.site-tour-target {
    border: 3px solid #ef4444;
    background: #ffffff;
    color: #312e81;
    border-radius: 999px;
    padding: 0.85rem 1.25rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.12), 0 14px 30px rgba(15, 23, 42, 0.12);
}

.site-tour-scroll-panel {
    height: 360px;
    overflow-y: auto;
    background: #ffffff;
    margin: 2rem;
    padding: 1.5rem;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
}

.site-tour-long-content {
    margin-top: 280px;
    padding: 1rem;
    background: #eef2ff;
    border-radius: 12px;
}

@keyframes siteTourArrow {
    from { transform: translate(-50%, -4px); }
    to { transform: translate(-50%, 5px); }
}

@media (max-width: 800px) {
    .site-tour-mock {
        width: 92vw;
        min-height: 420px;
    }

    .site-tour-grid,
    .site-tour-course {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .site-tour-card.muted,
    .site-tour-course aside {
        display: none;
    }

    .site-tour-header {
        padding: 0 1rem;
    }

    .site-tour-header nav span {
        display: none;
    }
}


/* ============= REAL SITE ONBOARDING TOUR ============= */
.real-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    pointer-events: none;
}

.real-tour-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
}

.real-tour-target {
    position: relative !important;
    z-index: 12002 !important;
    outline: 4px solid #ef4444 !important;
    outline-offset: 6px !important;
    box-shadow: 0 0 0 12px rgba(239, 68, 68, 0.18), 0 16px 38px rgba(15, 23, 42, 0.25) !important;
    border-radius: 12px;
}

.real-tour-arrow {
    position: fixed;
    z-index: 12003;
    color: #ef4444;
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    transform: translateX(-50%);
    animation: realTourArrow 0.75s ease-in-out infinite alternate;
    pointer-events: none;
}

.real-tour-card {
    position: fixed;
    z-index: 12003;
    width: min(320px, calc(100vw - 32px));
    background: white;
    color: #172033;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.24);
    pointer-events: auto;
}

.real-tour-card p {
    margin: 0 0 0.85rem;
    font-weight: 700;
    line-height: 1.35;
}

.real-tour-skip {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
    font-weight: 700;
}

.game-move-target-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 260px;
}

.game-move-target {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: 800;
    text-align: center;
    padding: 1rem;
    box-shadow: 0 0 0 12px rgba(99, 102, 241, 0.08);
}

.game-move-target.target-reached {
    border-color: var(--success-color);
    color: var(--success-color);
    background: rgba(16, 185, 129, 0.08);
}

.game-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 1rem;
    width: min(560px, 90vw);
}

.game-choice-option {
    padding: 1.2rem;
    border: 2px solid #cbd5e1;
    border-radius: 14px;
    background: white;
    color: #172033;
    font-weight: 800;
    font-size: 1.05rem;
    cursor: pointer;
}

.game-choice-option:hover,
.game-choice-option:focus-visible {
    border-color: var(--primary-color);
    outline: none;
}

.game-choice-option.choice-correct {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.08);
}

.game-choice-option.choice-wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

@keyframes realTourArrow {
    from { transform: translate(-50%, -4px); }
    to { transform: translate(-50%, 6px); }
}

@media (max-width: 700px) {
    .game-choice-grid {
        grid-template-columns: 1fr;
    }
}


/* ============= TWO TARGET MOUSE TRAINING ============= */
.game-move-sequence {
    position: relative;
    width: min(680px, 82vw);
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.game-move-sequence-line {
    position: absolute;
    left: 120px;
    right: 120px;
    top: 50%;
    height: 4px;
    background: #dbe3ef;
    transform: translateY(-50%);
    z-index: 0;
}

.game-move-sequence-target {
    position: relative;
    z-index: 1;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid #94a3b8;
    background: #f8fafc;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 900;
    box-shadow: 0 0 0 10px rgba(148, 163, 184, 0.12);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.game-move-sequence-target.target-next {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
    transform: scale(1.04);
    box-shadow: 0 0 0 14px rgba(99, 102, 241, 0.12);
}

.game-move-sequence-target.target-reached {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    transform: scale(1);
}

@media (max-width: 700px) {
    .game-move-sequence {
        width: 86vw;
        gap: 1rem;
    }

    .game-move-sequence-target {
        width: 118px;
        height: 118px;
        font-size: 2.4rem;
    }

    .game-move-sequence-line {
        left: 92px;
        right: 92px;
    }
}
