/**
 * Blinklink Super Feed - Main CSS file
 * 
 * This file contains all the CSS styles for the application,
 * organized in a modular way for better maintainability.
 */

:root {
    --primary-color: #E1251B;
    --primary-color-light: color-mix(in srgb, var(--primary-color) 10%, white);
    --course-completion-color: #008000;
    font-size: 16px;
}

/* ===== RESET AND BASE STYLES ===== */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
body {
    min-height: 100vh;
    min-height: 100dvh;
    /*font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;*/
    line-height: 1.5;
    font-size: 1rem;
    color: #333;
    background-color: #fff;
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    font-family: 'Lato', sans-serif;
}
img { max-width: 100%; display: block; height: auto; }
a { color: #000; text-decoration: none; }
a:hover { text-decoration: none; }

/* ===== LAYOUT ===== */
.layout {
    display: grid;
    /*grid-template-columns: minmax(200px, 1fr) 4fr;*/
    /*grid-template-areas: */
    /*    "sidebar header"*/
    /*    "sidebar main"*/
    /*    "sidebar footer";*/
    grid-template-columns: 260px 1fr;
    grid-template-rows: 56px 1fr;
    grid-template-areas:
        "header header"
        "sidebar main";
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #ffffff;
}

/* ===== SIDEBAR ===== */
/* Sidebar Styles */
.sidebar {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background-color: #ffffff;
    /*border-right: 1px solid #f0f0f0;*/
    /*width: 240px;*/
    overflow-y: auto;
    height: calc(100vh - 76px);
    height: calc(100dvh - 76px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.brand-logo {
    height: 32px;
    margin-right: 8px;
}

.brand-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    /*margin-bottom: 8px;*/
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    /*color: #666;*/
    text-decoration: none !important;
    transition: all 0.2s;
}

.nav-link span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;

    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%; /* 1.3125rem */
    opacity: 0.6;
}

.nav-link svg {
    opacity: 0.6;
}

.nav-link img {
    opacity: 0.6;
}

.nav-link:hover {
    background-color: var(--primary-color-light);
    color: var(--primary-color);
    text-decoration: none !important;
}

.nav-link.active {
    background-color: var(--primary-color-light); /* Light gold for active state */
    color: var(--primary-color);
}

.nav-link.active svg {
    opacity: 1;
}

.nav-link.active img {
    opacity: 0.6;
}

.nav-link.active span {
    opacity: 1;
}

.nav-icon {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 1rem;
    stroke: black;
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.nav-divider {
    background: rgba(0, 0, 0, 0.10);
    padding: 0.5px 0;
    margin: 0.5rem 0;
}

.section-title {
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    color: #333;
    margin: 0 0 0.25rem 1rem
}

.user-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-item {
    margin-bottom: 8px;
}

.user-link {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    color: #666;
    text-decoration: none !important;
    transition: all 0.2s;
}

.user-link:hover {
    background-color: var(--primary-color-light);
    color: var(--primary-color);
    text-decoration: none !important;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    color: #333;
    transition: all 0.2s;
}

.user-link:hover .user-name {
    color: var(--primary-color);
}

/* ===== MAIN CONTENT ===== */
.main {
    grid-area: main;
    padding: 0.75rem 1rem;
    overflow-y: auto; /* Enable scrolling for main content */
    position: relative;
    max-height: calc(100vh - 56px);
    max-height: calc(100dvh - 56px);
}

/* ===== HEADER ===== */
.header {
    grid-area: header;
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    width: 100vw;
    height: 56px;
    /*border-bottom: 1px solid #dee2e6;*/
    background-color: #fff;
    z-index: 1000;
    font-size: 0.75rem; /* Reduced font size to match height reduction */
}
.header h4 {
    font-size: 0.875rem; /* Smaller heading size to match reduced height */
    margin: 0 0.25rem; /* Added margin with 75% reduction (from 1rem) */
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #F9F9F9;
    border-radius: 2.5rem;
    /*padding: 8px 16px;*/
    flex: 1;
    max-width: 31.25rem;
    height: 2.5rem;
    padding: 0.5rem 0.25rem 0.5rem 0.75rem;
    gap: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.10);
}

.search-icon {
    /*margin-right: 8px;*/
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    opacity: 0.6;
}

.search-clear-icon {
    position: absolute;
    right: 16px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
    align-self: start;
}

.search-clear-icon:hover {
    opacity: 1;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    padding-right: 30px; /* Space for clear icon */

    color: #000;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    opacity: 0.7;
}

.search-title-container {
    color: #000;
    font-size: 1rem;
    font-style: normal;
    font-weight: 500;
    line-height: 120%;
    padding-top: 4px;
    padding-bottom: 1rem;
}

.search-text {
    color: var(--primary-color);
    font-weight: 700;
}

/* Sidebar close button (mobile only) */
.sidebar-close {
    display: none;
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    z-index: 10;
}

.sidebar-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.mobile-buttons {
    display: none;
    align-items: center;
    gap: 1rem;
}

.search-mobile {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.125rem;
}

.login-btn {
    display: flex;
    padding: 0.5rem;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    border: 2px solid rgba(0, 0, 0, 0.10);
    background-color: #ffffff;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 6rem;
}

.login-btn:hover {
    background-color: #f9fafb;
    border-color: rgba(0, 0, 0, 0.15);
}

.login-btn:active {
    background-color: #f3f4f6;
    transform: translateY(1px);
}

.logout-btn {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1100;
    padding: 0.5rem;
    flex-direction: column;
    align-items: flex-start;
    border-radius: 0.75rem;
    background: #FFF;
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.10);
}

.logout-btn a {
    width: 12.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    display:flex;
    align-items:center;
    gap:0.5rem;
    padding:0.375rem 0.25rem;
    border-radius:0.5rem;
    color:#000;
    text-decoration:none;
}

.badge {
    display: inline-block;
    padding: 0.125rem 0.25rem; /* Reduced by 50% to match header height */
    font-size: 0.6rem; /* Reduced from 0.75rem to match header height */
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background-color: #0d6efd;
    border-radius: 0.125rem; /* Reduced from 0.25rem */
    margin: 0 0.25rem; /* Added margin with 75% reduction (from 1rem) */
}

