:root {
    --bg-color: #000000;
    --card-bg: #151515;
    --card-bg-hover: #1c1c1c;
    --text-main: #ffffff;
    --text-muted: #888888;
    --accent: #2c2c2c;
    --success: #10b981;
    --font-family: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.nav-link:hover, .nav-link.active {
    opacity: 1;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Main Content Area */
#app-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
}

.view {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.view.hidden {
    display: none;
    opacity: 0;
}

/* Home Cards */

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100vh; /* Make sure it takes full screen to space out nicely */
}


.home-menu-card {
    background: #151515;
    border-radius: 30px;
    width: 100%;
    max-width: 400px;
    flex: 1; /* let them fill available space */
    max-height: 350px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden; /* Prevent image from spilling out */
}

.card:hover {
    transform: translateY(-5px);
    background-color: var(--card-bg-hover);
}


.card-title {
    font-size: 32px;
    font-weight: 700;
    position: absolute;
    top: 30px;
    left: 30px;
    margin: 0;
    color: white;
}


.card-image {
    width: 80%;
    height: 80%;
    max-height: 250px;
    object-fit: contain;
    position: absolute;
    bottom: 0;
    right: 0;
    transform: translate(10%, 10%); /* slightly push to bottom right */
}

.course-img {
    bottom: 20px;
}

/* Prompt Card (Initial Quiz, Are you sure) */
.prompt-card {
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: 60px;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Video Cards */
.videos-container {
    display: flex;
    gap: 20px;
    width: 100%;
}
.video-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}
.quiz-video {
    width: 100%;
    background-color: #222;
    border-radius: 20px;
    object-fit: cover;
    cursor: pointer;
}
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    aspect-ratio: 9/16;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.video-overlay.hidden {
    opacity: 0;
}
.video-placeholder {
    width: 100%;
    align-items: center;
    gap: 20px;
}

.prompt-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.prompt-text h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.prompt-text p {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #cccccc;
}

.prompt-image {
    width: 200px;
    object-fit: contain;
}

/* Videos Container (Compare) */
.videos-container {
    display: flex;
    gap: 20px;
    width: 100%;
    height: 600px;
}

.video-card {
    flex: 1;
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-placeholder {
    flex: 1;
    background-color: #0a0a0a;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.play-btn {
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.play-btn svg {
    width: 24px;
    height: 24px;
    margin-left: 4px; /* offset for triangle */
}

.play-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.play-btn.big {
    width: 80px;
    height: 80px;
}
.play-btn.big svg {
    width: 36px;
    height: 36px;
    margin-left: 6px;
}

/* Buttons */
.btn {
    padding: 16px 24px;
    border-radius: 12px;
    border: none;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s, background-color 0.2s;
}

.primary-btn {
    background-color: #0a0a0a;
    color: white;
}

.primary-btn:hover {
    background-color: #111;
}

.secondary-btn {
    background-color: #000;
    color: white;
}

.secondary-btn:hover {
    background-color: #111;
}

.full-width {
    width: 100%;
}

/* Correct Answer View */
.center-content {
    align-items: center;
    text-align: center;
    gap: 30px;
}

.icon-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-circle.success {
    background-color: var(--success);
    color: #000;
}

.icon-circle svg {
    width: 60px;
    height: 60px;
}

.status-text {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Course Layout */
.course-container {
    display: flex;
    gap: 30px;
    width: 100%;
    height: 650px;
    align-items: stretch;
}

.course-sidebar {
    width: 350px;
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.progress-container {
    margin-bottom: 30px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: #000;
    border-radius: 3px;
    overflow: visible;
}

.progress-fill {
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);

    width: 15%;
    height: 100%;
    background: linear-gradient(90deg, var(--success), #22c55e);
    border-radius: 3px;
}

.course-main-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.course-modules {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.module-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #e0e0e0;
}

.module-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.course-sidebar::-webkit-scrollbar {
    display: none;
}

.course-sidebar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.module-list li {
    padding: 8px 0;
    color: #888;
    transition: color 0.3s;
}
.module-list li:hover {
    color: white;
}
.course-item.active {
    color: white;
    font-weight: bold;
    text-decoration: none;
}

.course-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0;
}

.course-card {
    background: #151515;
    border-radius: 20px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.course-card-inner {
    padding: 50px 60px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.course-header-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    min-height: 500px;
}

.course-header-section h2 {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 30px;
}

.course-header-section p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #888;
    margin-bottom: 50px;
    max-width: 600px;
}

#course-audio-player {
    width: 100%;
    max-width: 400px;
    margin-bottom: 50px;
    background: white;
    border-radius: 30px;
    display: none;
}



.course-text-section {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease-in, padding-top 0.8s ease;
    padding-top: 0;
}

.course-card.expanded .course-header-section {
    display: none; /* Hide player when text is shown */
}

.course-card.expanded .course-text-section {
    max-height: 2000px;
    opacity: 1;
    padding-top: 20px;
}

.text-section-title {
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.course-body-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #ccc;
    margin-bottom: 30px;
}

.course-facts {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.fact-item {
    background: #0a0a0a;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.fact-icon {
    font-size: 2rem;
}

.fact-text {
    font-size: 1rem;
    line-height: 1.5;
    color: #fff;
}


/* CUSTOM AUDIO PLAYER */
.custom-audio-player {
    display: flex;
    align-items: center;
    background: #0a0a0a;
    border-radius: 40px;
    padding: 10px 20px;
    width: 100%;
    margin-bottom: 20px;
    gap: 15px;
}

.play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #222;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.play-btn:hover {
    background: #333;
}

.waveform {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-grow: 1;
    height: 30px;
}

.waveform-bar {
    width: 3px;
    background: #555;
    border-radius: 2px;
    height: 10px;
    transition: height 0.1s ease;
}

.time-display {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
}

.volume-control {
    display: flex;
    align-items: center;
}



/* Scrollbar hide */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* UI Overrides for new layout */
.course-card.expanded .course-header-section {
    display: none !important;
}

.course-card.expanded .course-text-section {
    display: block !important;
}

.course-header-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    min-height: 500px;
}

.course-title-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.course-title-block h1 {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 20px;
    line-height: 1.2;
}

.course-title-block p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #888;
    max-width: 100%;
}



/* Scrollbar styling for expanded card */

.course-card::-webkit-scrollbar {
    display: none;
}
.course-card {
    -ms-overflow-style: none;
    scrollbar-width: none;
}


.waveform-bar {
    width: 3px;
    background: #444; /* Unplayed color */
    border-radius: 2px;
    margin: 0 1px;
    transition: background 0.1s ease;
}
.waveform-bar.played {
    background: #10b981; /* Played color - green or white based on design. Let's use white to match the icon, or #1ed760 for spotify/insta vibe. I'll use white to match the play button. */
    background: #fff;
}

/* Custom Volume Slider */
#custom-volume-slider {
    -webkit-appearance: none;
    background: transparent;
}
#custom-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    margin-top: -4px;
}
#custom-volume-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #444;
    border-radius: 2px;
}

/* Text Button & Scroll Indicator */
.scroll-indicator-wrapper {
    max-height: 200px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease-out, margin-top 0.8s ease;

    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.scroll-indicator-wrapper:hover {
    transform: translateY(5px);
}

.scroll-bounce {
    animation: bounce 2s infinite ease-in-out;
    margin-bottom: 5px;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

.text-only-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.3s;
}

.scroll-indicator-wrapper:hover .text-only-btn {
    color: #fff;
}

.play-btn {
    flex-shrink: 0;
}
.time-display {
    flex-shrink: 0;
}
.volume-control {
    flex-shrink: 0;
}

/* TIKTOK SUBTITLES */
.tiktok-subtitles-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    gap: 12px 15px;
    max-width: 900px;
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.4;
    padding: 0 20px;
    min-height: 180px;
}

.word-anim {
    display: inline-block;
    background: linear-gradient(90deg, #ffffff calc(var(--fill, 0%) - 20%), #444444 calc(var(--fill, 0%) + 20%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    animation: fadeInSentence 0.6s ease forwards;
    
    /* VERY SMOOTH transitions for everything */
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), 
                text-shadow 0.8s cubic-bezier(0.25, 0.8, 0.25, 1),
                opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.word-anim.idle {
    transform: scale(1);
    text-shadow: none;
    opacity: 1; 
}

.word-anim.active {
    transform: scale(1.1);
    text-shadow: 0px 0px 15px rgba(255,255,255,0.4);
    z-index: 10;
    opacity: 1;
}

.word-anim.past {
    transform: scale(1);
    text-shadow: none;
    opacity: 0.4; /* Smoothly fade out the past words */
}

@keyframes fadeInSentence {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.course-card.expanded .scroll-indicator-wrapper {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
}

.scroll-return-circle {
    position: absolute;
    top: 20px;
    left: 50%;
    margin-left: -40px;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
    will-change: transform, opacity;
}

/* --- NEW UI FOR MOBILE --- */
.view {
    display: none;
    width: 100%;
    height: 100%;
}
.view.active {
    display: flex;
    flex-direction: column;
}
.hidden {
    display: none !important;
}

/* Base styles for the new views based on their classes */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #000;
}
.nav-links {
    display: flex;
    gap: 20px;
}
.nav-link {
    color: #888;
    text-decoration: none;
    font-weight: 600;
}
.nav-link.active {
    color: #fff;
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    align-items: center;
    justify-content: center;
    flex: 1;
}
.home-menu-card {
    background: #151515;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}
.card-title {
    font-size: 24px;
    font-weight: 600;
    margin: 20px;
    align-self: flex-start;
    position: absolute;
    top: 0;
    left: 0;
    color: white;
}
.card-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-top: 40px;
}

.prompt-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex: 1;
}
.prompt-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.prompt-text h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
}
.prompt-text p {
    font-size: 16px;
    color: #bbb;
    margin-bottom: 40px;
    line-height: 1.5;
}
.prompt-image {
    max-width: 100%;
    max-height: 50vh;
    object-fit: contain;
}
.btn.primary-btn {
    background: #3b68ff;
    color: white;
    width: 100%;
    padding: 18px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    text-align: center;
    border: none;
    cursor: pointer;
}

