/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
    --color-bg: #FFFFFF;
    --color-text: #000000;
    --color-text-secondary: rgba(0, 0, 0, 0.70);
    --color-text-muted: rgba(0, 0, 0, 0.60);
    --color-border: rgba(0, 0, 0, 0.10);
    --color-border-light: rgba(182, 182, 182, 0.30);
    --color-overlay: rgba(0, 0, 0, 0.5);
    --color-hover: rgba(0, 0, 0, 0.10);
    --color-hover-light: rgba(0, 0, 0, 0.05);
    --color-danger: #F20000;
    --color-shadow: rgba(0, 0, 0, 0.15);
    --color-shadow-light: rgba(0, 0, 0, 0.05);

    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 20px;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 90px;

    --header-height: 56px;
    --mobile-nav-height: 48px;
    --sidebar-width: 240px;
    --touch-target: 44px;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    -webkit-tap-highlight-color: transparent;
    outline: none;
    touch-action: manipulation;
}

a:focus,
a:active {
    outline: none;
    box-shadow: none;
}

/* Touch optimization for all interactive elements */
button, a, input, select, textarea, [role="button"] {
    touch-action: manipulation;
}

/* ===== MAIN CONTAINER ===== */
.main-container {
    width: 100%;
    height: 100vh;
    contain: layout style;
}

/* ===== HEADER ===== */
.header {
    width: 100%;
    height: var(--header-height);
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    gap: var(--spacing-sm);
    z-index: 2;
    background-color: var(--color-bg);
    contain: layout style;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    width: 95%;
}

/* ===== LOGO ===== */
.logo {
    display: flex;
    align-items: center;
    justify-content: start;
}

.logo img {
    max-width: 252px;
    cursor: pointer;
}

/* ===== SEARCH BAR ===== */
.search-bar {
    display: none;
    width: 100%;
}

/* Search bar inside content-toolbar is always visible */
.content-toolbar .search-bar {
    display: flex;
}

.search-bar input {
    width: 100%;
    border: 1.5px solid var(--color-border);
    border-right: 0;
    border-radius: var(--radius-full) 0 0 var(--radius-full);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-sm);
    background: var(--color-hover-light, rgba(0, 0, 0, 0.03));
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color, rgba(0, 0, 0, 0.3));
    background: var(--color-bg);
}

.search-bar .search-icon {
    border: 1.5px solid var(--color-border);
    border-left: 0;
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    display: flex;
    align-items: center;
    padding-right: var(--spacing-md);
    cursor: pointer;
    background: var(--color-hover-light, rgba(0, 0, 0, 0.03));
    min-height: var(--touch-target);
    transition: background-color 0.2s ease;
}

.search-bar .search-icon img {
    width: 24px;
    height: 24px;
}

/* ===== LOGOUT MODAL ===== */
.logout-modal {
    position: absolute;
    top: 50px;
    left: calc(100% - 250px);
    display: none !important;
    padding: var(--spacing-sm);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: var(--color-bg);
    box-shadow: 0 12px 36px 0 var(--color-shadow);
    z-index: 9;
    cursor: pointer;
}

.logout-button {
    width: 208px;
    height: 40px;
    display: flex;
    justify-content: start;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--color-bg);
    border: none;
    border-radius: var(--radius-md);
    padding: 0 var(--spacing-sm);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    min-height: var(--touch-target);
}

.logout-button img {
    width: 20px;
    height: 20px;
}

.logout-button:hover {
    background: var(--color-hover);
}

.logout-confirm-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--color-overlay);
    display: none;
    z-index: 2;
}

.logout-confirm-box {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--color-bg);
    box-shadow: 0 12px 36px 0 var(--color-shadow-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-2xl);
    animation: slide-in 400ms ease-out;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
}

.logout-details-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.logout-details-box img {
    width: 64px;
    height: 64px;
}

.logout-details-box .header {
    display: flex;
    height: 21px;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
    color: var(--color-text);
    text-align: center;
    font-size: var(--font-size-base);
    font-style: normal;
    font-weight: 600;
    line-height: 150%;
    margin-top: var(--spacing-xs);
}

.logout-details-box .description {
    color: var(--color-text-secondary);
    text-align: center;
    font-size: var(--font-size-sm);
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    align-self: stretch;
}

.logout-done {
    display: flex;
    height: 40px;
    justify-content: center;
    align-items: center;
    align-self: stretch;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: var(--color-danger);
    cursor: pointer;
    color: #FFF;
    font-size: var(--font-size-base);
    font-style: normal;
    font-weight: 600;
    line-height: 19px;
    width: 132px;
    padding: var(--spacing-sm) 54px;
    min-height: var(--touch-target);
}

.logout-button-box {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    align-self: center;
    width: 100%;
}

.logout-done.cancel {
    background: #DEDEDE;
    color: var(--color-text);
}