/* ===== ALERTS ===== */
.alert {
    padding: 0.1875rem 0.25rem; /* Reduced by 75% from 0.75rem 1rem */
    margin-bottom: 0.25rem; /* Reduced by 75% from 1rem */
    border-radius: 0.0625rem; /* Reduced by 75% from 0.25rem */
}
.alert-success { background-color: #d1e7dd; color: #0f5132; }
.alert-info { background-color: #cff4fc; color: #055160; }
.alert-danger { background-color: #f8d7da; color: #842029; }

/* ===== FOOTER ===== */
.footer {
    grid-area: footer;
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem; /* Reduced by 75% from 1rem */
    border-top: 1px solid #dee2e6;
    font-size: 0.65rem; /* Reduced from 0.875rem to match height reduction */
    color: #6c757d;
    background-color: #fff;
    z-index: 1000;
}
.footer p {
    margin: 0 0.25rem; /* Added margin with 75% reduction (from 1rem) */
}

.footer-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-nav-item {
    margin-left: 0.25rem; /* Reduced by 75% from 1rem to match footer height */
}
.footer-nav-link {
    color: #6c757d;
    font-size: 0.65rem; /* Match footer font size */
    margin: 0 0.25rem; /* Added margin with 75% reduction (from 1rem) */
    padding: 0.125rem; /* Added padding with 75% reduction (from 0.5rem) */
}

/* ===== MOBILE TOGGLE ===== */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.125rem; /* Reduced by 75% from 0.5rem */
}
.mobile-toggle-icon {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #333;
    position: relative;
}
.mobile-toggle-icon::before,
.mobile-toggle-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: #333;
    left: 0;
}
.mobile-toggle-icon::before { top: -6px; }
.mobile-toggle-icon::after { bottom: -6px; }

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "footer";
    }
    .sidebar {
        display: block; /* Always visible for animation */
        position: fixed;
        top: 0;
        right: 0; /* Position at right edge */
        left: auto; /* Override any left positioning */
        width: 250px;
        height: 100vh;
        height: 100dvh;
        z-index: 1001; /* Higher than header and footer */
        box-shadow: -2px 0 10px rgba(0,0,0,0.1); /* Shadow on the left side */
        transform: translateX(100%); /* Start off-screen to the right */
        transition: transform 0.3s ease-in-out; /* Smooth slide animation */
        /* Maintain existing sidebar styling */
        flex-direction: column;
        padding: 20px;
        background-color: #ffffff;
        overflow-y: auto;
    }
    .sidebar.active {
        transform: translateX(0); /* Slide in from the right */
    }
    .sidebar-close {
        display: flex;
    }
    .mobile-toggle {
        display: block;
        margin-bottom: 0.25rem; /* Reduced by 75% from 1rem */
    }
    .header {
        padding: 0.5rem 1rem; /* Reduced by 75% from 0.75rem */
    }
    .footer {
        padding: 0.1875rem; /* Reduced by 75% from 0.75rem */
    }
    .main {
        /*padding: 0.1875rem; !* Reduced by 75% from 0.75rem *!*/
    }
    .search-container {
        display: none;
        width: 100%;
    }
    .login-btn {
        display: none;
    }
    .search-mobile {
        /*display: block;*/
        display: none;
    }
    .mobile-buttons {
        display: flex;
        gap: 1rem;
    }

    .course-card {
        height: auto;
        min-height: 10.4375rem;
        display: grid;
        grid-template-columns: 4.31594rem 1fr;
        grid-template-rows: auto auto auto;
        gap: 0.75rem;
        grid-template-areas:
            "image header"
            "description description"
            "actions actions";
    }

    .course-image-stack {
        width: 3.80594rem;
        height: 6rem;
        grid-area: image;
        align-self: start;
    }

    .course-content {
        display: contents; /* Let children participate in parent grid */
    }

    /* Header row with title and concepts stacked */
    .course-header-row {
        grid-area: header;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        align-self: start;
    }

    .course-card-title {
        margin: 0;
        font-size: 1rem;
        line-height: 1.2;
    }

    .concepts-box {
        align-self: flex-start;
    }

    /* Description spans full width below */
    .course-card-description {
        grid-area: description;
        margin: 0;
        font-size: 0.875rem;
        line-height: 1.4;
    }

    /* Actions span full width at bottom */
    .course-actions {
        grid-area: actions;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
}

/* ===== FILTER BUTTONS ===== */
.filter-buttons-container {
    display: flex;
    justify-content: start;
    align-items: center;
    gap: 0.5rem;

    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* smooth on iOS */
    scrollbar-width: none;              /* Firefox */
    -ms-overflow-style: none;           /* IE/old Edge */
    width: 100%;
}

.filter-buttons-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Ensure buttons don't shrink; they should scroll horizontally */
.filter-buttons-container .filter-btn {
    flex: 0 0 auto;
}

.filter-btn {
    display: flex;
    padding: 0.3125rem 0.5rem 0.375rem 0.5rem;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: .75rem;
    border: none;
}

.filter-btn.border {
    border-radius: 0.5rem;
    border: 1px solid rgba(182, 182, 182, 0.30);
}

.filter-btn.underline {
    border-bottom: 1px solid rgba(0, 0, 0, 0.10);
    color: rgba(0, 0, 0, 0.60);
}

.filter-btn.vertical {
    flex-direction: column;
}

.filter-btn.horizontal {
    flex-direction: row;
}

.filter-btn:hover {
    background-color: #f9fafb;
    border-color: rgba(182, 182, 182, 0.50);
}

.filter-btn.border.active {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff;
}

.filter-btn.underline.active {
    border-bottom: 1px solid rgba(0, 0, 0);
    color: rgba(0, 0, 0);
}

.filter-btn.underline.active {
    /*background-color: #000000;*/
    /*border-color: #000000;*/
    color: #000000;
}

.filter-btn-icon {
    display: flex;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 1.25rem;
    justify-content: center;
    align-items: center;
}

.filter-btn.border.active img.filter-btn-icon {
    filter: invert(1);
}

.filter-btn-text {
    color: #000;
    text-align: center;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%; /* 1.3125rem */
}

.filter-btn.border.active .filter-btn-text {
    color: #ffffff;
}

/* ===== VIDEO GRID STYLES ===== */
.video-grid-container {
    width: 100%;
    height: auto;
    margin: 0 auto;
    position: relative;
}

.swiper {
    width: 100%;
    height: 100%;
}

/* Grid layout for videos when Swiper is not initialized or not working properly */
.video-grid-fallback {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
    gap: 0.75rem 0.5rem;
    margin-bottom: 20px;
}

.swiper-slide {
    text-align: center;
    /*background: #f8f9fa;*/
    /*border-radius: 8px;*/
    background: #fff;
    overflow: hidden;
    height: auto;
    display: flex;
    flex-direction: column;
}

.video-card {
    display: flex;
    /*width: 11.25rem;*/
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    /*box-shadow: 0 2px 5px rgba(0,0,0,0.1);*/
    transition: transform 0.3s ease;
    background: white;
    aspect-ratio: 186/330;
}

.video-card:hover {
    transform: translateY(-2px);
}

.video-thumbnail {
    align-items: center;
    position: relative;
    overflow: hidden;
    background-color: #000;
    border-radius: 0.5rem;
    width: 100%;
    height: 100%;
}

.video-thumbnail .thumbnail-img {
    /*position: absolute;*/
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    display: block;
}

.video-thumbnail video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10; /* Further increased z-index to ensure video appears above other elements */
    pointer-events: none; /* Allow clicks to pass through to elements below */
}

.video-thumbnail .hover-video.playing {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    z-index: 20 !important;
}

/* Hide thumbnail when video is playing */
.video-thumbnail:has(.hover-video.playing) .thumbnail-img {
    opacity: 0 !important;
}

/* Home grid: prevent thumbnail image showing behind letterboxed video */
.video-thumbnail video {
    background-color: #000; /* ensure letterbox area is black, not transparent */
}

/* Hide the thumbnail image once the hover-video has a source (loaded) */
.video-thumbnail:has(.hover-video[src]) .thumbnail-img {
    opacity: 0;
}

.video-info {
    /*padding: 0.75rem;*/
    /*text-align: left;*/
    /*flex-grow: 1;*/
    /*display: flex;*/
    /*flex-direction: column;*/
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    align-self: stretch;
    padding: 0;
}

.video-title {
    display: flex;
    width: 11.25rem;
    max-height: 3rem;
    justify-content: center;
    align-items: center;
    gap: 0.625rem;
    font-weight: 600;
    margin-bottom: 0;
    font-size: 1rem;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #000;
}

.video-author {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.video-stats {
    /*display: flex;*/
    /*justify-content: space-between;*/
    /*font-size: 0.75rem;*/
    /*color: #888;*/
    /*margin-top: auto;*/
    color: #000;
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    opacity: 0.6;
    display: flex;
    justify-content: flex-start;
    margin-top: 0;
}

.video-stats span {
    margin-right: 0.5rem;
}

.video-duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-size: 0.7rem;
}

/* Infinite scroll trigger styles */
.infinite-scroll-trigger {
    /* Outside grid - just needs to be invisible */
    height: 1px;
    width: 100%;
    opacity: 0;
}

/* Loading spinner styles */
.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #0d6efd;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .swiper-slide {
        width: 100%;
    }
}