/* Mobile Overrides for Course Layout */
@media (max-width: 768px) {
    /* On mobile, we need to hide the sidebar if player is active */
    #view-course-layout {
        flex-direction: column;
        padding: 0 !important;
        width: 100%;
        height: 100%;
        overflow-y: auto;
    }
    .course-container {
        padding: 0 !important;
        flex-direction: column;
    }
    /* We handle list vs player via JS classes on #view-course-layout */
    #view-course-layout.viewing-list aside {
        display: flex !important;
        width: 100%;
    }
    #view-course-layout.viewing-list .course-content {
        display: none !important;
    }
    
    #view-course-layout.viewing-player aside {
        display: none !important;
    }
    #view-course-layout.viewing-player .course-content {
        display: flex !important;
        width: 100%;
        flex-direction: column;
    }

    .course-sidebar-block {
        padding: 20px !important;
        border-radius: 0 !important;
        max-height: none !important;
    }
    
    .screen-header.mobile-only {
        display: flex;
        align-items: center;
        padding: 20px;
        gap: 15px;
    }
    .back-btn {
        background: #1a1a1a;
        border: none;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    .header-pill {
        background: #1a1a1a;
        padding: 12px 20px;
        border-radius: 30px;
        font-size: 13px;
        color: #888;
    }
    .header-pill .pill-bold {
        color: white;
        font-weight: 600;
    }
    
    .course-card {
        border: none;
        border-radius: 0;
        background: transparent;
    }
    .course-card-inner {
        padding: 10px 20px 50px 20px;
    }
    .text-only-btn {
        background: #3b68ff;
        color: white;
        width: 100%;
        padding: 18px;
        border-radius: 30px;
        font-size: 16px;
        font-weight: 600;
        text-align: center;
        opacity: 1;
    }
    .course-card.expanded .text-only-btn {
        display: block !important;
    }
    .scroll-arrow {
        display: none;
    }
}


@media (max-width: 768px) {
    #app-content {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
    }
    .view.active {
        flex: 1;
        width: 100%;
        height: 100%;
        justify-content: flex-start !important;
    }
    .cards-container {
        height: auto !important;
        flex: 1;
        padding: 20px;
    }
    .home-menu-card {
        flex: 1;
        max-height: 350px;
        min-height: 150px;
    }
}





@media (min-width: 769px) {
    .cards-container {
        flex-direction: row;
        gap: 50px;
    }
    .home-menu-card {
        max-width: 500px;
        height: 400px;
    }
    .card-title {
        font-size: 40px;
    }
}


/* Hide mobile artifacts on PC */
@media (min-width: 769px) {
    .mobile-only, 
    #mobile-player-header,
    .screen-header.mobile-only {
        display: none !important;
    }
}




/* MOBILE MOCKUP STYLING */
@media (max-width: 768px) {
    /* Base course container */
    .course-container {
        padding: 0 15px 120px 15px !important; /* Bottom padding for blue button */
        gap: 20px !important;
        background: #000 !important;
    }
    
    /* View toggles */
    #view-course-layout.viewing-list .course-content {
        display: none !important;
    }
    #view-course-layout.viewing-player aside {
        display: none !important;
    }
    #view-course-layout.viewing-player .course-content {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    /* Course List View (Aside) */
    aside {
        width: 100% !important;
        gap: 20px !important;
    }
    .course-sidebar-block {
        background: #141414 !important;
        border-radius: 24px !important;
        padding: 24px !important;
    }
    .progress-labels span:last-child {
        display: none !important; /* Hide 100% */
    }
    #progress-text-current {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: #fff !important;
    }
    .progress-bar {
        background: #000 !important;
        height: 12px !important;
        border-radius: 10px !important;
        margin-top: 10px !important;
    }
    .progress-fill {
        background: linear-gradient(90deg, #555, #fff) !important;
        border-radius: 10px !important;
    }
    .course-main-title {
        display: none !important; /* Hide 'Sora' */
    }
    .module-title {
        font-size: 1.1rem !important;
        color: #fff !important;
        margin-top: 15px !important;
        margin-bottom: 5px !important;
    }
    .course-item {
        color: #888 !important;
        font-size: 0.95rem !important;
        padding: 12px 0 !important;
    }

    /* Player View (.course-content) */
    #mobile-player-header {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 15px !important;
        margin-bottom: 15px !important;
        width: 100% !important;
    }
    .back-btn {
        background: #1a1a1a !important;
        border-radius: 50% !important;
        width: 44px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }
    .header-pill {
        background: #1a1a1a !important;
        border-radius: 30px !important;
        padding: 12px 20px !important;
        display: flex !important;
        align-items: center !important;
        flex-direction: row !important;
        gap: 5px !important;
    }
    .header-pill span {
        white-space: nowrap !important;
    }

    .course-card {
        background: transparent !important;
        padding: 0 !important;
    }
    .course-card-inner {
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    /* Audio Player Pill */
    .custom-audio-player-container {
        margin-bottom: 15px !important;
        width: 100% !important;
    }
    .custom-audio-player {
        background: #141414 !important;
        border-radius: 40px !important;
        padding: 10px 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 15px !important;
        width: 100% !important;
    }
    .play-btn {
        background: #2a2a2a !important;
        border-radius: 50% !important;
        width: 44px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }
    .waveform {
        flex: 1 !important;
    }
    
    /* Subtitles Card */
    .course-header-section {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    #course-tiktok-subs {
        font-size: 1.8rem !important;
        height: auto !important;
        min-height: 150px !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        text-align: left !important;
    }
    
    /* Fixed Blue Button at Bottom */
    .blue-scroll-btn {
        position: relative !important; margin-top: 20px !important;
        
        
        
        width: 100% !important;
        background-color: #3b82f6 !important;
        color: white !important;
        border-radius: 30px !important;
        padding: 18px !important;
        font-size: 1.1rem !important;
        font-weight: bold !important;
        text-align: center !important;
        box-shadow: 0 10px 20px rgba(59, 130, 246, 0.4) !important;
        z-index: 100 !important;
        display: block !important;
    }
}


/* ADDITIONAL MOBILE POLISH */
@media (max-width: 768px) {
    .nav-links {
        display: none !important;
    }
    .mobile-hamburger {
        display: none !important; /* User requested removal on iPhone */
    }
    .main-header {
        padding: 20px 15px !important;
    }
    .screen-header {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 15px !important;
        width: 100% !important;
    }
    
    /* Ensure the course list view shows the list header */
    #view-course-layout.viewing-list #mobile-list-header {
        display: flex !important;
    }
    #view-course-layout.viewing-player #mobile-list-header {
        display: none !important;
    }

    /* Course Sidebar Block (List) */
    .course-sidebar-block {
        padding: 20px !important;
        background: #111 !important; /* Very dark, almost black */
    }
    .progress-labels {
        justify-content: flex-start !important;
    }
    #progress-text-current {
        font-size: 0.9rem !important;
    }
    
    /* View Home tweaks to match Mockup 1 */
    #view-home .cards-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        padding: 0 15px !important;
    }
    .home-menu-card {
        background: #111 !important;
        border-radius: 24px !important;
        padding: 30px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .home-menu-card h2 {
        font-size: 1.8rem !important;
        margin-bottom: 20px !important;
    }
    .home-menu-card img {
        align-self: center !important;
        width: 80% !important;
        max-width: 200px !important;
        height: auto !important;
    }

    /* Button adjustments */
    .btn.primary-btn {
        width: 100% !important;
        border-radius: 30px !important;
        padding: 18px !important;
        font-size: 1.1rem !important;
    }
    
    /* Prompts like Not Finished / Initial Quiz */
    .prompt-card {
        background: transparent !important;
        padding: 0 15px !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    .prompt-content {
        background: #111 !important;
        border-radius: 24px !important;
        padding: 30px !important;
        margin-bottom: 20px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: left !important;
    }
    .prompt-text h2 {
        font-size: 1.8rem !important;
        margin-bottom: 15px !important;
    }
    
    /* Compare view videos */
    .videos-container {
        padding: 0 15px !important;
        gap: 20px !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .video-card {
        background: #111 !important;
        border-radius: 24px !important;
        padding: 0 !important;
        overflow: hidden !important;
        aspect-ratio: 1 / 1 !important; /* Make them square-ish to match mockup */
    }
}


/* PERFECT MOBILE ALIGNMENT FIXES */
@media (max-width: 768px) {
    /* Hide the partner logo on the right */
    .partner-logo {
        display: none !important;
    }

    /* Course Sidebar (List Block) Tweaks */
    .course-sidebar-block {
        padding: 15px !important;
        border-radius: 16px !important;
        background: #111 !important;
    }

    /* Progress Block Specifics */
    .progress-labels span:last-child {
        display: none !important; /* Hide 100% */
    }
    #progress-text-current {
        font-weight: 400 !important;
        font-size: 0.8rem !important;
    }

    /* Hide the Sora Title */
    .course-main-title {
        display: none !important;
    }

    /* Modules List Tweaks */
    .course-modules {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important; /* Tighter gap between modules */
    }
    .module-title {
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
        line-height: 1.2 !important;
    }
    .module-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important; /* Tighter gap between items */
    }
    .course-item {
        font-size: 0.85rem !important;
        color: #888 !important;
        padding: 0 !important; /* Remove padding */
        background: transparent !important;
        line-height: 1.4 !important;
    }
    .course-item.active {
        color: #fff !important; /* active item can be white */
    }
    .course-item:hover {
        background: transparent !important;
        color: #ccc !important;
    }
}