@keyframes slide-in {
    from {
        transform: translateY(100%);
        opacity: 1;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== SEARCH MODAL ===== */
.search-modal {
    position: absolute;
    top: var(--header-height);
    left: 0;
    display: none;
    width: 100%;
    height: calc(100% - var(--header-height));
    padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-lg);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: var(--spacing-md);
    border-radius: 0;
    background: var(--color-bg);
    z-index: 9;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Search modal inside content-toolbar: dropdown style */
.content-toolbar .search-modal {
    top: 100%;
    height: auto;
    max-height: 70vh;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-top: 0;
    overflow-y: auto;
}

.search-modal-button {
    display: none;
    padding: var(--spacing-sm) var(--spacing-xs);
    justify-content: center;
    align-items: center;
    gap: 10px;
    align-self: stretch;
    border-radius: var(--radius-md);
    line-height: 150%;
    font-style: normal;
    min-height: var(--touch-target);
}

.result {
    background: var(--color-hover);
    color: var(--color-text);
    border: 0;
    font-size: var(--font-size-sm);
    font-style: normal;
    font-weight: 700;
    cursor: pointer;
}

.report {
    color: var(--color-text);
    opacity: 0.6;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    font-size: var(--font-size-xs);
    font-weight: 400;
}

.search-modal-suggestion {
    min-height: unset;
    max-height: unset;
    width: 100%;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    scrollbar-width: none;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
}

.suggestion-row {
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    min-height: var(--touch-target);
}

.suggestion-row:hover {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.suggestion-row-icon.send, .suggestion-row-icon.close {
    height: 20px;
    width: 20px;
    opacity: 0.6;
}

.suggestion-row-search {
    height: 28px;
    width: 28px;
    padding: 6px;
    border-radius: var(--radius-md);
    background: var(--color-hover);
}

.suggestion-row-icon {
    max-height: 20px;
    max-width: 20px;
    cursor: pointer;
    right: var(--spacing-lg);
}

.suggestion-row-text {
    width: 100%;
    color: var(--color-text);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-style: normal;
    font-weight: 500;
    line-height: 150%;
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

/* ===== LOGIN BUTTON ===== */
.login-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
    justify-content: end;
}

.login-button button {
    display: block;
}

.login-button span {
    display: inline;
}

#login_button:hover {
    background: var(--color-hover-light);
}

.logged-in-box {
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    align-items: center;
    align-self: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-xs);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

#welcomeMessage {
    display: flex;
    justify-content: end;
    width: 100%;
    gap: var(--spacing-sm);
    align-items: center;
    align-self: center;
}

#welcomeMessage img {
    width: 24px;
    height: 24px;
    border-radius: 24px;
    background: lightgray 50% / cover no-repeat;
}

.login-button button {
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 20px;
    height: 40px;
    background-color: var(--color-bg);
    white-space: nowrap;
    padding: 0 var(--spacing-lg);
    min-height: var(--touch-target);
}

.login-button img {
    height: 24px;
    width: 24px;
    align-self: center;
}

.login-button-arrow {
    height: 20px;
    width: 20px;
    align-self: center;
    cursor: pointer;
}

/* ===== LOGIN MODAL ===== */
.login-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--color-overlay);
    display: none;
    z-index: 2;
}

.login-modal-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 240px;
    padding: var(--spacing-lg) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--color-bg);
    box-shadow: 0 12px 36px 0 var(--color-shadow-light);
    animation: slide-in 400ms ease-out;
}

.login-modal-header {
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    padding: 0 var(--spacing-lg);
    width: 100%;
    align-items: center;
}

.login-modal-title {
    color: var(--color-text);
    text-align: center;
    font-size: var(--font-size-base);
    font-style: normal;
    font-weight: 700;
    line-height: 150%;
}

.login-modal-close, .modal-close {
    width: 24px;
    height: 24px;
    padding: 6px;
    border-radius: var(--radius-full);
    background: var(--color-hover);
    cursor: pointer;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
}

.login-divider {
    height: 1px;
    background-color: #ddd;
    width: 100%;
}

.google-box {
    display: flex;
    height: 40px;
    padding: var(--spacing-sm) var(--spacing-lg);
    justify-content: space-between;
    align-items: center;
    align-self: stretch;
    border-radius: var(--radius-sm);
    background: var(--color-hover);
    margin: 0 var(--spacing-2xl);
    cursor: pointer;
    min-height: var(--touch-target);
}

.google-icon {
    width: 24px;
    height: 24px;
}

.google-text {
    color: var(--color-text);
    text-align: center;
    font-size: var(--font-size-sm);
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    width: 100%;
}

.login-tnc {
    overflow: hidden;
    color: var(--color-text-muted);
    text-align: center;
    text-overflow: ellipsis;
    font-size: var(--font-size-xs);
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    width: 100%;
    text-wrap: auto;
    padding: 0 var(--spacing-lg);
}