/* ===== COURSES PAGE STYLES ===== */

/* Course Header Section */
.course-header {
    display: flex;
    /*width: 72rem;*/
    padding: 1rem;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background: var(--primary-color-light);
    margin-bottom: 1rem;
}

.course-info {
    flex: 1;
}

.course-title {
    color: #000;
    font-size: 1.25rem;
    font-style: normal;
    font-weight: 600;
    line-height: 120%;
    margin: 0 0 0.5rem 0;
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
}

.course-title img {
    opacity: 0.6;
}

.course-description {
    color: #000;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    margin: 0;
    width: 42.5rem;
}

.progress-chart {
    width: 7.25rem;
    height: 7.25rem;
    flex-shrink: 0;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-pie {
    width: 100%;
    height: 100%;
}

.progress-text {
    font-size: 1.6rem;
    font-weight: 600;
    fill: #22c55e;
    color: #000;
}

/* Course Grid */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34rem, 1fr));
    gap: 1rem;
    /*max-width: 72rem;*/
}

.course-card {
    display: flex;
    /*width: 35.5rem;*/
    height: 10.4375rem;
    padding: 0.75rem;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: #FFF;
}

.course-image-stack {
    position: relative;
    width: 4.75744rem;
    height: 7.5rem;
    flex-shrink: 0;
    margin-right: 0.51rem; /* Compensate for rightward layer offset */
}

.image-layer {
    position: absolute;
    border-radius: 0.14275rem;
}

.image-layer.layer-1 {
    width: 4.24775rem;
    height: 5.5rem;
    background: #F2F2F2;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    z-index: 1;
}

.image-layer.layer-2 {
    width: 4.24775rem;
    height: 6.16669rem;
    background: #E4E4E4;
    top: 50%;
    transform: translateY(-50%);
    left: 0.17rem;
    z-index: 2;
}

.image-layer.layer-3 {
    width: 4.24775rem;
    height: 6.83331rem;
    background: #CECECE;
    top: 50%;
    transform: translateY(-50%);
    left: 0.34rem;
    z-index: 3;
}

.image-layer.layer-4 {
    width: 4.75744rem;
    height: 7.5rem;
    border-radius: 0.25rem;
    overflow: hidden;
    top: 50%;
    transform: translateY(-50%);
    left: 0.51rem;
    z-index: 4;
}

.image-layer.layer-4 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Course header row with title and concepts count */
.course-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    /*margin-bottom: 0.25rem;*/
}

.course-card-title {
    color: #000;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 150%;
    margin: 0;
    font-style: normal;
    flex: 1;
}

.concepts-count {
    color: #000000;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 150%;
    white-space: nowrap;
    flex-shrink: 0;
}

.concepts-count.bold {
    font-weight: 700;
}

.course-card-description {
    color: #666;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 140%;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
}

.btn-watch-all {
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    min-width: 7.5rem;
    height: 36px;
    padding: 0.4375rem 1rem 0.5rem 1rem;
    justify-content: center;
    align-items: center;
    gap: 0.625rem;
    border-radius: 0.5rem;
    background: var(--primary-color-light);
}

.btn-play-remaining {
    background: var(--primary-color);
    color: var(--primary-color-light);
    border: none;
    border-radius: 0.5rem;
    padding: 0.4375rem 1rem 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    gap: 0.625rem;

    display: flex;
    justify-content: center;
    align-items: center;
    height: 36px;
}

.btn-play-remaining:hover {
    background: #9d7c56;
}

.course-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.progress-label {
    color: #666;
    font-size: 0.75rem;
    font-weight: 400;
}

.progress-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
    border: 2px solid #e5e5e5;
    color: #666;
}

.progress-circle.complete {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

.progress-circle.partial {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

/* Home-only: cap video tile height on very small screens */
@media (max-width: 412px) {
    /* Keep at least 2 tiles per row */
    .video-grid-fallback {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Allow content to shrink within grid cells */
    .video-card { min-width: 0; }
    .video-info, .video-title { min-width: 0; }
    .video-title { width: 100%; }

    .banner-actions {
        flex-direction: column;
    }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .course-header {
        width: 100%;
        margin-bottom: 0.75rem;
        /*max-width: 72rem;*/
    }

    .course-grid {
        max-width: 100%;
    }

    .course-card {
        width: 100%;
        /*max-width: 35.5rem;*/
    }
}

@media (max-width: 768px) {
    .course-header {
        flex-direction: column;
        align-items: flex-start; /* Align to left instead of center */
        text-align: left; /* Align text to left instead of center */
        gap: 1rem; /* Reduced gap */
    }

    .course-description {
        width: unset;
    }

    .progress-chart {
        order: -1; /* Move progress chart to top */
        align-items: start;
        justify-content: start;
        width: 4rem;
        height: 4rem;
    }

    .progress-text {
        font-size: 1.6rem;
        font-style: normal;
        font-weight: 400;
        line-height: 150%;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    .course-card {
        height: auto;
        min-height: 10.4375rem;
        display: grid;
        grid-template-columns: 4.31594rem 1fr;
        grid-template-rows: auto auto auto;
        gap: 0.75rem;
        grid-template-areas:
            "image header"
            "description description"
            "actions actions";
    }

    .course-image-stack {
        width: 3.80594rem;
        height: 6rem;
        grid-area: image;
        align-self: start;
    }

    .course-content {
        display: contents; /* Let children participate in parent grid */
    }

    /* Header row with title and concepts stacked */
    .course-header-row {
        grid-area: header;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        align-self: center;
    }

    .course-card-title {
        margin: 0;
        font-size: 1rem;
        line-height: 1.2;
    }

    .concepts-box {
        align-self: flex-start;
    }

    /* Description spans full width below */
    .course-card-description {
        grid-area: description;
        margin: 0;
        font-size: 0.875rem;
        line-height: 1.4;
    }

    /* Actions span full width at bottom */
    .course-actions {
        grid-area: actions;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }

    /* Mobile Layer Styles */
    .image-layer.layer-1 {
        width: 3.39819rem;
        height: 4.4rem;
    }

    .image-layer.layer-2 {
        width: 3.39819rem;
        height: 4.93331rem;
    }

    .image-layer.layer-3 {
        width: 3.39819rem;
        height: 5.46669rem;
    }

    .image-layer.layer-4 {
        width: 3.80594rem;
        height: 6rem;
    }
}

/* ===== TRACKS PAGE STYLES ===== */

/* Tracks Header */
.tracks-header {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 100;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border-radius: 5.625rem;
    border: 1.5px solid rgba(0, 0, 0, 0.10);
    background: #FFF;
}

/* Tracks Container */
.tracks-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    overflow: hidden;
    background: #FFF;
}

.tracks-swiper {
    width: 100%;
    height: 100%;
}

.track-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.track-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
}

/* Video Track Styles */
.video-track .video-container {
    position: relative;
    width: 50vh;
    width: 50dvh;
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-track video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Desktop landscape layout: actions below the video */
@media (min-width: 769px) {
    .track-content.video-track.landscape {
        flex-direction: column;
        align-items: start;
        gap: 0.5rem;
    }

    .track-content.video-track.landscape .video-container {
        width: 89%;
        height: auto;              /* let aspect-ratio define height */
        max-height: calc(100vh - 88px);
        margin-left: 3rem;
    }

    .track-content.video-track.landscape video {
        object-fit: contain;       /* show full video in landscape */
        background: #000;
    }

    .track-content.video-track.landscape .track-actions {
        position: relative;
        width: 70vw;          /* match the video width */
        margin: 0 auto;       /* center the row under the video */
        display: flex;
        flex-direction: row;  /* row layout */
        justify-content: flex-end; /* align to end of video */
        gap: 0.75rem;
        /*margin-top: 0.5rem;*/
    }
}

@media (min-width: 769px) {
    /* When inline panel is open, keep column layout, reserve right space for panel */
    .track-content.video-track.landscape.has-progress-open {
        position: relative;
        /* panel width (55dvh) + 0.5rem gap */
        padding-right: calc(55dvh + 0.5rem);
    }
    @supports not (height: 1dvh) {
        .track-content.video-track.landscape.has-progress-open {
            padding-right: calc(55vh + 0.5rem);
        }
    }

    /* Shrink video width so actions remain below it and don't fall under the panel */
    .track-content.video-track.landscape.has-progress-open .video-container {
        width: 72vw; /* keep your landscape width baseline */
        max-width: calc(100% - 3rem - 5rem);
        height: calc(100vh - 88px);
        height: calc(100dvh - 88px);
        max-height: none;
    }
    @supports not (height: 1dvh) {
        .track-content.video-track.landscape.has-progress-open .video-container {
            max-width: calc(100% - 55vh - 3rem - 5rem);
        }
    }

    /* Place panel on the right, under tracks-navigation (z-index: 100) */
    .track-content.video-track.landscape.has-progress-open .track-progress-panel {
        position: absolute;
        top: 0;
        right: auto;
        z-index: 90;
        height: auto; /* let JS set exact height */
    }
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 2rem 1rem 0.75rem;
    color: white;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.author-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
}

.follow-btn {
    background: transparent;
    border: 1px solid white;
}

/* ===== LENOVO BANNER STYLES ===== */
.lenovo-banner {
    background: var(--primary-color);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(225, 37, 27, 0.15);
}

.banner-content {
    /* display: flex;
    align-items: center; */
    justify-content: space-between;
    padding: 1rem;
    gap: 2rem;
}

.banner-text {
    flex: 1;
    color: white;
    padding-bottom: 1rem;
}

.banner-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.5rem 0;
    color: white;
}

.banner-description {
    width: 42.5rem;
    font-size: 00.875rem;
    line-height: 1.5;
    margin: 0;
    opacity: 0.8;
    color: white;
}

.banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.banner-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.banner-btn.primary {
    background-color: white;
    color: var(--primary-color);
}
.banner-btn.primary a {
    background-color: white;
    color: var(--primary-color);
}

.banner-btn.primary:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.banner-btn.secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}
.banner-btn.secondary a {
    background-color: transparent;
    color: white;
}

.banner-btn.secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Responsive banner styles */
@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem 1.5rem;
        gap: 1.25rem;
    }
    
    .banner-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .banner-description {
        font-size: 0.875rem;
        width: 100%;
    }
    
    .banner-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .banner-btn {
        /*flex: 1;*/
        min-width: auto;
    }
}