/* PIXEL PERFECT MOBILE FIXES */
@media (max-width: 768px) {
    /* Header alignments */
    .main-header {
        padding: 16px 20px !important;
    }
    #mobile-list-header {
        margin-bottom: 24px !important;
        gap: 12px !important;
        padding: 0 20px !important;
    }
    .back-btn {
        width: 38px !important;
        height: 38px !important;
    }
    .back-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
    .header-pill {
        padding: 8px 16px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
    }

    /* Blocks wrapper for padding alignment */
    #view-course-layout aside {
        width: 100% !important;
        padding: 0 20px !important;
        gap: 20px !important;
    }

    /* Progress Block */
    .course-sidebar-block:not(.no-scrollbar) {
        padding: 16px 20px !important;
        border-radius: 20px !important;
    }
    .progress-labels {
        margin-bottom: 8px !important;
    }
    #progress-text-current {
        font-size: 11px !important;
        font-weight: 500 !important;
        letter-spacing: 0.5px !important;
    }
    .progress-bar {
        height: 6px !important;
        border-radius: 6px !important;
        background: #2a2a2a !important;
    }
    .progress-fill {
        background: #e0e0e0 !important;
        border-radius: 6px !important;
        box-shadow: 0 0 10px rgba(255,255,255,0.2) !important;
    }

    /* Modules Block */
    .course-sidebar-block.no-scrollbar {
        padding: 24px 20px !important;
        border-radius: 20px !important;
    }
    .course-modules {
        gap: 24px !important;
    }
    .module-title {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #ffffff !important;
        margin-bottom: 12px !important;
        letter-spacing: 0.2px !important;
    }
    .module-list {
        gap: 12px !important;
    }
    .course-item {
        font-size: 13px !important;
        color: #8e8e93 !important; /* iOS dark mode secondary text color */
        line-height: 1.3 !important;
        font-weight: 400 !important;
    }
    .course-item.active {
        color: #ffffff !important;
    }
}


/* PLAYER MOBILE FIXES */
@media (max-width: 768px) {
    /* Make the tiktok subtitles smaller on mobile */
    .tiktok-subtitles-container {
        font-size: 1.5rem !important; /* Smaller than the huge text */
        line-height: 1.3 !important;
        align-items: center !important;
        justify-content: center !important;
        display: flex !important;
        height: 60vh !important;
        padding: 0 20px !important;
    }

    /* Progress Block */
    .course-sidebar-block:not(.no-scrollbar) {
        padding: 16px 20px !important;
        border-radius: 20px !important;
    }
    .progress-labels {
        margin-bottom: 8px !important;
    }
    #progress-text-current {
        font-size: 11px !important;
        font-weight: 500 !important;
        letter-spacing: 0.5px !important;
    }
    .progress-bar {
        height: 6px !important;
        border-radius: 6px !important;
        background: #2a2a2a !important;
    }
    .progress-fill {
        background: #e0e0e0 !important;
        border-radius: 6px !important;
        box-shadow: 0 0 10px rgba(255,255,255,0.2) !important;
    }

    /* Modules Block */
    .course-sidebar-block.no-scrollbar {
        padding: 24px 20px !important;
        border-radius: 20px !important;
    }
    .course-modules {
        gap: 24px !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .tiktok-subtitles-container .word-anim {
        font-weight: 600 !important;
    }

    /* Fix the expanded layout to look like Mockup 2 */
    .course-card.expanded {
        padding: 20px !important;
        background: #111 !important;
        border-radius: 20px !important;
    }
    .course-text-section {
        padding: 0 !important;
        margin-top: 20px !important;
    }
    .text-section-title {
        display: none !important; /* Hide KRÓTKO W TEKŚCIE title */
    }
    .course-body-text {
        font-size: 14px !important;
        color: #fff !important;
        line-height: 1.5 !important;
        margin-bottom: 24px !important;
    }
    
    /* We inject the subtitle title via JS or CSS before */
    #course-body-top::before {
        content: attr(data-title);
        display: block;
        font-size: 13px;
        color: #888;
        margin-bottom: 15px;
        font-weight: 500;
    }

    /* Facts container */
    .course-facts {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        margin-bottom: 30px !important;
    }
    .fact-item {
        background: #1a1a1a !important;
        border-radius: 12px !important;
        padding: 16px !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }
    .fact-item svg {
        width: 24px !important;
        height: 24px !important;
        color: #fff !important;
        flex-shrink: 0 !important;
    }
    .fact-item span {
        font-size: 12px !important;
        color: #ddd !important;
        line-height: 1.4 !important;
    }

    /* Powrót button */
    .btn.primary-btn {
        background: #4A72FF !important; /* Exact blue from mockup */
        color: white !important;
        border-radius: 30px !important;
        padding: 16px !important;
        font-weight: 600 !important;
        font-size: 15px !important;
        border: none !important;
    }
}


/* GLOBAL ALIGNMENT FIXES */
@media (max-width: 768px) {
    /* 1. Navbar padding must align with layout (20px left/right) */
    .navbar {
        padding: 20px !important;
    }
    
    /* 2. Course Container shouldn't have 40px inline padding on mobile! */
    .course-container {
        padding: 0 !important;
    }
    
    /* 3. Aside (List View) gets the standard 20px margin from screen edges */
    #view-course-layout aside {
        padding: 0 20px !important;
    }

    /* 4. Course Content (Player View) also gets the 20px padding */
    .course-content {
        padding: 0 20px !important;
    }

    /* 5. Mobile Player Header (the back button and pill) */
    #mobile-player-header {
        margin-bottom: 10px !important; /* Push audio player up */
        gap: 12px !important;
        padding: 0 !important; /* It's inside course-content which has 20px */
    }
    #player-header-pill {
        padding: 8px 16px !important;
        font-size: 14px !important;
    }
}