.login-tnc a {
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.login-signIn {
    color: var(--color-text);
    text-align: center;
    font-size: var(--font-size-sm);
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    width: 100%;
    padding: 0 var(--spacing-lg);
    cursor: pointer;
}

.login-signIn a {
    text-decoration: none;
    font-weight: 700;
}

/* ===== MAIN SECTION ===== */
.main-section {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: calc(100vh - var(--header-height));
    contain: layout style;
}

.content-container {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    width: 100%;
}

/* ===== DESKTOP NAVIGATION (hidden on mobile) ===== */
.navigation {
    display: none;
}

.nav-item {}

.right-nav-container {
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    opacity: 0.6;
    min-height: var(--touch-target);
}

.right-nav-container:hover {
    background: var(--color-hover);
}

.right-nav-container.current {
    background: var(--color-hover);
    opacity: 1;
}

.right-nav-container img {
    width: 24px;
    height: 24px;
    margin: var(--spacing-sm) 10px;
}

.right-nav-container a {
    text-decoration: none;
    padding: 6px;
    display: block;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    width: 100%;
}

.right-nav-container .nav-item-a {
    display: none;
}

.right-nav-container.current a {}

.divider {
    height: 1px;
    background-color: #ddd;
    margin: var(--spacing-sm) 0;
    max-width: 250px;
}

/* ===== MOBILE NAVIGATION ===== */
.mobile-navigation {
    display: flex;
    position: fixed;
    bottom: 0;
    background: var(--color-bg);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    justify-content: space-around;
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    z-index: 1;
    font-size: var(--font-size-xs);
    width: 100%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
}

.mobile-navigation a {
    text-decoration: none;
    color: var(--color-text, #333);
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    display: block;
}

.mobile-navigation a:hover {
    color: var(--primary-color, #333);
}

.mobile-nav-item {
    width: 100%;
    text-align: center;
    min-height: var(--touch-target);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.mobile-nav-item img {
    width: 22px;
    height: 22px;
    border-radius: 22px;
    opacity: 0.35;
    transition: opacity 0.2s ease;
}

.mobile-nav-item a {
    opacity: 0.35;
    transition: opacity 0.2s ease;
}

.mobile-nav-item.current img {
    opacity: 1;
}

.mobile-nav-item.current a {
    opacity: 1;
}

/* ===== FILTERS ===== */
.filter-header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin-right: 10px;
    gap: var(--spacing-sm);
    overflow: auto;
    scrollbar-width: none;
}

.filter-item a {
    text-decoration: none;
    color: black;
    text-wrap: nowrap;
}

.filter-item {
    border: 1px solid var(--color-border-light);
    align-items: center;
    justify-content: center;
    display: flex;
    border-radius: var(--radius-md);
    padding: 6px var(--spacing-sm);
    min-height: var(--touch-target);
}

/* ===== SUPER FEEDS ===== */
.super-feeds {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 0 var(--spacing-sm) 56px;
    contain: layout style;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ===== MOBILE SEARCH BAR ===== */
.mobile-search-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: transparent;
    position: relative;
    width: 100%;
}

.mobile-search-back {
    display: none;
}

.swipe-blink {
    font-size: var(--font-size-sm);
    font-weight: lighter;
    animation: blink 1s infinite;
    align-items: flex-end;
    align-content: flex-end;
    width: 90%;
    text-align: end;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.swipe-blink .arrow {
    display: inline-block;
    animation: slideArrow 1s infinite;
}

@keyframes slideArrow {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(10px);
    }
}

/* Mobile search icon */
.mobile-search-bar .search-icon {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
}

.mobile-search-bar .search-icon img {
    width: 24px;
    height: 24px;
}

.mobile-search-bar input {
    display: none;
    width: 100%;
    border: none;
    border-radius: 0;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--color-bg);
    z-index: 1000;
}

.mobile-search-bar.expanded input {
    display: block;
}

/* ===== TABLET STYLES (min-width: 768px) ===== */
@media (min-width: 768px) {
    .header {
        padding: var(--spacing-sm) var(--spacing-lg);
    }

    .navigation {
        display: block;
        width: auto;
        height: 100%;
        overflow: auto;
        padding: var(--spacing-md) var(--spacing-lg);
    }

    .super-feeds {
        width: calc(100% - 76px);
        padding: var(--spacing-md) var(--spacing-md);
    }
}

/* ===== DESKTOP STYLES (min-width: 1025px) ===== */
@media (min-width: 1025px) {
    .header {
        padding: var(--spacing-sm) var(--spacing-xl);
        gap: 0;
    }

    .logo {
        width: 253px;
    }

    .header .search-bar {
        display: flex;
        height: 40px;
        margin: 0 var(--spacing-2xl);
        width: auto;
    }

    .header .search-bar input {
        width: 480px;
    }

    .mobile-search-bar {
        display: none;
    }

    .login-button {
        width: 252px;
    }

    .navigation {
        width: var(--sidebar-width);
        height: 100%;
        overflow: auto;
        padding: var(--spacing-md) var(--spacing-lg);
    }

    .right-nav-container .nav-item-a {
        display: block;
    }

    .mobile-navigation {
        display: none;
    }

    .content-container {
        flex-direction: row;
    }

    .super-feeds {
        width: calc(100% - var(--sidebar-width));
        padding: var(--spacing-md) var(--spacing-xl);
    }

    .search-modal:not(.content-toolbar .search-modal) {
        left: calc(50% - 250px);
        width: 500px;
        height: auto;
        padding: var(--spacing-lg);
        border-radius: var(--radius-lg);
        border: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        touch-action: auto;
        user-select: auto;
        -webkit-user-drag: auto;
    }

    .search-modal-suggestion {
        min-height: 80px;
        max-height: 330px;
        touch-action: auto;
        user-select: auto;
        -webkit-user-drag: auto;
    }

    .logout-modal {
        display: none;
    }

    .logout-confirm-box {
        position: absolute;
        top: calc(50vh - 138px);
        left: calc(50vw - 188px);
        bottom: auto;
        width: 398px;
        height: 257px;
        border-radius: var(--radius-lg);
        animation: none;
        touch-action: auto;
        user-select: auto;
        -webkit-user-drag: auto;
    }

    .login-modal-bg {
        position: absolute;
        top: calc(50vh - 120px);
        left: calc(50vw - 200px);
        bottom: auto;
        width: 400px;
        border-radius: var(--radius-lg);
        animation: none;
    }
}

/* ===== SHARED VIDEO/CAROUSEL GRID STYLES (home + search) ===== */
.carousal-videos {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    background-color: var(--color-border, rgba(0, 0, 0, 0.08));
}

.video-description {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-overflow: ellipsis;
    overflow: hidden;
    max-height: 2.8em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-width: 100%;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ===== VIDEO STATS (views + likes) ===== */
.video-stats {
    display: flex;
    gap: 10px;
    align-items: center;
}

.video-stat {
    display: flex;
    align-items: center;
    gap: 3px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

.video-stat svg {
    flex-shrink: 0;
    opacity: 0.9;
}

.video-stat .stat-value {
    font-variant-numeric: tabular-nums;
}

.description-container {
    max-width: 100%;
    background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
    padding: 32px 10px 8px;
    position: absolute;
    bottom: 0;
    border-radius: 0 0 10px 10px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.description-container.desktop-only {
    display: none;
}

@media (min-width: 768px) {
    .description-container.desktop-only {
        display: flex;
    }
}

/*
 * Design decision:
 * - For mobile feed, action controls and metadata are rendered once in a fixed overlay and
 *   synced to the currently playing card by JS.
 * - This avoids repeating interaction chrome in every grid node and reduces paint/layout work
 *   during rapid swipe transitions.
 */
.home-mobile-overlay {
    position: fixed;
    inset: auto 0 0;
    pointer-events: none;
    z-index: 4;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 0 0 max(env(safe-area-inset-bottom), 8px);
}

.home-mobile-overlay .image-container,
.home-mobile-overlay .description-container {
    pointer-events: auto;
}

.home-mobile-overlay .image-container {
    align-self: flex-end;
    margin: 0 8px 0 0;
}

.home-mobile-overlay .description-container {
    border-radius: 0;
}

.image-container {
    display: none;
    padding: 6px;
    align-items: flex-start;
    gap: 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: absolute;
    top: 8px;
    right: 8px;
}

.image-container .unmute {
    display: flex;
}
.image-container .mute {
    display: none;
}

.carousal-container {
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
    contain: layout style paint;
}

.carousal-container::-webkit-scrollbar {
    display: none;
}

@media (min-width: 768px) {
    /* Desktop keeps per-card metadata in-flow and disables the shared mobile overlay. */
    .home-mobile-overlay {
        display: none !important;
    }

    .carousal-videos {
        height: calc(100% - 52px);
        border-radius: 10px;
    }

    .video-description {
        font-size: 13px;
        max-width: none;
        color: var(--color-text, #000);
        text-shadow: none;
        font-weight: 600;
        line-height: 1.4;
        margin-top: 6px;
        -webkit-line-clamp: 1;
    }

    .video-stats {
        margin-top: 2px;
    }

    .video-stat {
        color: var(--color-text-muted, rgba(0, 0, 0, 0.5));
        font-size: 11px;
    }

    .description-container {
        background-image: none;
        padding: 0;
        position: static;
        border-radius: 0;
    }
}