.follow-btn:hover {
    background: white;
    color: black;
}

.video-description {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    text-align: left;
}

.video-description p {
    text-align: left;
}

.download-app {
    width: 100%;
}

.download-app-btn {
    display: flex;
    height: 2.25rem;
    width: 100%;
    padding: 0.375rem 0.5rem;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    border: none;
    background: #B49164;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-app-btn img {
    height: 24px;
    width: 24px;
}

/* Feed (landscape): make the download CTA hug its content */
.feed-content.video-feed.landscape .download-app {
    display: inline-block;        /* shrink wrapper to content */
    width: auto;                  /* override 100% */
    max-width: 100%;              /* safety */
}

.feed-content.video-feed.landscape .download-app-btn {
    display: inline-flex;         /* size to content; keep icon+text aligned */
    width: auto;                  /* override 100% */
    white-space: nowrap;          /* keep on one line */
    padding: 0.375rem 2rem;
}

.feed-content.video-feed.landscape .download-app-btn img {
    flex: 0 0 auto;               /* don’t shrink the icon */
}

/* Track (landscape): make the download CTA hug its content */
.track-content.video-track.landscape .download-app {
    display: inline-block;   /* shrink wrapper to content */
    width: auto;             /* override 100% */
    max-width: 100%;         /* safety */
}

.track-content.video-track.landscape .download-app-btn {
    display: inline-flex;    /* size to content; keep icon+text aligned */
    width: auto;             /* override 100% */
    white-space: nowrap;     /* keep on one line */
    padding: 0.375rem 2rem;  /* match the feed landscape padding you added */
}

.track-content.video-track.landscape .download-app-btn img {
    flex: 0 0 auto;          /* don’t shrink the icon */
}

/* Questionnaire Track Styles */
.questionnaire-track .questionnaire-container {
    position: relative;
    width: 50vh;
    width: 50dvh;
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    background: linear-gradient(180deg, #3D3D3D 0%, #000 100%);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    color: white;
    overflow: hidden;
}

.questionnaire-header {
    margin-bottom: 2rem;
}

.progress-indicator {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/*.progress-text {*/
/*    font-size: 0.75rem;*/
/*    opacity: 0.8;*/
/*}*/

.questionnaire-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.question-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 2rem 0;
    text-align: start;
    color: #FFF;
    font-style: normal;
    line-height: 120%; /* 1.5rem */
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-btn {
    background: rgba(255, 255, 255, 0.10);
    color: #FFF;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    align-self: stretch;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.10);
    font-style: normal;
    font-weight: 600;
    line-height: 150%; /* 1.5rem */
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.option-btn.selected {
    background: rgba(255, 255, 255, 0.9);
    color: #B49164;
    border-color: white;
}

.option-btn.correct {
    display: flex;
    padding: 0.75rem;
    align-items: center;
    gap: 0.5rem;
    align-self: stretch;
    border-radius: 0.5rem;
    border-bottom: 2px solid #FFF;
    background: #05B502;
    box-shadow: 0 4px 24px 0 rgba(5, 181, 2, 0.65);
    color: white;
    justify-content: space-between;
}

.option-btn.wrong {
    display: flex;
    padding: 0.75rem;
    align-items: center;
    gap: 0.5rem;
    align-self: stretch;
    border-radius: 0.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.7);
    justify-content: space-between;
}

.option-btn.correct .answer-icon,
.option-btn.wrong .answer-icon {
    flex-shrink: 0;
    margin-left: auto;
}

.option-btn.answered {
    pointer-events: none;
    cursor: default;
}

/* Track Actions (Right Side) */
.track-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 10;
    flex-shrink: 0;
    width: 3rem;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding-bottom: 0.2rem;
}

.action-btn {
    background: rgba(0, 0, 0, 0.10);
    border: none;
    border-radius: 0.75rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: scale(1.1);
}

.action-count {
    text-align: center;
    color: #000;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%; /* 1.3125rem */
}

/* Navigation Controls */
.tracks-navigation {
    position: absolute;
    right: 1rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 5.6rem;
    z-index: 100;
}

.nav-btn {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 5.625rem;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    background: #FFFFFF;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn:disabled:hover {
    transform: none;
    background: rgba(0, 0, 0, 0.5);
}

/* Inline Progress panel */
.track-progress-panel {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    /*box-shadow: 0 8px 24px rgba(0,0,0,0.12);*/

    width: 55vh;
    width: 55dvh;
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    border: 1px solid rgba(0, 0, 0, 0.10);
}

/* Hide the panel until the body has content */
.track-progress-panel:not(:has(.track-progress-body > *)) {
    display: none;
}

.track-progress-panel .track-progress-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Hide by default, but show when 'open' */
.track-progress-panel { display: none; }
.track-progress-panel.open { display: flex !important; }

/* Header */
.track-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,.1);
    font-weight: 600;
}