/* ==========================================================================
   TURNKEY MOBILE UX / UI - PERFECT DESIGN SYSTEM
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. NATIVE APP FEEL - PREVENT UNWANTED BODY SCROLLING */
    html, body {
        height: 100% !important;
        width: 100% !important;
        overflow: hidden !important; /* Lock body */
        position: fixed !important;
        background: #000 !important;
        overscroll-behavior-y: none !important;
    }

    /* 2. APP CONTENT SCROLLING - Smooth native scroll */
    #app-content {
        height: calc(100% - 40px) !important; /* Subtract mobile navbar height */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 0 !important; /* User wants the button AS LOW AS POSSIBLE */
    }

    /* 3. NAVBAR PERFECT PROPORTIONS */
    .navbar {
        padding: 0px 20px !important;
        height: 40px !important;
        border-bottom: 1px solid rgba(255,255,255,0.05) !important;
        flex-shrink: 0 !important;
    }
    .hamburger-menu {
        display: none !important; /* Hide hamburger menu */
    }
    .logo img {
        height: 24px !important; /* Sleek, not too huge */
    }

    .screen-header {
        margin-bottom: 24px !important;
        gap: 12px !important;
        padding: 0 !important; /* Container handles padding */
    }
    #mobile-player-header {
        margin-top: 5px !important; /* Tiny gap */
        margin-bottom: 15px !important; /* Smaller gap below */
        display: flex !important; /* Ensure it is visible */
    }
    .back-btn {
        width: 44px !important; /* Apple HIG minimum touch target */
        height: 44px !important;
        border-radius: 50% !important;
        background: #1c1c1e !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .back-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
    .header-pill {
        padding: 10px 16px !important;
        font-size: 14px !important;
        background: #1c1c1e !important;
        border-radius: 20px !important;
        display: flex !important;
        align-items: center !important;
        height: 44px !important;
    }

    /* 5. COURSE CONTAINER & BLOCKS */
    .course-container {
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
    }
    #view-course-layout aside {
        padding: 0 20px !important;
        gap: 16px !important; /* Tighter gap between blocks */
    }
    
    /* Progress Block */
    .course-sidebar-block:not(.no-scrollbar) {
        padding: 16px 20px !important;
        border-radius: 24px !important;
        background: #1c1c1e !important; /* Perfect Apple Dark Mode Grey */
    }

    /* Modules Block */
    .course-sidebar-block.no-scrollbar {
        padding: 24px 20px !important;
        border-radius: 24px !important;
        background: #1c1c1e !important;
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important; /* Internal scroll so rounded bottom stays visible */
        gap: 20px !important;
    }

    /* 6. PLAYER VIEW (Course Content) */
    .course-content {
        padding: 0 20px !important;
    }
    
    /* Tiktok Subtitles (Unexpanded) */
    .tiktok-subtitles-container {
        height: auto !important;
        min-height: 40vh !important;
        padding: 0 !important;
        font-size: 1.4rem !important;
        line-height: 1.4 !important;
    }

    /* Expanded Text View Block */
    .course-card.expanded {
        background: transparent !important;
        padding: 0 !important;
    }
    
    .course-card.expanded .course-header-section {
        background: #1c1c1e !important;
        border-radius: 24px !important;
        padding: 24px 20px !important;
        margin-bottom: 20px !important;
        display: flex !important; /* Force show the box */
    }
    
    /* Audio Player */
    .custom-audio-player {
        background: #1c1c1e !important;
        border-radius: 30px !important;
        padding: 10px 15px 10px 10px !important; /* Move play button more left */
        height: 56px !important;
    }

    /* 7. BUTTONS & TOUCH TARGETS */
    .btn.primary-btn {
        background: #4A72FF !important;
        color: white !important;
        border-radius: 30px !important;
        padding: 16px 24px !important;
        font-weight: 600 !important;
        font-size: 16px !important; /* Legible size */
        height: 56px !important; /* Perfect touch height */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        letter-spacing: 0.2px !important;
        box-shadow: 0 8px 20px rgba(74, 114, 255, 0.2) !important;
        transition: transform 0.2s, box-shadow 0.2s !important;
    }
    .btn.primary-btn:active {
        transform: scale(0.96) !important;
        box-shadow: 0 4px 10px rgba(74, 114, 255, 0.2) !important;
    }

    /* Fact items (expanded view) */
    .fact-item {
        background: #242426 !important; /* Slightly lighter than 1c1c1e */
        border-radius: 16px !important;
        padding: 16px !important;
    }

    /* Home view cards */
    .home-menu-card {
        background: #1c1c1e !important;
        border-radius: 24px !important;
        padding: 24px !important;
    }
}


/* ADDITIONAL SCROLL FIXES FOR TURNKEY MOBILE UX */
@media (max-width: 768px) {
    #app-content {
        flex: 1 !important;
        height: auto !important;
        min-height: 0 !important; /* Important for flex children scrolling in Firefox/Safari */
        overflow-y: auto !important;
        
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 0 !important; /* User wants the button AS LOW AS POSSIBLE */
    }
    
    /* Ensure all views fill height properly if needed */
    .view {
        min-height: 100% !important;
        display: none;
    }
    .view.active {
        display: flex !important;
        flex-direction: column;
    }
    
    /* Player layout */
    #view-course-layout {
        display: none;
    }
    #view-course-layout.viewing-list,
    #view-course-layout.viewing-player {
        display: flex !important;
        flex-direction: column;
    }
}


/* ==========================================================================
   TURNKEY UX 2 - VIEWS POLISH
   ========================================================================== */
@media (max-width: 768px) {
    /* Prompt Card (View 2 & 4 & 5) */
    .prompt-card {
        background: #1c1c1e !important;
        border-radius: 24px !important;
        padding: 24px !important;
        width: 100% !important;
        max-width: 400px !important;
        margin: 0 auto !important;
    }
    
    /* Quiz Results Card needs to grow with content, not stretch to 100% height and break borders */
    #view-quiz-results .prompt-card {
        height: auto !important;
        justify-content: flex-start !important;
        padding: 40px 24px !important; /* Equal padding left/right/top/bottom */
    }
    
    #view-quiz-results .secondary-btn,
    #view-quiz-results .primary-btn {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .prompt-text h2 {
        font-size: 20px !important;
        margin-bottom: 12px !important;
    }
    .prompt-text p {
        font-size: 15px !important;
        color: #8e8e93 !important;
        line-height: 1.5 !important;
    }

    /* Video Cards (View 3) */
    .video-card {
        border-radius: 24px !important;
        overflow: hidden !important;
        background: #1c1c1e !important;
        border: none !important;
    }
    .video-card video {
        border-radius: 24px 24px 0 0 !important;
    }
    .secondary-btn {
        background: #2c2c2e !important;
        color: #fff !important;
        border-radius: 20px !important;
        margin: 16px !important;
        width: calc(100% - 32px) !important;
        height: 50px !important;
        font-weight: 600 !important;
        border: none !important;
    }
}


/* ==========================================================================
   GLOBAL BULLETPROOF LAYOUT (PC & MOBILE)
   ========================================================================== */
/* Fix the disappearing / squished cards issue */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #000;
}

#app-content {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center views horizontally */
    overflow-y: auto;
    
}

.view {
    display: none !important;
    width: 100%;
    max-width: 1200px; /* PC constraint */
    flex: 1; /* Take up remaining height in app-content */
}
.view.active {
    display: flex !important;
    flex-direction: column;
}

/* Home view specific fixes */
.cards-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%; /* PREVENT SQUISHING */
    flex: 1; /* FILL HEIGHT */
    gap: 20px;
    padding: 20px;
}
.home-menu-card {
    width: 100%;
    max-width: 400px;
    background: #1c1c1e !important;
    border-radius: 24px !important;
    padding: 30px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
}

@media (min-width: 769px) {
    .cards-container {
        flex-direction: row !important; /* Side by side on PC */
        gap: 50px !important;
    }
    .home-menu-card {
        height: 400px !important;
        max-width: 500px !important;
    }
}


/* ==========================================================================
   FINAL MOBILE HOTFIXES (Speaker + Scroll)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Remove speaker icon on mobile */
    .volume-control, #custom-mute-btn, #volume-icon {
        display: none !important;
    }
    
    /* 2. Absolute kill of horizontal scrolling */
    html, body, #app, #app-content, .view, .course-container {
        max-width: 100vw !important;
        
        box-sizing: border-box !important;
    }
    
    /* Make sure audio timeline doesn't push width out */
    .custom-audio-player {
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Ensure padding doesn't increase width */
    * {
        max-width: 100vw !important;
    }
}


/* Hide redundant middle button on mobile, since we have the sticky bottom one */
@media (max-width: 768px) {
    #scroll-indicator-wrapper {
        display: none !important;
    }
}


/* ==========================================================================
   PERFECT MOBILE ONE-SCREEN FIT & VISIBILITY FIX
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Fix Visibility Bug (Don't force display: flex always) */
    #view-course-layout.viewing-list .course-content {
        display: none !important;
    }
    #view-course-layout.viewing-player aside {
        display: none !important;
    }
    
    #view-course-layout.viewing-list aside {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
    }
    #view-course-layout.viewing-player .course-content {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow: hidden !important;
    }

    /* 2. One Screen Fit for Player */
    .course-content {
        padding: 0 15px 0 15px !important; /* Remove top/bottom padding to let button drop lower */
        margin-bottom: 0 !important;
    }
    
    .course-card {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 5px 15px 0 15px !important; /* Push everything up to make subtitle box taller */
        margin-bottom: 0 !important;
    }
    
    .course-card-inner {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    
    .course-header-section {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        margin-bottom: 0 !important;
        min-height: 0 !important;
    }

    .course-title-block {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
    }

    /* 3. Shrink Subtitles & Make Scrollable */
    .tiktok-subtitles-container {
        flex: 1 !important;
        overflow-y: auto !important;
        min-height: 0 !important;
        font-size: 1.2rem !important; /* Smaller fonts */
        line-height: 1.4 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important; /* Vertically center if short */
        padding: 10px 0 !important;
    }
    
    /* 4. Restore the inline button and style it */
    #scroll-indicator-wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        margin-top: 10px !important;
    }
    
    .scroll-bounce {
        display: none !important; /* Hide chevron down */
    }
    
    #course-expand-btn {
        background: #4A72FF !important;
        color: white !important;
        border: none !important; /* Remove border */
        outline: none !important;
        padding: 12px 24px !important;
        border-radius: 30px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        width: 100% !important;
        text-align: center !important;
        margin: 0 !important;
        text-transform: none !important; /* Don't uppercase it if we don't want */
    }
}


/* When expanded on mobile, we need it to look good too */
#course-card.expanded #course-expand-btn {
    background: #111 !important;
    border: 1px solid #333 !important;
}


/* ==========================================================================
   FINAL VISIBILITY & OUTSIDE BUTTON FIX
   ========================================================================== */
