: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: 100vh;
    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%;
    aspect-ratio: 9/16;
    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: hidden;
}

.progress-fill {
    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 {
        background: #141414 !important;
        border-radius: 24px !important;
        padding: 30px 20px !important;
        width: 100% !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: block !important;
    }
    .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;
    }
    .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: 24px !important;
        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% - 70px) !important; /* Subtract navbar height roughly */
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 40px !important; /* Safe area for bottom */
    }

    /* 3. NAVBAR PERFECT PROPORTIONS */
    .navbar {
        padding: 16px 20px !important;
        height: 70px !important;
        border-bottom: 1px solid rgba(255,255,255,0.05) !important;
        flex-shrink: 0 !important;
    }
    .logo img {
        height: 24px !important; /* Sleek, not too huge */
    }

    /* 4. HEADERS (Pills & Back Buttons) */
    .screen-header {
        margin-bottom: 24px !important;
        gap: 12px !important;
        padding: 0 !important; /* Container handles padding */
    }
    .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;
    }
    #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;
        max-height: none !important; /* Let #app-content handle scroll */
        overflow-y: visible !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 {
        padding: 24px 20px !important;
        background: #1c1c1e !important;
        border-radius: 24px !important;
    }
    
    /* Audio Player */
    .custom-audio-player {
        background: #1c1c1e !important;
        border-radius: 30px !important;
        padding: 10px 20px !important;
        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;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 40px !important; /* Safe area for bottom */
    }
    
    /* 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;
    }
    .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) */
    .videos-container {
        flex-direction: column !important;
        gap: 20px !important;
        padding: 0 20px !important;
    }
    .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;
    overflow-x: hidden;
}

.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;
        overflow-x: hidden !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;
    }
    #view-course-layout.viewing-player .course-content {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
        max-height: 100vh !important;
        overflow: hidden !important;
    }

    /* 2. One Screen Fit for Player */
    .course-content {
        padding: 15px !important;
    }
    
    .course-card {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 15px !important;
        margin-bottom: 0 !important;
        overflow: hidden !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;
        padding-bottom: 20px !important;
    }
    
    #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: 0 1 auto !important; /* Allow it to shrink if needed, but don't force full height */
        max-height: calc(100vh - 150px) !important;
    }
    .tiktok-subtitles-container {
        font-size: 1.1rem !important;
    }
}