.track-progress-close {
    border: none;
    background: transparent;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

/* Body scroll region */
.track-progress-body {
    padding: .5rem 1rem 1rem;
    overflow: auto;
    max-height: 100%;
}

.track-progress-panel .concept-text {
    text-align: left;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Tracks mobile styles - following feeds pattern */
    .tracks-container {
        height: 100vh;
        height: 100dvh;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
    }

    /* Full-screen video and questionnaire on mobile */
    .video-track .video-container,
    .questionnaire-track .questionnaire-container {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        max-width: none;
        max-height: none;
    }

    .video-track video {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }

    /* Show full landscape video on mobile (letterboxed if needed) */
    .track-content.video-track.landscape video {
        object-fit: contain;
        /*object-position: center center;*/
    }

    .track-content.video-track:not(.landscape).has-progress-open {
        padding-right: 0; /* no reserved right space */
    }
    .track-content.video-track:not(.landscape).has-progress-open .track-progress-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        transform: none;
        z-index: 2000;

        width: 100vw;
        max-width: 100vw;
        height: auto;
        max-height: 85vh;  /* scroll if tall */
        overflow: auto;

        /* same corner treatment as mobile */
        border-radius: 12px 12px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Use modal on mobile; no right-side reservation */
    .track-content.video-track.landscape.has-progress-open {
        padding-right: 0;
    }

    /* Center the progress panel as a modal over the video */
    .track-content.video-track.landscape.has-progress-open .track-progress-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        transform: none;
        z-index: 2000;

        width: 100vw;
        max-width: 100vw;
        height: auto;
        max-height: 85vh;         /* scroll if tall */
        overflow: auto;

        /* Corner treatment: keep top corners, remove bottom corners */
        border-radius: 12px 12px 0 0;

        /* Optional: avoid iOS home-indicator overlap */
        padding-bottom: env(safe-area-inset-bottom);
    }

    .track-progress-panel .track-progress-body {
        max-height: 34vh;
    }

    /* Hide desktop navigation */
    .tracks-navigation {
        display: none;
    }

    /* Reposition track-actions to bottom-right with 1rem padding */
    .track-actions {
        position: absolute;
        bottom: 1rem;
        right: 1rem;
        z-index: 30;
        background: none;
        gap: 1rem;
    }

    /* Adjust video-overlay width to accommodate track-actions */
    .video-overlay {
        padding-right: 5rem; /* Make space for track-actions */
    }

    /* Ensure track-content takes full space */
    .track-content {
        gap: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }

    /* Fix mobile Swiper slide positioning */
    .tracks-swiper {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .track-slide {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        position: relative;
        overflow: hidden;
    }

    .tracks-swiper .swiper-slide {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        transform: translateZ(0); /* Force hardware acceleration */
        position: relative;      /* ← NEW: Proper positioning */
        flex-shrink: 0;         /* ← NEW: Prevent shrinking */
    }

    /* Ensure proper slide stacking and prevent overlap */
    .tracks-swiper .swiper-wrapper {
        height: 100vh;
        height: 100dvh;
        transform: translateZ(0); /* Force hardware acceleration */
        display: flex;           /* ← NEW: Flex layout */
        flex-direction: column;  /* ← NEW: Vertical stacking */
    }

    /* Action buttons styling for mobile */
    .track-actions .action-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    .track-actions .action-btn {
        width: 3rem;
        height: 3rem;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(4px);
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .track-actions .action-btn:hover {
        background: rgba(255, 255, 255, 0.5);
        transform: scale(1.05);
    }

    .track-actions .action-btn svg {
        width: 1.5rem;
        height: 1.5rem;
    }

    .track-actions .action-count {
        color: white;
        font-size: 0.75rem;
        font-weight: 500;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }

    /* Mobile Mute Toggle Styling for Tracks */
    .mobile-mute-toggle {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 25;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: none;
    }

    .mobile-mute-toggle.show {
        opacity: 1;
        visibility: visible;
    }

    .mute-icon-container {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 4rem;
        height: 4rem;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
        border-radius: 50%;
        transition: all 0.3s ease;
    }

    .mute-icon-container svg {
        width: 2rem;
        height: 2rem;
    }
}

/* Desktop styles remain unchanged for tracks */
@media (min-width: 769px) {
    .tracks-container {
        height: calc(100vh - 88px);
        height: calc(100dvh - 88px);
        position: relative;
    }

    .track-actions {
        position: relative;
        bottom: auto;
        right: auto;
    }

    .video-overlay {
        padding-right: 1rem;
    }
}

/* Feeds Container (similar to tracks but for feed page) */
.feeds-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    overflow: hidden;
    background: #000;
}

.feeds-swiper {
    width: 100%;
    height: 100%;
}

.feed-slide {
    text-align: center;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.feed-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
}

/* Video Feed Styles */
.video-feed .video-container {
    position: relative;
    width: 50vh;
    width: 50dvh;
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-feed video,
.video-feed .video-container img.video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Optional: overlay shown when autoplay is blocked */
.tap-to-play-overlay {
    position: absolute;
    inset: 0;
    display: none;            /* toggle via .show */
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,0.35) 40%, rgba(0,0,0,0.6) 100%);
    z-index: 25;
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.tap-to-play-overlay.show { display: flex; }

/* Desktop landscape layout for feeds: actions below video aligned to right edge */
@media (min-width: 769px) {
    .feed-content.video-feed.landscape {
        display: flex;            /* ensure layout control on parent */
        flex-direction: column;   /* stack video then actions row */
        align-items: flex-start;
        gap: 0.5rem;
    }

    .feed-content.video-feed.landscape .video-container {
        width: 75vw;
        height: auto;                     /* follow aspect-ratio */
        max-height: calc(100vh - 145px);
    }

    .feed-content.video-feed.landscape video {
        object-fit: contain;              /* show full frame */
        background: #000;
    }

    .feed-content.video-feed.landscape .feed-actions {
        position: relative;
        width: 70vw;                      /* match video width */
        margin: 0 auto;
        display: flex;
        flex-direction: row;              /* horizontal row */
        justify-content: flex-end;        /* align to video right edge */
        gap: 0.75rem;
    }

    .feed-content.video-feed.landscape .action-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
    }
}

/* Feed Actions (Right Side) */
.feed-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

/* Feeds Navigation */
.feeds-navigation {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 30;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-btn:hover {
    background: white;
    transform: scale(1.05);
}

.nav-btn:active {
    transform: scale(0.95);
}

/* Video Controls */
.video-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 20;
    width: calc(100% - 2rem);
    justify-content: space-between;
}

.video-control-btn {
    display: inline-flex;
    padding: 0.5rem;
    gap: 0.625rem;
    border-radius: 1.5625rem;
    background: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(4.5px);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 2.5rem;
    min-height: 2.5rem;
    justify-content: center;
    align-items: center;
}

.video-control-btn:hover {
    background: rgba(0, 0, 0, 0.50);
    transform: scale(1.05);
}

.video-control-btn:active {
    transform: scale(0.95);
}

/* Responsive Control Visibility */
.mobile-only {
    display: none;
}

.desktop-only {
    display: inline-flex;
}

.mobile-hidden {
    display: none !important;
}

/* Icon visibility states */
.video-control-btn .play-icon,
.video-control-btn .pause-icon,
.video-control-btn .mute-icon,
.video-control-btn .unmute-icon {
    transition: opacity 0.2s ease;
}

/* Fix click event bubbling - SVG icons should pass clicks through to button */
.video-control-btn svg {
    pointer-events: none;
}

/* Video Overlay and Description */
.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 2rem 1rem 0.75rem;
    z-index: 10;
}

.video-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-description {
    color: white;
    text-align: left;
}

.video-description p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    font-weight: 400;
}