@media (max-width: 768px) {
    /* STRICT VISIBILITY RULES */
    
    
    
    /* BUTTON OUTSIDE CARD */
    #scroll-indicator-wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        margin-top: 15px !important; /* Restore 15px gap (wrapper is outside grid) */
        padding-bottom: 0 !important; /* Touch bottom edge */
    }
    
    #course-expand-btn {
        background: #4A72FF !important;
        color: white !important;
        border: none !important;
        outline: none !important;
        padding: 16px 24px !important;
        border-radius: 30px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        width: 100% !important;
        text-align: center !important;
        margin: 0 !important;
    }
    
    /* Subtitles height to perfectly fit button on screen */
    .course-card {
        flex: 1 !important; /* Take full height */
        max-height: none !important;
    }
    .tiktok-subtitles-container {
        font-size: 1.1rem !important;
    }
}




/* ==========================================================================
   DESKTOP LAYOUT REPAIRS
   ========================================================================== */
@media (min-width: 769px) {
    /* 1. Ensure the course card is wide and takes full flex space horizontally */
    .course-card {
        background: #151515 !important;
        border-radius: 20px !important;
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        overflow-y: auto !important;
        flex: 1 !important;
    }
    
    .course-card-inner {
        padding: 50px 60px !important;
        width: 100% !important;
        margin: 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
        padding-top: 0 !important;
    }

    .course-content {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        flex: 1 !important;
    }

    /* 2. Audio Player on Desktop should be wide, not clamped to 400px */
    #course-audio-player,
    .custom-audio-player {
        width: 100% !important;
        max-width: none !important;
    }
    
    .custom-audio-player-container {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin-bottom: 20px !important;
    }

    /* 3. The "KROTKO W TEKSCIE" Button Desktop styles */
    #course-expand-btn {
        background: none !important;
        border: none !important;
        color: white !important;
        padding: 0 !important;
        width: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 5px !important;
        margin: 0 auto !important;
    }
    
    #course-expand-btn span {
        font-size: 0.8rem !important;
        font-weight: bold !important;
        letter-spacing: 1px !important;
        text-transform: uppercase !important;
        color: white !important;
    }
    
    #scroll-indicator-wrapper {
        margin-top: 30px !important;
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }

    /* 4. Subtitles Container Desktop */
    .tiktok-subtitles-container {
        font-size: 2.1rem !important;
        max-width: 900px !important;
        justify-content: center !important;
        text-align: center !important;
        align-items: center !important;
        height: auto !important;
        margin: 0 auto !important;
    }
    
    /* 5. Course Title Block */
    .course-title-block {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        flex: 1 !important;
    }
    
    /* 6. Overall Course Header Section */
    .course-header-section {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        flex: 1 !important;
        width: 100% !important;
    }
    
    .course-card.expanded .course-header-section {
        display: none !important;
    }
}


/* ==========================================================================
   SUPER DESKTOP REPAIRS - PIXEL PERFECT
   ========================================================================== */
@media (min-width: 769px) {
    /* Prevent whole page scroll, keep navbar visible always */
    html, body {
        height: 100vh !important;
        overflow: hidden !important;
        background: #000 !important;
    }

    #app-content {
        height: calc(100vh - 70px) !important;
        padding: 20px 40px 40px 40px !important;
        overflow: hidden !important;
        display: flex !important;
        justify-content: center !important;
        align-items: flex-start !important;
    }

    .course-container {
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 30px !important;
        align-items: stretch !important;
    }

    /* Left Sidebar */
    aside {
        width: 320px !important; /* Fixed width for sidebar */
        min-width: 320px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    .course-sidebar-block {
        background: #151515 !important;
        border-radius: 20px !important;
        padding: 30px !important;
        
        margin: 0 !important;
    }
    
    .course-sidebar-block.no-scrollbar {
        overflow-y: auto !important;

    }

    /* Right Content Area */
    .course-content {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        flex: 1 !important;
        padding: 0 !important;
    }

    .course-card {
        background: #151515 !important;
        border-radius: 20px !important;
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        overflow: hidden !important; /* Hide scrollbar on card itself */
        flex: 1 !important;
    }
    
    .course-card-inner {
        padding: 40px 60px !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    /* Audio Player */
    .custom-audio-player-container {
        width: 100% !important;
        display: flex !important;
        justify-content: stretch !important;
        margin-bottom: 20px !important;
    }

    #course-audio-player,
    .custom-audio-player {
        width: 100% !important;
        max-width: none !important;
        display: flex !important;
        justify-content: space-between !important;
    }
    
    .waveform {
        justify-content: space-between !important;
        flex: 1 !important;
        margin: 0 !important;
    }

    /* Subtitles Container */
    .course-title-block {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .tiktok-subtitles-container {
        font-size: 3rem !important; /* Make it match mockup size */
        max-width: 900px !important;
        justify-content: center !important;
        text-align: center !important;
        align-items: center !important;
        height: auto !important;
        margin: 0 auto !important;
    }
    
    /* Remove glow effect to match mockup */
    .subtitle-word.active {
        color: #fff !important;
        text-shadow: none !important;
        transform: none !important;
    }

    /* Button */
    #scroll-indicator-wrapper {
        margin-top: auto !important; /* Push to bottom */
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }

    #course-expand-btn {
        background: none !important;
        border: none !important;
        color: white !important;
        padding: 0 !important;
        width: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 5px !important;
        margin: 0 auto !important;
    }
    
    #course-expand-btn span {
        font-size: 0.8rem !important;
        font-weight: bold !important;
        letter-spacing: 1px !important;
        text-transform: uppercase !important;
        color: white !important;
    }
}


/* ==========================================================================
   SUPER DESKTOP REPAIRS - PIXEL PERFECT
   ========================================================================== */
@media (min-width: 769px) {
    /* Prevent whole page scroll, keep navbar visible always */
    html, body {
        height: 100vh !important;
        overflow: hidden !important;
        background: #000 !important;
    }

    #app-content {
        height: calc(100vh - 70px) !important;
        padding: 40px !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
    }

    .view {
        margin: 0 auto !important;
        max-width: 1200px !important;
        width: 100% !important;
    }

    .course-container {
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 40px !important;
        align-items: stretch !important;
    }

    /* Left Sidebar */
    aside {
        width: 320px !important; /* Fixed width for sidebar */
        min-width: 320px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    .course-sidebar-block {
        background: #151515 !important;
        border-radius: 20px !important;
        padding: 30px !important;
        
        margin: 0 !important;
    }

    /* Right Content Area */
    .course-content {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        flex: 1 !important;
        padding: 0 !important;
    }

    .course-card {
        background: #151515 !important;
        border-radius: 20px !important;
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        overflow: hidden !important; /* Hide scrollbar on card itself */
        flex: 1 !important;
    }
    
    .course-card-inner {
        padding: 40px 60px !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }

    /* Audio Player */
    .custom-audio-player-container {
        width: 100% !important;
        display: flex !important;
        justify-content: stretch !important;
        margin-bottom: 20px !important;
    }

    #course-audio-player,
    .custom-audio-player {
        width: 100% !important;
        max-width: none !important;
        display: flex !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }
    
    .waveform {
        justify-content: space-between !important;
        flex: 1 !important;
        margin: 0 !important;
        overflow: hidden !important; /* Prevent bleeding */
    }

    .waveform-bar {
        flex-shrink: 1 !important; /* Let them squish if needed */
    }

    /* Subtitles Container */
    .course-title-block {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .tiktok-subtitles-container {
        font-size: 3rem !important; /* Make it match mockup size */
        max-width: 900px !important;
        justify-content: center !important;
        text-align: center !important;
        align-items: center !important;
        height: auto !important;
        margin: 0 auto !important;
    }
    
    /* Remove glow effect to match mockup */
    .subtitle-word.active {
        color: #fff !important;
        text-shadow: none !important;
        transform: none !important;
    }

    /* Button */
    #scroll-indicator-wrapper {
        margin-top: auto !important; /* Push to bottom */
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }

    #course-expand-btn {
        background: none !important;
        border: none !important;
        color: white !important;
        padding: 0 !important;
        width: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 5px !important;
        margin: 0 auto !important;
    }
    
    #course-expand-btn span {
        font-size: 0.8rem !important;
        font-weight: bold !important;
        letter-spacing: 1px !important;
        text-transform: uppercase !important;
        color: white !important;
    }
}


.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}


#view-initial-quiz .prompt-card {
    background: transparent !important;
    border: none !important;
}
#view-initial-quiz .prompt-content {
    background: transparent !important;
}
#view-initial-quiz h2.small-header {
    font-size: 1rem !important;
    color: #888 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    margin-bottom: 20px !important;
}
#view-initial-quiz h1.main-header {
    font-size: 3rem !important;
    color: #fff !important;
    margin-bottom: 20px !important;
}
#view-initial-quiz p.desc {
    font-size: 1.2rem !important;
    color: #888 !important;
    max-width: 600px !important;
    margin: 0 auto 40px auto !important;
    line-height: 1.5 !important;
}
#view-initial-quiz .btn.primary-btn {
    background: #00C853 !important; /* Green like mockup */
    color: #fff !important;
    border-radius: 30px !important;
    padding: 15px 40px !important;
    font-weight: bold !important;
    font-size: 1.1rem !important;
    width: auto !important;
    min-width: 250px !important;
}


/* Removed overflow hidden to allow tooltips */
.course-sidebar-block:not(.no-scrollbar) {
    overflow: visible !important;
}

/* Fix video card background for Quiz */
#view-compare .video-card {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
}

#view-compare .video-card button.btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    z-index: 30;
}

@media (hover: hover) {
    #view-compare .video-card button.btn {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        pointer-events: none;
    }
    #view-compare .video-card:hover button.btn {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
        pointer-events: auto;
    }
}

/* Fix Krotko w tekscie scroll */
.course-card.expanded .course-text-section {
    overflow-y: auto !important;
    max-height: none !important;
    flex: 1;
}

/* Ensure the course content allows vertical scroll if needed */
.course-content {
    overflow-y: auto !important;
}

.course-card.expanded .scroll-indicator-wrapper {
    max-height: 200px !important;
    opacity: 1 !important;
    overflow: visible !important;
    display: flex !important;
    margin-top: 20px !important;
}

/* Hide scrollbar visually but keep functionality for course text sections */
.course-text-section::-webkit-scrollbar,
.course-content::-webkit-scrollbar,
.course-card.expanded .course-text-section::-webkit-scrollbar {
    display: none !important;
}

.course-text-section,
.course-content,
.course-card.expanded .course-text-section {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}


/* FORCE HIDE ALL SCROLLBARS IN COURSE SECTION */
.course-card::-webkit-scrollbar, .course-card *::-webkit-scrollbar, .course-sidebar-block::-webkit-scrollbar, .course-sidebar-block *::-webkit-scrollbar, .course-content::-webkit-scrollbar, .course-text-section::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; background: transparent !important; }
.course-card, .course-card *, .course-sidebar-block, .course-sidebar-block *, .course-content, .course-text-section { -ms-overflow-style: none !important; scrollbar-width: none !important; }

/* SUPER FORCE HIDE ALL SCROLLBARS */
::-webkit-scrollbar { width: 0px !important; height: 0px !important; display: none !important; background: transparent !important; }
* { -ms-overflow-style: none !important; scrollbar-width: none !important; }


/* View 5: Analysis */
.analysis-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

.analysis-sidebar {
    width: 350px;
    background: var(--card-bg, #1a1a1a);
    padding: 30px;
    overflow-y: auto;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.analysis-main {
    flex: 1;
    padding: 20px;
    position: relative;
    background: #111;
}

.artifact-buttons-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.artifact-btn {
    background: #2a2a2a;
    border: 1px solid #444;
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s ease;
}

.artifact-btn:hover {
    background: #3a3a3a;
    border-color: #666;
}

.artifact-btn i {
    width: 20px;
    height: 20px;
}

.mobile-artifact-btn-container {
    display: none;
}

@media (max-width: 768px) {
    .analysis-sidebar {
        display: none;
    }
    .analysis-main {
        padding: 0;
    }
    #analysis-main-video {
        border-radius: 0;
    }
    .mobile-artifact-btn-container {
        display: flex;
        position: absolute;
        bottom: 30px;
        left: 0;
        width: 100%;
        justify-content: center;
        z-index: 10;
    }
    .artifact-modal-content {
        padding: 20px !important;
        width: 95% !important;
    }
    #artifact-images-container {
        flex-direction: column;
    }
    #artifact-arrow {
        transform: rotate(90deg);
        margin: 10px 0;
    }
}


/* --- New Artifact Layout Styles --- */
.artifact-split-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.artifact-accordion-list {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.artifact-accordion-btn {
    background: #1a1a1a;
    border: 1px solid #333;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.artifact-accordion-btn:hover {
    background: #252525;
    border-color: #555;
}

.artifact-accordion-btn.active {
    background: #2a2a2a;
    border-color: #666;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

.artifact-accordion-content {
    background: #1a1a1a;
    border: 1px solid #666;
    border-top: none;
    padding: 20px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    #quiz-videos-container {
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
    }
    #quiz-videos-container::-webkit-scrollbar {
        display: none !important;
    }
}

html.quiz-active-noscroll, body.quiz-active-noscroll {
    overflow: hidden !important;
    height: 100dvh !important;
    position: fixed;
    width: 100%;
}
#quiz-videos-container { overflow-y: hidden !important; }

@media (max-width: 768px) {
    .desktop-only-btn { display: none !important; }
}
@media (max-width: 380px) {
    .quiz-pill-text { font-size: 13px !important; }

    .course-item {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    .course-item::after {
        content: '';
        display: inline-block;
        width: 16px;
        height: 16px;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2334C759" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>');
        background-size: contain;
        background-repeat: no-repeat;
        flex-shrink: 0;
        margin-left: 10px;
    }
}


/* EMERGENCY MOBILE FIXES FOR COURSE LAYOUT */
@media (max-width: 768px) {
    #view-course-layout .course-container {
        flex-direction: column !important;
        padding: 0 !important;
        margin: 0 !important;
        height: 100% !important; /* Fix for overflow caused by safe-area inset */
        max-height: none !important;
    }
    
    #view-course-layout aside {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 20px !important;
        box-sizing: border-box !important;
    }
    
    #mobile-list-header {
        width: 100% !important;
        padding: 0 20px !important;
        box-sizing: border-box !important;
        display: flex !important;
    }
}


/* EMERGENCY MOBILE FIXES 2 - COURSE CONTENT VISIBILITY */
@media (max-width: 768px) {
    #view-course-layout.viewing-list .course-content {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    #view-course-layout.viewing-player aside {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}


/* SPACING AND BULLETPROOF VISIBILITY FIXES */
@media (max-width: 768px) {
    /* 1. Spacing Fixes */
    #view-course-layout .course-container {
        gap: 10px !important;
    }
    #mobile-list-header {
        margin-bottom: 5px !important;
    }
    #view-course-layout aside {
        gap: 10px !important;
    }
    .course-sidebar-block {
        margin-bottom: 0 !important;
    }

    /* 2. Bulletproof default visibility */
    #view-course-layout .course-content {
        display: none !important;
    }
    #view-course-layout aside {
        display: flex !important;
    }
    
    /* 3. When in player view */
    #view-course-layout.viewing-player .course-content {
        display: flex !important;
    }
    #view-course-layout.viewing-player aside {
        display: none !important;
    }
    
    /* 4. When in list view (redundant but safe) */
    #view-course-layout.viewing-list .course-content {
        display: none !important;
    }
    #view-course-layout.viewing-list aside {
        display: flex !important;
    }
}






/* ==========================================================================
   FINAL POLISH: BULLETPROOF MOBILE PLAYER LAYOUT 
   Ensures perfect stretch, alignment, and responsiveness without breaking PC
   ========================================================================== */

/* Hide all scrollbars universally */
::-webkit-scrollbar { 
    width: 0px !important; 
    height: 0px !important; 
    display: none !important; 
    background: transparent !important; 
}
* { 
    -ms-overflow-style: none !important; 
    scrollbar-width: none !important; 
}

@media (max-width: 768px) {
    /* 1. Reset Global Container Shrink-Wrapping */
    #view-course-layout.viewing-player .course-content, 
    .course-content {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        height: 100% !important; /* Required for iOS Safari */
        align-items: stretch !important; /* Force children to stretch horizontally */
        width: 100vw !important; /* Take full screen width */
        max-width: 100% !important;
        padding: 0 20px !important; /* Uniform 20px padding from screen edges */
        box-sizing: border-box !important;
        
    }

    /* 2. Fix Course Card (Wrapper for subtitles and audio) */
    .course-card {
        width: 100% !important;
        align-self: stretch !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 1 !important; /* Fill remaining vertical space */
        height: 100% !important; /* Required for iOS Safari */
        min-height: 0 !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .course-card-inner {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        align-items: stretch !important; /* Stretch inner components! */
        box-sizing: border-box !important;
        flex: 1 !important;
        height: 100% !important; /* Required for iOS Safari */
        min-height: 0 !important;
        padding: 0 !important; /* 0 padding on L/R/Top to push everything up */
    }

    /* Subtitles Card */
    #course-header-section, .course-header-section {
        width: 100% !important;
        box-sizing: border-box !important;
        display: grid !important;
        grid-template-rows: auto 1fr auto !important;
        grid-template-columns: 100% !important; /* Force full width columns */
        justify-items: stretch !important; /* Force items to stretch horizontally */
        flex: 1 !important; /* It wraps everything, so it must stretch! */
        height: 100% !important;
        gap: 15px !important; /* FOOLPROOF EQUAL SPACING */
    }

    /* 3. Header and Pill Alignment */
    #mobile-player-header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important; /* Align to the left, don't center */
        align-items: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 15px !important; /* Gap 1 */
        margin-top: 0 !important;
    }

    .header-pill {
        background: #1c1c1e !important;
        border-radius: 30px !important;
        padding: 10px 18px !important; /* Consistent padding */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important; /* Let it wrap text cleanly */
        font-weight: 600 !important;
    }

    /* 4. Audio Player Perfection */
    .custom-audio-player-container {
        width: 100% !important; /* Exactly 100% of parent */
        align-self: stretch !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin-bottom: 0 !important; /* Removed in favor of grid gap */
    }

    .custom-audio-player {
        display: flex !important;
        width: 100% !important; 
        align-self: stretch !important;
        background: #1c1c1e !important; /* Matches course list cards */
        border-radius: 40px !important;
        padding: 12px 15px 12px 10px !important; /* Move play button more left */
        align-items: center !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        gap: 15px !important;
    }

    .play-btn {
        flex-shrink: 0 !important;
    }

    .waveform {
        display: flex !important;
        flex: 1 !important; /* Take remaining space */
        min-width: 0 !important; /* Allow shrinking below min-content */
        margin: 0 !important; /* Breathing room */
        align-items: center !important;
        justify-content: center !important; /* Center the bars so spacing is symmetrical */
        gap: 2px !important;
        overflow: hidden !important;
    }

    .time-display {
        flex-shrink: 0 !important;
        min-width: 45px !important; /* Guaranteed space for 00:00 */
        text-align: right !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
    }

    /* 5. Subtitle Card */
    .course-title-block {
        width: 100% !important;
        max-width: none !important; /* Prevent shrinking */
        align-self: stretch !important;
        background: #151515 !important;
        border-radius: 24px !important;
        padding: 30px 20px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important; /* Center text inside */
        box-sizing: border-box !important;
        flex: 1 !important;
        margin-bottom: 0 !important; /* Removed completely */
        /* min-height removed so it doesn't overflow screen */
    }

    /* Force remove padding between title block and blue button */
    .scroll-indicator-wrapper {
        padding-top: 0 !important;
        padding-bottom: 0 !important; /* Remove bottom padding to bring it closer to edge */
        margin-bottom: 0 !important;
        margin-top: 15px !important; /* Gap 3 */
    }
    
    #scroll-indicator-wrapper {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
        margin-top: 15px !important; /* Gap 3 */
    }

    .tiktok-subtitles-container {
        display: block !important; /* Text flows naturally */
        text-align: center !important;
        width: 100% !important;
        font-size: 1.8rem !important; /* Good readable size */
        line-height: 1.4 !important;
    }

    .tiktok-subtitles-container .word-anim {
        display: inline-block !important;
        margin: 0 4px 10px 4px !important; /* Space between words */
        font-weight: 700 !important;
    }
}