.download-app {
    margin-bottom: 0.5rem;
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
    /* Hide header on mobile for full-screen experience */
    .main-header {
        display: none !important;
    }

    /* Full-screen container on mobile */
    .feeds-container {
        height: 100vh;
        height: 100dvh;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
    }

    /* Full-screen video on mobile */
    .video-feed .video-container {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }

    .video-feed video,
    .video-feed img.video {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }

    /* Show full landscape video on mobile (letterboxed if needed) */
    .feed-content.video-feed.landscape video {
        object-fit: contain;
        /*object-position: center center;*/
    }

    /* Hide desktop navigation */
    .feeds-navigation {
        display: none;
    }

    /* Mobile Control Visibility */
    .mobile-only {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }

    /* Reposition feed-actions to bottom-right with 1rem padding */
    .feed-actions {
        position: absolute;
        bottom: 1rem;
        right: 1rem;
        z-index: 30;
        background: none;
        gap: 1rem;
    }

    /* Adjust video-description width to accommodate feed-actions */
    .video-overlay {
        padding-right: 5rem; /* Make space for feed-actions */
    }

    .video-description {
        /*max-width: calc(100% - 4rem);*/
    }

    /* Ensure feed-content takes full space */
    .feed-content {
        gap: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }

    /* Fix mobile Swiper slide positioning to prevent overlap */
    .feeds-swiper {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .feed-slide {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        position: relative;
        overflow: hidden;
    }

    .feeds-swiper .swiper-slide {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        transform: translateZ(0); /* Force hardware acceleration */
    }

    /* Ensure proper slide stacking and prevent overlap */
    .feeds-swiper .swiper-wrapper {
        height: 100vh;
        height: 100dvh;
        transform: translateZ(0); /* Force hardware acceleration */
    }

    /* Action buttons styling for mobile */
    .action-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    .action-btn {
        width: 3rem;
        height: 3rem;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(4px);
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .action-btn:hover {
        background: rgba(255, 255, 255, 0.5);
        transform: scale(1.05);
    }

    .action-btn svg {
        width: 1.5rem;
        height: 1.5rem;
    }

    .action-count {
        color: white;
        font-size: 0.75rem;
        font-weight: 500;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }

    /* Video controls positioning on mobile */
    .video-controls {
        top: 1rem;
        left: 1rem;
        right: 1rem;
        justify-content: space-between;
    }

    .back-btn {
        /* Position on left */
        margin-right: auto;
    }

    .search-btn {
        /* Position on right */
        margin-left: auto;
    }
}

/* Desktop styles remain unchanged */
@media (min-width: 769px) {
    .main-header {
        display: flex !important;
    }

    .feeds-container {
        height: calc(100vh - 88px);
        height: calc(100dvh - 88px);
        position: relative;
    }

    .feed-actions {
        position: relative;
        bottom: auto;
        right: auto;
    }

    .video-overlay {
        padding-right: 1rem;
    }
}

/* ===== COMPLETION SLIDE STYLES ===== */

/* Completion Track Styles */
.completion-track .completion-container {
    position: relative;
    width: 50vh;
    width: 50dvh;
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    background: linear-gradient(180deg, #3D3D3D 0%, #000 100%);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    overflow: hidden;
    text-align: center;
}

.completion-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.completion-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.completion-tags .tag {
    background: rgba(255, 255, 255, 0.20);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.30);
}

.completion-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.completion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
}

.completion-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 120%;
}

.completion-subtitle {
    font-size: 1.25rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 150%;
}

.completion-subtitle strong {
    font-weight: 600;
    color: white;
}

.completion-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 280px;
}

.completion-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    min-height: 48px;
}

.completion-btn.primary-btn {
    background: white;
    color: #B49164;
    border: 1px solid white;
}

.completion-btn.primary-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.completion-btn.secondary-btn {
    background: rgba(255, 255, 255, 0.10);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.30);
}

.completion-btn.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.20);
    border-color: rgba(255, 255, 255, 0.50);
    transform: translateY(-1px);
}

/* Responsive Design for Completion Slide */
@media (max-width: 768px) {
    .completion-track .completion-container {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        padding: 2rem 1.5rem;
    }

    .completion-title {
        font-size: 1.25rem;
    }

    .completion-subtitle {
        font-size: 0.875rem;
    }

    .completion-actions {
        max-width: 100%;
    }
}

/* ===== CONCEPTS MODAL STYLES ===== */

/* Modal overlay */
.concepts-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.concepts-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal container */
.concepts-modal {
    display: flex;
    padding-bottom: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    border-radius: 0.75rem;
    background: #FFF;
    max-width: 32rem;
    width: 90%;
    max-height: 80vh;
    max-height: 80dvh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.concepts-modal-overlay.active .concepts-modal {
    transform: scale(1);
}

/* Modal header */
.concepts-modal-header {
    display: flex;
    padding: 1rem 1.5rem;
    align-items: center;
    gap: 1rem;
    align-self: stretch;
    border-bottom: 1px solid rgba(0, 0, 0, 0.10);
    background: #FFF;
    justify-content: space-between;
}

.concepts-modal-title {
    color: #000;
    font-size: 1rem;
    font-style: normal;
    font-weight: 600;
    line-height: 150%;
    margin: 0;
}

.concepts-modal-close {
    display: flex;
    width: 1.5rem;
    height: 1.5rem;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    transition: opacity 0.2s ease;
}

.concepts-modal-close:hover {
    opacity: 0.7;
}

.concepts-modal-close svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Modal body */
.concepts-modal-body {
    display: flex;
    padding: 0 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    align-self: stretch;
    overflow-y: auto;
    max-height: 60vh;
    max-height: 60dvh;
}

/* Concept row */
.concept-row {
    display: flex;
    padding: 0.25rem 0;
    align-items: center;
    gap: 0.625rem;
    align-self: stretch;
    border-radius: 0.5rem;
}

.concept-tick-icon {
    display: flex;
    width: 1.5rem;
    height: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.concept-tick {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.concept-text {
    color: #000;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    flex: 1;
}

/* Make concepts-box clickable */
.concepts-box {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.concepts-box:hover {
    opacity: 0.8;
}

/* ===== PROGRESS PIE COMPONENT ===== */
.progress-pie {
    transform: rotate(0deg); /* Reset any rotation, we handle it in SVG */
}

.progress-pie circle {
    transition: stroke-dasharray 0.3s ease; /* Smooth progress animation */
}

.progress-text {
    font-size: 1.6rem;
    font-weight: 600;
    fill: #000;
    dominant-baseline: middle; /* Better vertical centering */
}

/* Video controls positioning on mobile */
.video-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 20;
}

/* Mobile Mute Toggle (Center Screen) */
.mobile-mute-toggle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.mobile-mute-toggle.show {
    opacity: 1;
    visibility: visible;
}

.mute-icon-container {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(4.5px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mute-icon-container svg {
    width: 24px;
    height: 24px;
    pointer-events: none;
}

/*.like-btn {*/
/*    !*background: transparent;*!*/
/*    border: none;*/
/*    cursor: pointer;*/
/*    padding: 0;*/
/*    display: flex;*/
/*    align-items: center;*/
/*    justify-content: center;*/
/*}*/

.like-btn svg path {
    transition: fill 0.3s ease, stroke 0.3s ease;
}

.like-btn.liked svg path {
    fill: #E1251B;
    stroke: #E1251B;
}

/*.share-btn {*/
/*    background: transparent;*/
/*    border: none;*/
/*    cursor: pointer;*/
/*    padding: 0;*/
/*    display: flex;*/
/*    align-items: center;*/
/*    justify-content: center;*/
/*}*/

/* Share Modal (prefixed classes) */
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease
}

.share-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5)
}

.share-sheet {
    position: relative;
    background: #fff;
    color: #0F172A;
    transform: scale(.98);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
    overflow: hidden;
    outline: none;
    width: 31.1875rem;
    border-radius: 0.75rem;
    box-shadow: 0 12px 36px 0 rgba(0, 0, 0, 0.05);
}

.share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    gap: 1rem;
    align-self: stretch;
    border-bottom: 1px solid rgba(0, 0, 0, 0.10);
    background: #FFF;
}

.share-title {
    color: #000;
    text-align: center;
    font-size: 1rem;
    font-style: normal;
    font-weight: 600;
    line-height: 150%; /* 1.5rem */
}

.share-closeBtn {
    border: 0;
    background: transparent;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #6B7280
}

.share-closeBtn:hover {
    background: rgba(0, 0, 0, .06)
}

.share-closeBtn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px
}