/* ==========================================================================
   QUIZ CAROUSEL SWIPE FIX FOR MOBILE
   Ensures native swipe works by enforcing touch-action and overscroll-behavior
   ========================================================================== */
#quiz-videos-container {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth !important;
    touch-action: pan-x pan-y !important; /* Forces browser to handle swipe natively */
    overscroll-behavior-x: contain !important; /* Prevents swipe-to-go-back gesture */
}

.quiz-carousel-card { position: relative !important;
    touch-action: pan-x pan-y !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.quiz-carousel-card video {
    touch-action: pan-x pan-y !important; /* Prevents video from swallowing touch */
}





@media (min-width: 769px) {
    #quiz-videos-container {
        overflow-x: hidden !important; /* No horizontal scroll on PC */
        justify-content: center;
    }
}


@media (max-width: 768px) {
    #quiz-videos-container {
        overflow-x: hidden !important; /* Disable native scroll */
        scroll-snap-type: none !important;
        -webkit-scroll-snap-type: none !important;
        touch-action: none !important; /* Let our global listener handle everything */
    }
}


/* EMERGENCY FIX FOR MOBILE SWIPE LAYOUT */
@media (max-width: 768px) {
    #quiz-videos-container {
        flex-direction: row !important;
    }
}

.course-card.expanded #tiktok-subtitles-container,
#view-course-layout.viewing-text #tiktok-subtitles-container {
    display: none !important;
}


@media (max-width: 768px) {
    /* Praktyka Module Layout Fix for Mobile */
    #integrated-artifact-analysis:not(.hidden) {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        overflow-y: auto !important;
        padding-bottom: 40px !important;
    }
    #integrated-artifact-analysis > div {
        flex-direction: column !important; /* Video on top, buttons below */
        height: auto !important;
        overflow: visible !important;
        gap: 20px !important;
    }
    
    .artifact-buttons-list {
        max-width: 100% !important;
        flex-direction: row !important;
        flex-wrap: wrap !important; /* Wrap buttons instead of scroll */
        justify-content: center !important;
        overflow: visible !important;
        padding-right: 0 !important;
        height: auto !important;
        gap: 10px !important;
    }
    
    .artifact-content-area {
        height: auto !important;
        min-height: 300px !important;
        width: 100% !important;
        margin-bottom: 20px !important;
    }
    
    .artifact-btn {
        flex: 1 1 calc(50% - 10px) !important; /* 2 buttons per row */
        margin: 0 !important;
        min-width: 140px !important;
        text-align: center !important;
        justify-content: center !important;
    }
    .artifact-media-container {
        flex: none !important;
        width: 100%;
        overflow: visible !important;
    }
}


.do-marquee { animation: marquee-custom 4s ease-in-out infinite alternate forwards !important; }
@keyframes marquee-custom { 0%, 10% { transform: translateX(0); } 90%, 100% { transform: translateX(var(--marquee-dist)); } }

.course-card.expanded .custom-audio-player-container, #view-course-layout.viewing-text .custom-audio-player-container { display: none !important; }
.course-card.expanded #course-expand-btn, #view-course-layout.viewing-text #course-expand-btn { display: none !important; }

.course-card.expanded #course-header-section, #view-course-layout.viewing-text #course-header-section { display: none !important; }

/* Artifact Mobile Layout Fixes */
@media (max-width: 768px) {
    .artifact-analysis-layout {
        flex-direction: column !important;
    }
    
    .artifact-mobile-toggle {
        display: flex !important;
        bottom: 50px !important; /* Move higher to clear Safari navigation bar */
    }
    
    #mobile-artifact-buttons-list {
        display: none; /* hidden by default on mobile, toggled via JS */
    }
}

#mobile-artifact-buttons-list {
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    #mobile-artifact-buttons-list {
        display: none;
    }
    #mobile-artifact-buttons-list.expanded {
        display: flex !important;
    }
    
    #artifact-default-video {
        width: 100vw;
        max-width: 100vw !important;
        border-radius: 0 !important;
        margin-left: -20px; /* offset the layout padding if any */
    }
    
    #artifact-default-video-container {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px) !important;
    }
}

@media (max-width: 768px) {
    .artifact-media-container {
        /* order removed */
    }
}

/* Orientation Overlay */
#orientation-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--card-bg);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
    padding: 24px;
}

#orientation-overlay .orientation-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: pulse-rotate 2s infinite ease-in-out;
}

#orientation-overlay i {
    width: 64px;
    height: 64px;
    color: var(--accent);
}

#orientation-overlay h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(to right, #93C5FD, #C4B5FD);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#orientation-overlay p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 300px;
}

@keyframes pulse-rotate {
    0% { transform: rotate(-90deg) scale(1); }
    50% { transform: rotate(0deg) scale(1.1); }
    100% { transform: rotate(-90deg) scale(1); }
}

@media screen and (max-device-width: 950px) and (orientation: landscape) and (max-height: 500px) {
    #orientation-overlay {
        display: flex;
    }
}

/* ==========================================================================
   IPAD & TABLET SPECIFIC FIXES 
   ========================================================================== */
@media screen and (min-width: 769px) and (max-width: 1200px) {
    /* Fix buttons being pushed off screen due to 100vh Safari issues */
    #view-initial-quiz .prompt-card {
        height: auto !important;
        justify-content: center !important;
        margin-top: 10px !important;
        margin-bottom: 10px !important;
        gap: 30px !important;
    }
    
    #app-content {
        overflow: hidden !important;
        height: 100% !important;
        max-height: calc(100vh - 70px) !important;
        padding: 10px 20px !important; /* Move elements up */
    }
    
    html, body {
        height: 100% !important;
        overflow: hidden !important;
    }
}

/* ==========================================================================
   DESKTOP/IPAD WYBIERZ BUTTON & VIDEO STRETCH
   ========================================================================== */
@media screen and (min-width: 769px) {
    /* Style the individual Wybierz button under each video */
    .btn-select-video {
        display: block !important;
        width: 100% !important;
        height: 52px !important;
        background: white !important;
        color: black !important;
        border-radius: 25px !important;
        border: none !important;
        font-size: 18px !important;
        font-weight: 600 !important;
        font-family: Inter, sans-serif !important;
        cursor: pointer !important;
        margin-top: 15px !important;
        flex-shrink: 0 !important;
        position: relative !important;
        z-index: 1000 !important; /* Fix: stay above swipe protector */
        pointer-events: auto !important;
    }
    
    /* Ensure the video card is a flex column */
    .video-card.quiz-carousel-card {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Stretch the video vertically to fill the card */
    .video-card.quiz-carousel-card .quiz-video {
        flex: 1 !important;
        min-height: 0 !important;
        height: auto !important;
        object-fit: cover !important;
    }
    
    /* Hide the common bottom "Wybierz" button since we have individual ones,
       but SHOW it when it turns into "Dalej" (finish-quiz-toast) after selection */
    #quiz-select-btn[data-action="select-current-video"] {
        display: none !important;
    }
}

/* ==========================================================================
   CZY NA PEWNO - IMAGE DESIGN
   ========================================================================== */
#view-not-finished .prompt-card {
    position: relative;
    overflow: hidden;
    background: #111; /* Ensure dark background */
}