.share-appsWrap {
    position: relative;
    padding: 10px 10px 2px
}

.share-appsRow {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    align-items: flex-start;
    gap: 0.75rem;
}

.share-appsRow::-webkit-scrollbar {
    display: none
}

.share-socialBtn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 86px;
    text-decoration: none;
    color: #0F172A
}

.share-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center
}

.share-label {
    font-size: 13px
}

.share-socialBtn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: 10px
}

.share-leftArrow, .share-rightArrow {
    position: absolute;
    top: calc(50% + 4px);
    transform: translateY(-50%);
    background: #fff;
    color: var(--primary-color);
    display: grid;
    place-items: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;

    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 2.90063rem;
    border: 1px solid rgba(182, 182, 182, 0.10);
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.05) 100%), rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.share-leftArrow {
    left: 6px
}

.share-rightArrow {
    right: 6px
}

.share-leftArrow.show, .share-rightArrow.show {
    opacity: 1;
    pointer-events: auto
}

@keyframes shareNudgeLeft {
    from {
        transform: translate(-2px, -50%)
    }
    to {
        transform: translate(0, -50%)
    }
}

@keyframes shareNudgeRight {
    from {
        transform: translate(2px, -50%)
    }
    to {
        transform: translate(0, -50%)
    }
}

.share-nudgeLeft {
    animation: shareNudgeLeft .15s ease
}

.share-nudgeRight {
    animation: shareNudgeRight .15s ease
}

.share-copyRow {
    display: grid;
    grid-template-columns:auto 1fr auto;
    align-items: center;
    gap: 12px;
    margin: 1rem;
    padding: 0.25rem 0.25rem 0.25rem 1rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    background: #F8FAFC
}

.share-linkIcon {
    color: #6B7280;
    display: grid;
    place-items: center
}

.share-urlText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0F172A;
    font-size: 14px
}

.share-copyBtn {
    border: 0;
    background: var(--primary-color);
    width: 5rem;
    height: 3rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    color: #FFF;
    text-align: center;
    font-size: 1rem;
    font-style: normal;
    font-weight: 600;
    line-height: 150%; /* 1.5rem */
}

.share-copyBtn:hover {
    filter: brightness(.95)
}

.share-copyBtn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px
}

/* Open state */
.share-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto
}

.share-open .share-sheet {
    opacity: 1;
    transform: scale(1)
}

/* Mobile bottom sheet */
@media (max-width: 768px) {
    .share-modal {
        align-items: end
    }

    .share-sheet {
        width: 100%;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        transform: translateY(100%)
    }

    .share-open .share-sheet {
        transform: translateY(0)
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .share-modal, .share-sheet, .share-leftArrow, .share-rightArrow {
        transition: none !important
    }

    .share-nudgeLeft, .share-nudgeRight {
        animation: none !important
    }
}

.more-menu {
    position: absolute;
    right: 0;
    bottom: 3.1rem;
    margin-bottom: 0.5rem;
    display: inline-flex;
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    border-radius: 0.75rem;
    background: #FFF;
    box-shadow: 0 12px 36px 0 rgba(0, 0, 0, 0.05);
    z-index: 1000;
    min-width: 17.5rem;
}

.more-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.25rem;
    width: 100%;
    transition: opacity 0.2s;
}

.more-menu-item:hover {
    opacity: 0.7;
}

.more-menu-item span {
    color: #000;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 150%;
}

.more-menu-divider {
    width: 17.5rem;
    height: 0.0625rem;
    opacity: 0.1;
    background: #000;
}

.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.2); /* 10% black */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999; /* Ensures it appears above everything */
  padding-left: 240px;
}

@media (max-width: 768px) {
    .spinner-overlay {
        padding-left: 0;
    }
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(173, 103, 103, 0.1); /* Light outer ring */
  border-top-color: var(--primary-color); /* Dark top segment (like a pie slice) */
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#global-loader {
    display: none;
}

#global-loader.htmx-request {
    display: flex;
}

/* Tablet: collapse sidebar text, keep icons only */
@media (min-width: 769px) and (max-width: 1270px) {
    /* Shrink grid’s sidebar column */
    .layout {
        grid-template-columns: 72px 1fr; /* icon rail + main */
    }

    /* Sidebar compaction */
    .sidebar {
        padding: 0.5rem;
    }
    .sidebar-brand .brand-name { display: none; }
    /*.section-title, .nav-divider { display: none; }*/
    /*.nav-divider { display: none; }*/
    .section-title { margin-left: 0}


    /* Hide all nav link labels; center icons */
    .nav-link {
        justify-content: center;
        padding: 0.5rem;
        gap: 0;
    }
    .nav-link span { display: none !important; }
    .nav-icon { margin-right: 0; }

    /* Optional: align user items if you render any in the sidebar */
    .user-link { justify-content: center; }
    .user-name { display: none; }

    /* Optional: keep global loader centered relative to the slimmer sidebar */
    .spinner-overlay { padding-left: 72px; }

    /* Closed panel */
    .track-content.video-track.landscape .video-container {
        width: 88%; /* 3rem = left margin */
        max-width: none; /* drop earlier max-width caps on tablet */
    }

    /* Panel open: parent already has padding-right for panel; do NOT subtract again */
    .track-content.video-track.landscape.has-progress-open .video-container {
        width: 88%;
        max-width: none;
        /* keep your tablet height rules as-is */
    }

    /* Do not reserve right-side space on tablet; we show a modal instead */
    .track-content.video-track.landscape.has-progress-open {
        padding-right: 0;
    }

    /* Center the progress panel as a modal */
    .track-content.video-track.landscape.has-progress-open .track-progress-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        right: auto;
        z-index: 200;             /* above .tracks-navigation (100) */
        width: min(90vw, 560px);  /* responsive modal width */
        max-width: 90vw;
        height: auto;
        max-height: min(80vh, 720px);
        overflow: auto;           /* scroll body if content longer */
    }
}

/* ===== Onboarding Modal ===== */
.ob-modal {
    position: fixed;
    inset: 0;
    z-index: 10005;
    display: grid;
    place-items: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.ob-modal.ob-open { visibility: visible; opacity: 1; pointer-events: auto; }

.ob-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }

.ob-sheet {
    position: relative;
    max-width: 54.5625rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #6AA7F4 0%, #6b72f6 100%);
    color: #FFF;
    box-shadow: 0 12px 36px rgba(0,0,0,.1);
    overflow: hidden;
}

.ob-body { padding: 1.5rem; }
.ob-swiper {
    width: 100%;
    overflow: hidden;
}

.ob-swiper .swiper-slide {
    background: transparent !important;
    background-color: transparent !important;
}

.ob-slide {
    display: flex;
    align-items: center;
    gap: 3rem; /* gap between image and text */
}

.ob-media { flex: 0 0 auto; }

.ob-image {
    width: 29.125rem;
    height: 22.75rem;
    flex-shrink: 0;
    border-radius: 1.01869rem;
    border: 1.358px solid #FFF;
    background: lightgray -5.413px -6.5px / 102.323% 103.571% no-repeat;
    background-size: cover;
    background-position: center;
}

.ob-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1 0 0;
}