#view-not-finished .prompt-text,
#view-not-finished button {
    position: relative;
    z-index: 10;
}

#view-not-finished .prompt-image {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 600px !important; /* Huge image */
    max-width: 150vw !important;
    max-height: none !important;
    height: auto !important;
    z-index: 0 !important;
    /* Gradient mask: opaque at top, transparent at bottom */
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

/* ==========================================================================
   QUIZ FEEDBACK ANIMATIONS
   ========================================================================== */
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5); }
    70% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeInOverlay {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

#quiz-feedback-overlay:not(.hidden) {
    animation: fadeInOverlay 0.3s ease-out forwards;
}

#quiz-feedback-overlay:not(.hidden) #quiz-feedback-icon {
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}


/* ==========================================================================
   TINY SMARTPHONES FIX (IPHONE 7 / SE)
   Horizontal scrolling for artifact buttons to save vertical space
   ========================================================================== */
@media screen and (max-width: 395px) {
    #mobile-artifact-buttons-list {
        display: none;
    }
    #mobile-artifact-buttons-list.expanded {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        justify-content: flex-start !important;
        padding: 10px 20px 80px 20px !important; /* Extra bottom padding for floating toggle */
        gap: 15px !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
    }
    
    #mobile-artifact-buttons-list::-webkit-scrollbar {
        display: none !important;
    }
    
    .artifact-btn {
        flex: 0 0 160px !important; /* Fixed width, no wrap */
        min-height: 60px !important;
        height: auto !important;
        scroll-snap-align: center !important;
        margin: 0 !important;
        white-space: normal !important;
        padding: 10px !important;
        font-size: 0.95rem !important; /* Slightly smaller text */
        line-height: 1.2 !important;
    }
}

/* Default Mobile Layout for Artifact Display */
.dynamic-artifact-display {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}
.prompt-card {
    border-radius: 40px;
}

/* ==========================================================================
   ARTEFAKT MODULE REDESIGN (IPAD & DESKTOP - MOBILE STYLE)
   ========================================================================== */
@media screen and (min-width: 769px) {
    #integrated-artifact-analysis {
        overflow: hidden !important; 
        position: relative !important;
    }
    
    .artifact-analysis-layout {
        display: block !important; /* Remove flex to stack them absolutely */
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Video container takes full space */
    .artifact-media-container {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        z-index: 1 !important;
        padding: 0 !important;
        background: transparent !important;
    }
    
    /* 2-Column Layout for Artifact Info (Only when there are images) */
    .dynamic-artifact-display.has-images {
        flex-direction: row !important;
        align-items: flex-start !important; /* Start from top so text doesn't center awkwardly */
        justify-content: space-between !important;
        gap: 30px !important;
        width: 100% !important;
        max-width: 100% !important; /* Allow it to stretch to the edges */
        height: 100% !important; /* Take full height */
        padding: 0 !important; /* Remove the 40px padding to use edge space */
        margin: 0 !important;
    }
    .dynamic-artifact-display.has-images .dynamic-artifact-text-side {
        flex: 1 !important;
        max-width: 50% !important;
        text-align: left !important;
        overflow-y: auto !important; /* Allow scrolling if text is very long */
        padding-right: 20px !important;
        height: 100% !important;
    }
    .dynamic-artifact-display.has-images .dynamic-artifact-media-side {
        flex: 1 !important;
        max-width: 50% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        height: 100% !important;
    }

    /* Single Column Layout (When NO images exist) */
    .dynamic-artifact-display:not(.has-images) {
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        width: 100% !important;
        height: 100% !important;
        overflow-y: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 20px !important;
    }
    .dynamic-artifact-display:not(.has-images) .dynamic-artifact-text-side {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }
    .dynamic-artifact-display:not(.has-images) .dynamic-artifact-media-side {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        align-items: flex-start !important; /* Align audio player to left under text */
    }
    
    #dynamic-artifact-title {
        font-size: 1.8rem !important;
        margin-bottom: 20px !important;
    }
    #dynamic-artifact-desc {
        font-size: 1.1rem !important;
    }
    
    #artifact-default-video {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
        border-radius: 16px !important;
    }
    
    /* Wrapper for buttons sits on top but lets clicks pass through */
    .artifact-buttons-wrapper {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: 100% !important; /* Override inline max-width: 350px */
        height: 100% !important;
        pointer-events: none !important; 
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Floating toggle button */
    .artifact-mobile-toggle {
        display: flex !important; 
        position: absolute !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 60px !important;
        height: 60px !important;
        border-radius: 30px !important;
        background: rgba(0, 0, 0, 0.7) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        backdrop-filter: blur(15px) !important;
        color: white !important;
        border: none !important;
        justify-content: center !important;
        align-items: center !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 1000 !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5) !important;
        padding: 0 !important;
        pointer-events: auto !important; /* Enable clicks */
    }
    
    .artifact-mobile-toggle.expanded-state {
        width: 250px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        color: black !important;
        justify-content: space-between !important;
        padding: 0 25px !important;
    }
    
    .artifact-mobile-toggle .btn-text, .artifact-mobile-toggle #artifact-toggle-chevron {
        display: none !important;
        font-weight: 600;
        font-size: 1.1rem;
    }
    
    .artifact-mobile-toggle.expanded-state .btn-text, .artifact-mobile-toggle.expanded-state #artifact-toggle-chevron {
        display: block !important;
    }
    
    .artifact-mobile-toggle .lucide-lightbulb {
        color: white;
    }
    
    .artifact-mobile-toggle.expanded-state .lucide-lightbulb {
        display: none !important;
    }
    
    /* Buttons list floating above toggle */
    #mobile-artifact-buttons-list {
        display: none !important;
        position: absolute !important;
        bottom: 90px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 300px !important;
        max-height: calc(100% - 120px) !important;
        overflow-y: auto !important;
        align-items: center;
        z-index: 999 !important;
        background: rgba(20, 20, 20, 0.8) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        backdrop-filter: blur(15px) !important;
        padding: 20px !important;
        border-radius: 20px !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
        pointer-events: auto !important; /* Enable clicks */
        flex-direction: column !important;
    }
    
    #mobile-artifact-buttons-list.expanded {
        display: flex !important;
        animation: fadeInSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }
    
    @keyframes fadeInSlideUp {
        from { opacity: 0; transform: translate(-50%, 20px); }
        to { opacity: 1; transform: translate(-50%, 0); }
    }
    
    .artifact-btn {
        width: 100% !important; 
        padding: 14px !important;
        margin-bottom: 10px !important;
        flex-shrink: 0 !important;
    }
}

/* ==========================================================================
   PC HOTFIXES (Desktop Only > 1024px)
   ========================================================================== */
@media (min-width: 1025px) {
    /* Increase size of Home Menu Cards */
    .home-menu-card {
        height: 80vh !important;
        min-height: 600px !important;
        max-width: 800px !important;
        padding: 60px !important;
        border-radius: 50px !important;
    }
    .home-menu-card h2 {
        font-size: 3.5rem !important;
        margin-bottom: 60px !important;
    }
    .home-menu-card img.card-image {
        max-width: 600px !important;
        width: 80% !important;
        height: auto !important;
        max-height: 600px !important;
    }
    
    .pc-only-stats {
        display: block !important;
    }
}



.partner-logos-carousel {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    margin-top: auto; /* Push to bottom if container is flex col */
    clear: both;
}
.partner-logos-carousel a {
    position: relative;
    display: block;
    width: 220px;
    height: 120px;
    text-decoration: none;
}
.partner-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}


@keyframes fade-logo {
    0%, 45% { opacity: 1; visibility: visible; }
    50%, 95% { opacity: 0; visibility: hidden; }
    100% { opacity: 1; visibility: visible; }
}
@keyframes fade-logo-reverse {
    0%, 45% { opacity: 0; visibility: hidden; }
    50%, 95% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; }
}


















@media (max-width: 600px) {
    
    
}
.partner-logos-carousel-nav {
    position: relative;
    width: 160px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.partner-logos-carousel-nav .carousel-item {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.partner-logos-carousel-nav .partner-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.partner-logos-carousel-nav .partner-text-link {
    color: #aaa;
    font-size: 0.75rem;
    text-decoration: underline;
    line-height: 1;
    white-space: nowrap;
}
.partner-logo-1 { animation: fade-1 15s infinite; }
.partner-logo-2 { animation: fade-2 15s infinite; }
.partner-logo-3 { animation: fade-3 15s infinite; }

@keyframes fade-1 {
    0%, 28% { opacity: 1; visibility: visible; }
    33%, 100% { opacity: 0; visibility: hidden; }
}
@keyframes fade-2 {
    0%, 28% { opacity: 0; visibility: hidden; }
    33%, 61% { opacity: 1; visibility: visible; }
    66%, 100% { opacity: 0; visibility: hidden; }
}
@keyframes fade-3 {
    0%, 61% { opacity: 0; visibility: hidden; }
    66%, 95% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; }
}

@media (max-width: 600px) {
    .partner-logos-carousel-nav {
        width: 130px;
        height: 30px;
    }
    .partner-logos-carousel-nav .partner-text-link {
        font-size: 0.6rem;
    }
}