.ob-title {
    color: #FFF;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 120%;
}

.ob-desc {
    color: #FFF;
    font-size: 1rem;
    font-weight: 400;
    line-height: 150%;
    opacity: .95;
}

/* Onboarding: force left-aligned text for title and description */
.ob-title,
.ob-desc {
    text-align: left;
    width: 100%;     /* ensures full line width for proper alignment */
}

/* Safety: keep text container left-aligned across breakpoints */
.ob-text { align-items: flex-start; }

/* Footer: Back | bullets | Next */
.ob-footer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem 1rem 1.5rem;
}

.ob-footer .ob-pagination {
    position: absolute;             /* keep centered regardless of button widths */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Allow buttons to be clickable even under pagination container */
.ob-footer .ob-pagination { pointer-events: none; }
.ob-footer .ob-pagination .swiper-pagination-bullet { pointer-events: auto; }

.ob-back {
    justify-self: start;
    display: flex;
    width: 4.9375rem;
    height: 2.5rem;
    padding: 0.5rem 0.75rem;
    justify-content: center;
    align-items: center;
    gap: 18.125rem; /* requested even if not used visually */
    border-radius: 0.5rem;
    border: 1.5px solid #FFF;
    background: transparent;
    color: #FFF;
}
.ob-back.is-disabled { opacity: .5; pointer-events: none; }

.ob-next {
    justify-self: end;
    display: flex;
    height: 2.5rem;
    padding: 0.5rem 1.5rem;
    justify-content: center;
    align-items: center;
    gap: 18.125rem; /* requested even if not used visually */
    border-radius: 0.5rem;
    background: #FFF;
    color: #0F172A;
    border: none;
}

.ob-pagination { justify-self: center; }
.ob-footer .swiper-pagination-bullet { background: rgba(255,255,255,.6); opacity: 1; }
.ob-footer .swiper-pagination-bullet-active { background: #FFF; width: 10px; height: 10px; }

/* Onboarding: disallow horizontal touch gestures; allow vertical scroll in text */
.ob-swiper { touch-action: pan-y !important; }

/* ===== Onboarding choices grid ===== */
.ob-choices {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;                 /* horizontal first; wraps when needed */
    gap: 0.5rem;                     /* requested gap */
    justify-content: flex-start;
    align-content: flex-start;
    align-items: stretch;
    max-height: 100%;
    overflow-y: auto;                /* vertical scroll if many tiles */
    padding-right: 0.25rem;
}

.ob-choice {
    position: relative;
    display: flex;                   /* requested styles */
    width: 8.125rem;
    height: 6.625rem;
    min-width: 6.875rem;
    padding: 0.75rem 1rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.20);
    background: linear-gradient(97deg, rgba(255, 255, 255, 0.00) 1.04%, rgba(255, 255, 255, 0.30) 98.96%);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    color: #FFF;
    cursor: pointer;
    user-select: none;
}

.ob-choice-img {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.ob-choice-title {
    font-size: 0.875rem;
    line-height: 1.2;
    text-align: center;
    display: none;
}

/* Selected state: green tick at top-right */
.ob-choice.is-selected::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
}

/* Make the choices area truly scrollable when inside a flex column */
.ob-text { min-height: 0; }

/* Use concepts tick inside onboarding choices */
.ob-choice { position: relative; } /* already set, keep it */

.ob-choice .concept-tick-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;          /* hidden until selected */
    z-index: 2;
}
.ob-choice.is-selected .concept-tick-icon { display: flex; }

/* Remove old pseudo-element tick, if still present */
.ob-choice.is-selected::after { content: none; }

/* Mobile: ensure grid fits width and tiles stretch nicely */
@media (max-width: 769px) {
    /*.ob-choices {*/
    /*    display: flex;*/
    /*    flex-wrap: wrap;*/
    /*    gap: 0.5rem;*/
    /*}*/
    /*.ob-choice {*/
    /*    width: 8.125rem;      !* keep fixed tile width *!*/
    /*    min-width: 6.875rem;*/
    /*    height: 5.125rem;*/
    /*}*/

    /* Make sure the text area and grid span full width */
    .ob-text { width: 100%; }

    .ob-choices {
        width: 100%;                                /* fill available width */
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        justify-items: stretch;                     /* stretch items to column width */
        align-items: stretch;
        flex: 1 1 auto;
        overflow-y: auto;
        margin-top: 0.5rem;
    }

    .ob-choice {
        width: auto;                                /* let grid control width */
        min-width: 0;                               /* allow shrinking within column */
        height: 5.125rem;                           /* as requested */
        box-sizing: border-box;                     /* include padding in width */
    }
}

/* Responsive */
@media (max-width: 1270px) {
    .ob-sheet { width: min(92vw, 56rem); }
    .ob-image { width: 24rem; height: 18rem; }
}
/*@media (max-width: 900px) {*/
/*    .ob-slide { flex-direction: column; gap: 1rem; }*/
/*    .ob-image { width: 100%; height: auto; aspect-ratio: 29.125 / 22.75; }*/
/*}*/

/* Desktop: center text + choices vertically within the slide */
@media (min-width: 770px) {
    /* Ensure slides have enough height to allow vertical centering,
       even on slides without an image */
    .ob-slide {
        min-height: 22.75rem; /* match image height for visual balance */
    }

    /* Vertically center the title + description + choices as a group */
    .ob-text {
        justify-content: center;   /* center content vertically */
        align-items: flex-start;    /* keep left-aligned text */
    }
}

/* Mobile bottom-sheet style for Onboarding */
@media (max-width: 769px) {
    /* Sheet becomes a bottom sheet */
    .ob-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1;                      /* ensure above overlay */
        width: 100%;
        max-width: 100%;
        border-radius: 1rem 1rem 0 0;    /* round only top corners */
        max-height: 88vh;                /* bottom sheet height */
        display: flex;
        flex-direction: column;
        overflow: hidden;                /* keep rounded corners clean */
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    /* Body scrolls if content exceeds available height */
    .ob-body {
        padding: 1rem 1rem 0;
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .ob-swiper {
        flex: 1 1 auto;
        min-height: 0;             /* important for iOS/Safari flexbox */
    }

    /* Slides stack vertically: image first, then text */
    .ob-slide {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        height: 100%;
        min-height: 0;
    }

    .ob-media {
        width: 100%;
        flex: 1 1 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ob-image {
        width: 100%;
        height: auto;                 /* don't stretch vertically */
        aspect-ratio: 29.125 / 22.75; /* preserve original card ratio */
        background-size: contain;     /* show full artwork without cropping */
        background-position: center;
        background-repeat: no-repeat;
        max-height: 100%;
    }

    .ob-text {
        flex: 1 1 50%;
        overflow-y: auto;          /* scroll text if it exceeds its half */
        padding-bottom: 0.25rem;   /* small spacing before footer */
    }

    /* Footer stays inside sheet with safe area for iOS */
    .ob-footer {
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)) 1rem;
    }

    /* Improve transform stability and prevent tiny offsets */
    .ob-swiper .swiper-wrapper { transform: translateZ(0); will-change: transform; }
    .ob-swiper .swiper-slide { flex-shrink: 0; } /* explicit, though Swiper sets it */
    .ob-swiper { overflow: hidden; }

    /* If no image, don’t reserve space at the top */
    .ob-media:empty { display: none; }

    /* Text block at top; let choices own the scrollable area */
    .ob-text {
        flex: 1 1 auto;
        overflow: hidden;        /* stop scrolling the whole text block */
        /* optional: small top padding if you want breathing room */
        /* padding-top: 0.5rem; */
    }

    /* Choices take the remaining space and scroll vertically */
    .ob-choices {
        flex: 1 1 auto;
        overflow-y: auto;
        margin-top: 0.5rem;
    }

}