/* ==========================================
   RESET
========================================== */

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


html {
    scroll-behavior: smooth;
}


body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

:root {

    --bg: #090b10;

    --surface: #11141b;

    --surface-2: #151922;

    --text: #f5f7fa;

    --text-muted: #8e96a3;

    --border:
        rgba(
            255,
            255,
            255,
            0.08
        );

    --card-hover:
        rgba(
            255,
            255,
            255,
            0.15
        );
}


/* ==========================================
   LIGHT THEME
========================================== */

body.light-theme {

    --bg: #f7f8fb;

    --surface: #ffffff;

    --surface-2: #f1f3f8;

    --text: #111827;

    --text-muted: #5f6978;

    --border:
        rgba(
            0,
            0,
            0,
            0.08
        );

    --card-hover:
        rgba(
            0,
            0,
            0,
            0.10
        );
}


/* ==========================================
   EMBEDDED LANDING PAGE
========================================== */

.landing-embed {
    position: fixed;

    top: 0;
    left: 0;

    width: 100vw;
    height: 100vh;

    z-index: 99999;

    /*
       Hidden by default.
    */

    visibility: hidden;

    opacity: 0;

    pointer-events: none;

    overflow: hidden;

    background: #000;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}


/*
   Landing page becomes visible when
   JavaScript adds the "active" class.
*/

.landing-embed.active {
    visibility: visible;

    opacity: 1;

    pointer-events: auto;
}


/*
   The actual iframe.
*/

#landingPage {
    display: block;

    width: 100%;
    height: 100%;

    border: 0;

    margin: 0;
    padding: 0;
}


/*
   Prevent the gallery underneath from
   scrolling while the landing page
   is displayed.
*/

body.landing-open {
    overflow: hidden;
}


/* ==========================================
   HEADER
========================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    background: var(--bg);
    backdrop-filter: blur(18px);

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}


.header-inner {
    width: min(1400px, calc(100% - 40px));
    margin: auto;

    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}


.logo {
    color: #ffffff;
    text-decoration: none;

    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 1.2rem;
    font-weight: 800;
}


.logo-icon {
    width: 30px;
    height: 30px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: #ffffff;
    color: #090b10;

    font-size: 0.8rem;
}


.header-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}


.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.more-menu-wrapper {
    position: relative;
}

.more-menu-button {
    border: 1px solid var(--border);
    background: var(--surface);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
}

.more-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;

    min-width: 220px;

    background: var(--surface);

    border: 1px solid rgba(
        255,
        255,
        255,
        0.08
    );

    border-radius: 14px;

    overflow: hidden;

    display: none;

    z-index: 200;
}

.more-menu.open {
    display: block;
}

.more-menu-item {

    width: 100%;

    border: 0;

    background: transparent;

    color: #fff;

    text-align: left;

    padding: 14px 16px;

    cursor: pointer;
}

.more-menu-item:hover {

    background:
        rgba(
            255,
            255,
            255,
            0.06
        );
}


/* ==========================================
   HERO
========================================== */

.hero {
    width: min(1400px, calc(100% - 40px));
    margin: auto;

    padding: 90px 0 60px;
}


.hero-label {
    display: inline-block;

    margin-bottom: 18px;

    color: var(--text-muted);

    font-size: 0.78rem;
    font-weight: 800;

    letter-spacing: 0.16em;
}


.hero h1 {
    font-size: clamp(2.6rem, 6vw, 5.5rem);
    line-height: 0.98;

    letter-spacing: -0.055em;

    max-width: 850px;
}


.hero p {
    margin-top: 24px;

    max-width: 620px;

    color: #969eab;

    font-size: 1.05rem;
    line-height: 1.7;
}


/* ==========================================
   TRENDING
========================================== */

.trending-section {
    width: min(1400px, calc(100% - 40px));
    margin: 0 auto 50px;
}

.trending-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.trending-label {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.trending-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
}

.trending-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.trending-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding-bottom: 10px;
}

.trending-carousel::-webkit-scrollbar {
    height: 8px;
}

.trending-carousel::-webkit-scrollbar-thumb {
    background: rgba(
        255,
        255,
        255,
        0.15
    );
    border-radius: 999px;
}

.trending-carousel::-webkit-scrollbar-track {
    background: transparent;
}


/* ==========================================
   TRENDING CARD
========================================== */

.trending-card {
    position: relative;
    flex: 0 0 260px;
    height: 340px;
    overflow: hidden;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid rgba(
        255,
        255,
        255,
        0.08
    );
    cursor: pointer;
    transition:
        transform 0.3s ease,
        border-color 0.3s ease;
}

.trending-card:hover {
    transform: translateY(-5px);
    border-color: rgba(
        255,
        255,
        255,
        0.18
    );
}

.trending-card img,
.trending-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition:
        transform 0.4s ease;
}

.trending-card:hover img,
.trending-card:hover video {
    transform: scale(1.05);
}

.trending-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.8),
            transparent 55%
        );
    pointer-events: none;
}


/* ==========================================
   TRENDING BADGE
========================================== */

.trending-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ffffff;
    color: #090b10;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


/* ==========================================
   TRENDING RANK
========================================== */

.trending-rank {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(
        9,
        11,
        16,
        0.78
    );
    border: 1px solid rgba(
        255,
        255,
        255,
        0.15
    );
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
}


/* ==========================================
   TRENDING INFORMATION
========================================== */

.trending-info {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 5;
}

.trending-name {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.trending-type {
    margin-top: 6px;
    color: rgba(
        255,
        255,
        255,
        0.65
    );
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}


/* ==========================================
   TRENDING RESPONSIVE
========================================== */

@media (max-width: 900px) {

    .trending-card {
        flex: 0 0 220px;
        height: 300px;
    }

}

@media (max-width: 480px) {

    .trending-section {
        width: min(
            100% - 24px,
            1400px
        );
    }

    .trending-card {
        flex: 0 0 180px;
        height: 250px;
    }

    .trending-title {
        font-size: 1.4rem;
    }

}


/* ==========================================
   RECENTLY ADDED
========================================== */

.recent-section {

    width: min(1400px, calc(100% - 40px));

    margin: 0 auto 40px;

}

.recent-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 18px;

}

.recent-title {

    font-size: 1.4rem;

    font-weight: 800;

}

.recent-subtitle {

    color: var(--text-muted);

    font-size: 0.9rem;

    margin-top: 4px;

}

.recent-carousel {

    display: flex;

    gap: 16px;

    overflow-x: auto;

    scrollbar-width: thin;

    padding-bottom: 8px;

}

.recent-carousel::-webkit-scrollbar {

    height: 8px;

}

.recent-carousel::-webkit-scrollbar-thumb {

    background: rgba(255,255,255,0.15);

    border-radius: 20px;

}

.recent-card {

    position: relative;

    flex: 0 0 260px;

    height: 170px;

    overflow: hidden;

    border-radius: 18px;

    cursor: pointer;

    background: var(--surface);

    border: 1px solid var(--border);

    transition:
        transform 0.3s ease,
        border-color 0.3s ease;

}

.recent-card:hover {

    transform: translateY(-4px);

    border-color: rgba(255,255,255,0.18);

}

.recent-card img,
.recent-card video {

    width: 100%;

    height: 100%;

    object-fit: cover;

    display: block;

    transition: transform 0.4s ease;

}

.recent-card:hover img,
.recent-card:hover video {

    transform: scale(1.05);

}

.recent-card::after {

    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(0,0,0,0.75),
            transparent 55%
        );

}

.recent-info {

    position: absolute;

    left: 14px;

    right: 14px;

    bottom: 12px;

    z-index: 3;

}

.recent-name {

    color: #ffffff;

    font-size: 0.9rem;

    font-weight: 700;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

}

.recent-type {

    margin-top: 4px;

    color: rgba(255,255,255,0.65);

    font-size: 0.72rem;

    text-transform: uppercase;

    letter-spacing: 0.08em;

}

.new-badge {

    position: absolute;

    top: 12px;

    right: 12px;

    z-index: 5;

    padding: 6px 10px;

    border-radius: 999px;

    background: #ffffff;

    color: #090b10;

    font-size: 0.7rem;

    font-weight: 800;

    letter-spacing: 0.05em;

}


/* ==========================================
   RECENTLY ADDED
========================================== */

.recent-section {

    width: min(1400px, calc(100% - 40px));

    margin: 0 auto 50px;

}

.recent-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;

}

.recent-label {

    display: inline-block;

    margin-bottom: 8px;

    color: var(--text-muted);

    font-size: 0.75rem;

    font-weight: 800;

    letter-spacing: 0.16em;

}

.recent-title {

    font-size: 1.8rem;

    font-weight: 800;

    color: #ffffff;

}

.recent-count {

    color: var(--text-muted);

    font-size: 0.9rem;

}

.recent-carousel {

    display: flex;

    gap: 16px;

    overflow-x: auto;

    overflow-y: hidden;

    scroll-behavior: smooth;

    padding-bottom: 10px;

}

.recent-carousel::-webkit-scrollbar {

    height: 8px;

}

.recent-carousel::-webkit-scrollbar-thumb {

    background: rgba(
        255,
        255,
        255,
        0.15
    );

    border-radius: 999px;

}

.recent-carousel::-webkit-scrollbar-track {

    background: transparent;

}



/* ==========================================
   RECENT CARD
========================================== */

.recent-card {

    position: relative;

    flex: 0 0 260px;

    height: 340px;

    overflow: hidden;

    border-radius: 18px;

    background: var(--surface);

    border: 1px solid rgba(
        255,
        255,
        255,
        0.08
    );

    cursor: pointer;

    transition:
        transform 0.3s ease,
        border-color 0.3s ease;
}

.recent-card:hover {

    transform: translateY(-5px);

    border-color: rgba(
        255,
        255,
        255,
        0.18
    );
}

.recent-card img,
.recent-card video {

    width: 100%;

    height: 100%;

    object-fit: cover;

    display: block;

}

.recent-card::after {

    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(0,0,0,0.8),
            transparent 55%
        );

}


/* ==========================================
   NEW BADGE
========================================== */

.new-badge {

    position: absolute;

    top: 12px;

    right: 12px;

    z-index: 10;

    padding: 6px 10px;

    border-radius: 999px;

    background: #ffffff;

    color: #090b10;

    font-size: 0.7rem;

    font-weight: 800;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}

/* ==========================================
   RECENT CARD INFO
========================================== */

.recent-info {

    position: absolute;

    left: 16px;

    right: 16px;

    bottom: 16px;

    z-index: 5;

}

.recent-card-title {

    color: #ffffff;

    font-size: 0.9rem;

    font-weight: 700;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}

.recent-card-meta {

    margin-top: 6px;

    color: rgba(
        255,
        255,
        255,
        0.65
    );

    font-size: 0.75rem;

    letter-spacing: 0.05em;

    text-transform: uppercase;
}


/* ==========================================
   CONTROLS
========================================== */

.gallery-controls {
    width: min(1400px, calc(100% - 40px));
    margin: 0 auto 30px;

    display: flex;
    align-items: center;
    gap: 18px;

    flex-wrap: wrap;
}


.search-box {
    position: relative;

    flex: 1 1 300px;
}


.search-icon {
    position: absolute;

    left: 16px;
    top: 50%;

    transform: translateY(-50%);

    opacity: 0.65;
}


.search-box input {
    width: 100%;

    padding: 14px 18px 14px 46px;

    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;

    outline: none;

    background: var(--surface);
    color: #ffffff;

    font-size: 0.95rem;

    transition: border-color 0.2s, background 0.2s;
}


.search-box input:focus {
    border-color: rgba(255, 255, 255, 0.25);
    background: #151922;
}


.search-wrapper {
    position: relative;
    width: 100%;
}

.clear-search-control {
    position: absolute;
    top: 50%;
    right: 12px;

    transform: translateY(-50%);

    width: 30px;
    height: 30px;

    border: none;
    border-radius: 50%;

    cursor: pointer;

    font-size: 14px;
    font-weight: 700;

    background: rgba(255,255,255,0.08);
    color: inherit;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.clear-search-control:hover {
    background: rgba(255,255,255,0.15);
}

.clear-search-control:active {
    transform:
        translateY(-50%)
        scale(0.95);
}

.filter-group {
    display: flex;
    gap: 8px;
}


.filter-button {
    padding: 11px 17px;

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 11px;

    background: var(--surface);
    color: var(--text-muted);

    cursor: pointer;

    transition:
        background 0.2s,
        color 0.2s,
        transform 0.2s;
}


.filter-button:hover {
    color: #ffffff;
    transform: translateY(-1px);
}


.filter-button.active {
    background: #ffffff;
    color: #090b10;
}


.result-count {
    color: #777f8c;
    font-size: 0.88rem;
}


/* ==========================================
   GALLERY
========================================== */

.gallery {
    width: min(1400px, calc(100% - 40px));
    margin: auto;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}


.gallery {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(240px, 1fr)
    );
    gap: 24px;
    width: 100%;
}



.media-card {
    position: relative;

    overflow: hidden;

    aspect-ratio: 4 / 5;

    border-radius: 18px;

    background: var(--surface);

    cursor: pointer;

    border: 1px solid rgba(255, 255, 255, 0.06);

    transform: translateZ(0);

    transition:
        transform 0.3s ease,
        border-color 0.3s ease;
}


.media-card:hover {
    transform: translateY(-5px);

    border-color:
        rgba(255, 255, 255, 0.15);
}


.media-card img,
.media-card video {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition:
        transform 0.5s ease,
        filter 0.4s ease;
}


.media-card:hover img,
.media-card:hover video {
    transform: scale(1.04);
}


.media-card::after {
    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.75),
            transparent 50%
        );

    pointer-events: none;
}


/* ==========================================
   CARD INFORMATION
========================================== */

.card-info {
    position: absolute;

    left: 16px;
    right: 16px;
    bottom: 15px;

    z-index: 3;
}


.card-title {
    overflow: hidden;

    color: #ffffff;

    font-size: 0.9rem;
    font-weight: 700;

    white-space: nowrap;
    text-overflow: ellipsis;
}


.card-type {
    margin-top: 5px;

    color: rgba(255, 255, 255, 0.65);

    font-size: 0.72rem;
    text-transform: uppercase;

    letter-spacing: 0.08em;
}


/* ==========================================
   VIDEO PLAY BUTTON
========================================== */

.play-button {
    position: absolute;

    top: 50%;
    left: 50%;

    z-index: 4;

    width: 58px;
    height: 58px;

    transform:
        translate(-50%, -50%);

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: rgba(0, 0, 0, 0.62);

    border: 1px solid
        rgba(255, 255, 255, 0.28);

    color: #ffffff;

    font-size: 1.2rem;

    backdrop-filter: blur(8px);

    transition:
        transform 0.25s ease,
        background 0.25s ease;
}


.media-card:hover .play-button {
    transform:
        translate(-50%, -50%)
        scale(1.08);

    background: rgba(255, 255, 255, 0.15);
}


/* ==========================================
   VIDEO PREVIEW PROGRESS
========================================== */

.preview-progress {
    position: absolute;

    left: 0;
    bottom: 0;

    z-index: 5;

    height: 3px;

    width: 0;

    background: #ffffff;

    pointer-events: none;
}


/* ==========================================
   EMPTY STATE
========================================== */

.empty-state {
    width: min(600px, calc(100% - 40px));

    margin: 90px auto;

    text-align: center;
}


.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}


.empty-state h2 {
    font-size: 1.5rem;
}


.empty-state p {
    margin-top: 10px;

    color: #7f8794;
}


/* ======================================
   SCROLLABLE MEDIA VIEWER
======================================= */

.viewer {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: none;

    background:
        rgba(5, 7, 11, 0.97);

    backdrop-filter: blur(14px);
}

.viewer.open {
    display: block;
}


/* --------------------------------------
   CLOSE BUTTON
--------------------------------------- */

.viewer-close {
    position: fixed;

    top: 18px;
    right: 22px;

    z-index: 20;

    width: 46px;
    height: 46px;

    border: 1px solid rgba(255, 255, 255, 0.15);

    border-radius: 50%;

    background: rgba(15, 18, 25, 0.85);

    color: #ffffff;

    font-size: 30px;
    line-height: 1;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.viewer-close:hover {
    background: rgba(255, 255, 255, 0.15);

    transform: scale(1.05);
}


/* --------------------------------------
   SCROLL AREA
--------------------------------------- */

.viewer-scroll {
    width: 100%;
    height: 100%;

    overflow-y: auto;
    overflow-x: hidden;

    scroll-behavior: smooth;

    padding:
        70px 20px 80px;
}


/* Custom scrollbar */

.viewer-scroll {
    scrollbar-width: thin;
    scrollbar-color:
        rgba(255, 255, 255, 0.25)
        transparent;
}

.viewer-scroll::-webkit-scrollbar {
    width: 9px;
}

.viewer-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.viewer-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);

    border-radius: 20px;
}

.viewer-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}


/* --------------------------------------
   MEDIA LIST
--------------------------------------- */

.viewer-list {
    width: min(1100px, 100%);

    margin: 0 auto;

    display: flex;

    flex-direction: column;

    gap: 60px;
}


/* --------------------------------------
   INDIVIDUAL VIEWER ITEM
--------------------------------------- */

.viewer-item {
    width: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    padding: 30px 0;

    scroll-margin-top: 30px;
}


/* --------------------------------------
   MEDIA
--------------------------------------- */

.viewer-media {
    width: 100%;

    max-height: 78vh;

    object-fit: contain;

    display: block;

    border-radius: 14px;

    background: #000;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.45);
}


/* Images */

.viewer-media.viewer-image {
    height: auto;

    max-width: 100%;
}


/* Videos */

.viewer-media.viewer-video {
    max-width: 100%;
}


/* --------------------------------------
   MEDIA INFORMATION
--------------------------------------- */

.viewer-item-info {
    width: 100%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-top: 16px;
}

.viewer-item-title {
    min-width: 0;

    color: #ffffff;

    font-size: 0.95rem;

    font-weight: 700;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}

.viewer-item-type {
    margin-top: 4px;

    color: rgba(255, 255, 255, 0.5);

    font-size: 0.72rem;

    text-transform: uppercase;

    letter-spacing: 0.08em;
}


/* --------------------------------------
   DOWNLOAD BUTTON
--------------------------------------- */

.viewer-download {
    flex-shrink: 0;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    padding: 10px 16px;

    border-radius: 10px;

    background: #ffffff;

    color: #090b10;

    text-decoration: none;

    font-size: 0.85rem;

    font-weight: 800;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.viewer-download:hover {
    transform: translateY(-2px);

    opacity: 0.9;
}


/* --------------------------------------
   SELECTED ITEM
--------------------------------------- */

.viewer-item.selected {
    scroll-margin-top: 30px;
}

.viewer-item.selected .viewer-media {
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.12),
        0 25px 70px rgba(0, 0, 0, 0.55);
}


/* --------------------------------------
   MOBILE
--------------------------------------- */

@media (max-width: 760px) {

    .viewer-scroll {
        padding:
            30px 12px 60px;
    }

    .viewer-list {
        gap: 35px;
    }

    .viewer-item {
        padding: 20px 0;
    }

    .viewer-media {
        max-height: 70vh;

        border-radius: 10px;
    }

    .viewer-item-info {
        align-items: flex-start;

        flex-direction: column;

        gap: 12px;
    }

    .viewer-download {
        width: 100%;
    }

    .viewer-close {
        top: 12px;
        right: 12px;

        width: 42px;
        height: 42px;

        font-size: 27px;
    }
}


/* ==========================================
   VIEWER
========================================== */

.viewer {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 50px;

    background: rgba(0, 0, 0, 0.94);

    backdrop-filter: blur(12px);
}


.viewer.open {
    display: flex;
}


.viewer-content {
    max-width: min(1100px, 90vw);
    max-height: 82vh;

    display: flex;
    align-items: center;
    justify-content: center;
}


.viewer-content img,
.viewer-content video {
    max-width: 100%;
    max-height: 82vh;

    border-radius: 14px;

    object-fit: contain;
}


.viewer-close,
.viewer-prev,
.viewer-next {
    position: absolute;

    border: 0;

    background: rgba(255, 255, 255, 0.08);

    color: #ffffff;

    cursor: pointer;

    display: grid;
    place-items: center;

    transition: background 0.2s;
}


.viewer-close:hover,
.viewer-prev:hover,
.viewer-next:hover {
    background: rgba(255, 255, 255, 0.18);
}


.viewer-close {
    top: 20px;
    right: 25px;

    width: 46px;
    height: 46px;

    border-radius: 50%;

    font-size: 1.8rem;
}


.viewer-prev,
.viewer-next {
    top: 50%;

    width: 48px;
    height: 48px;

    transform: translateY(-50%);

    border-radius: 50%;

    font-size: 2rem;
}


.viewer-prev {
    left: 22px;
}


.viewer-next {
    right: 22px;
}


.viewer-caption {
    position: absolute;

    left: 50%;
    bottom: 20px;

    transform: translateX(-50%);

    max-width: 80%;

    color: #ffffff;

    font-size: 0.9rem;

    text-align: center;
}

/* ======================================
   VIEWER PROGRESS BAR
======================================= */

.viewer-progress {
    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    z-index: 30;

    height: 4px;

    background:
        rgba(255, 255, 255, 0.08);

    pointer-events: none;
}

.viewer-progress-bar {
    width: 0%;
    height: 100%;

    background: #ffffff;

    border-radius: 0 4px 4px 0;

    transition:
        width 0.12s linear;
}



/* ======================================
   VIEWER COUNTER
======================================= */

.viewer-counter {
    position: fixed;

    top: 22px;
    left: 50%;

    transform: translateX(-50%);

    z-index: 20;

    padding: 8px 14px;

    border-radius: 999px;

    background: rgba(15, 18, 25, 0.85);

    border: 1px solid
        rgba(255, 255, 255, 0.12);

    color: #ffffff;

    font-size: 0.8rem;

    font-weight: 800;

    letter-spacing: 0.04em;

    backdrop-filter: blur(10px);
}

@media (max-width: 760px) {

    .viewer-counter {
        top: 16px;

        font-size: 0.75rem;

        padding: 7px 12px;
    }
}

/* ==========================================
   DOWNLOAD BUTTON
========================================== */




.download-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-width: 130px;

    padding: 11px 18px;

    border: 1px solid
        rgba(255, 255, 255, 0.18);

    border-radius: 12px;

    background: rgba(255, 255, 255, 0.10);

    color: #ffffff;

    text-decoration: none;

    font-size: 0.88rem;
    font-weight: 700;

    backdrop-filter: blur(12px);

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        border-color 0.2s ease;
}


.download-button:hover {
    background: rgba(255, 255, 255, 0.18);

    border-color:
        rgba(255, 255, 255, 0.30);

    transform: translateY(-2px);
}


.download-button:active {
    transform: translateY(0);
}


.download-icon {
    font-size: 1.15rem;

    line-height: 1;
}


/* ==========================================
   RESPONSIVE
========================================== */

@media (min-width: 1700px) {

    .gallery {
        grid-template-columns:
            repeat(5, minmax(0, 1fr));
    }
}


@media (max-width: 1100px) {

    .gallery {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {

    .recent-card {

        flex: 0 0 220px;

        height: 300px;

    }

}


@media (max-width: 760px) {

    .hero {
        padding-top: 60px;
    }

    .gallery {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 12px;
    }

    .gallery-controls {
        align-items: stretch;
    }

    .search-box {
        flex-basis: 100%;
    }

    .filter-group {
        width: 100%;
    }

    .filter-button {
        flex: 1;
    }

    .result-count {
        width: 100%;
    }
}


@media (max-width: 480px) {

    .header-inner,
    .hero,
    .gallery-controls,
    .gallery {
        width: min(100% - 24px, 1400px);
    }


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


    .hero h1 {
        font-size: 2.8rem;
    }


    .viewer {
        padding: 20px;
    }


    .viewer-prev {
        left: 10px;
    }


    .viewer-next {
        right: 10px;
    }


    


    .download-button {
        min-width: 120px;

        padding: 10px 15px;

        font-size: 0.82rem;
    }


    .viewer-caption {
        bottom: 20px;

        font-size: 0.78rem;

        max-width: 65%;
    }

    .recent-section {

    width: min(
        100% - 24px,
        1400px
    );

}

.recent-card {

    flex: 0 0 180px;

    height: 250px;

}

.recent-title {

    font-size: 1.4rem;

}

}



/* ==========================================
   LOADING SKELETONS
========================================== */

.skeleton-card {
    position: relative;
    overflow: hidden;
    min-height: 320px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.skeleton-card::after {
    content: "";
    position: absolute;
    inset: 0;

    transform: translateX(-100%);

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );

    animation:
        skeleton-loading
        1.5s infinite;
}

.skeleton-media {
    width: 100%;
    height: 220px;
    background: rgba(
        128,
        128,
        128,
        0.15
    );
}

.skeleton-content {
    padding: 16px;
}

.skeleton-line {
    height: 12px;
    margin-bottom: 10px;
    border-radius: 999px;
    background: rgba(
        128,
        128,
        128,
        0.15
    );
}

.skeleton-line.short {
    width: 55%;
}

.skeleton-line.medium {
    width: 75%;
}

.skeleton-line.long {
    width: 90%;
}

@keyframes skeleton-loading {

    100% {
        transform: translateX(100%);
    }

}


/* ==========================================
   INFINITE SCROLL LOADER
========================================== */

.gallery-loader {
    width: 100%;

    display: none;

    align-items: center;
    justify-content: center;

    gap: 12px;

    padding: 30px 20px;

    color: var(--text-muted);

    font-size: 0.9rem;
}

.gallery-loader.active {
    display: flex;
}

.gallery-loader-spinner {
    width: 22px;
    height: 22px;

    border: 3px solid
        rgba(128, 128, 128, 0.25);

    border-top-color:
        var(--text);

    border-radius: 50%;

    animation:
        gallery-loader-spin
        0.8s linear infinite;
}

@keyframes gallery-loader-spin {

    to {
        transform: rotate(360deg);
    }

}


/* ==========================================
   TOAST NOTIFICATION
========================================== */

.toast {
    position: fixed;

    right: 24px;
    bottom: 24px;

    z-index: 10000;

    display: flex;
    align-items: center;

    gap: 12px;

    min-width: 280px;
    max-width: 420px;

    padding: 14px 16px;

    border: 1px solid var(--border);

    border-radius: 14px;

    background: var(--surface);

    color: var(--text);

    box-shadow:
        0 16px 40px
        rgba(0, 0, 0, 0.20);

    opacity: 0;

    transform:
        translateY(20px);

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.toast.show {

    opacity: 1;

    transform:
        translateY(0);

    pointer-events: auto;

}

.toast-icon {

    width: 28px;
    height: 28px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border-radius: 50%;

    background: #22c55e;

    color: #ffffff;

    font-size: 0.85rem;
    font-weight: 800;

}

.toast-message {

    flex: 1;

    line-height: 1.4;

    font-size: 0.9rem;

}

.toast-close {

    width: 28px;
    height: 28px;

    display: grid;
    place-items: center;

    border: 0;

    border-radius: 50%;

    background: transparent;

    color: var(--text-muted);

    font-size: 1.2rem;

    cursor: pointer;

}

.toast-close:hover {

    background:
        rgba(
            128,
            128,
            128,
            0.12
        );

    color: var(--text);

}


/* ------------------------------------------
   TOAST MOBILE
------------------------------------------ */

@media (max-width: 480px) {

    .toast {

        left: 16px;
        right: 16px;
        bottom: 16px;

        min-width: 0;
        max-width: none;

    }

}



/* ==========================================
   MORE MENU BACKDROP
========================================== */

.more-menu-backdrop {
    position: fixed;

    inset: 0;

    z-index: 150;

    background:
        rgba(0, 0, 0, 0.45);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}


/* ==========================================
   MOBILE BACKDROP
========================================== */

@media (max-width: 600px) {

    .more-menu-backdrop {

        display: block;

    }

    .more-menu-backdrop.open {

        opacity: 1;

        visibility: visible;

        pointer-events: auto;

    }

    .more-menu {

        z-index: 200;

    }

}


/* ==========================================
   UPGRADE 3.3
   GALLERY CARD MICRO-INTERACTIONS
========================================== */

.gallery .media-card {
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease,
        border-color 0.28s ease;
    will-change: transform;
}


/* ==========================================
   CARD HOVER
========================================== */

@media (hover: hover) and (pointer: fine) {

    .gallery .media-card:hover {
        transform: translateY(-6px);
        box-shadow:
            0 18px 40px rgba(0, 0, 0, 0.18);
    }

}


/* ==========================================
   MEDIA ZOOM
========================================== */

.gallery .media-card img,
.gallery .media-card video {
    transition:
        transform 0.45s ease,
        filter 0.3s ease;
    transform: scale(1);
    will-change: transform;
}


@media (hover: hover) and (pointer: fine) {

    .gallery .media-card:hover img,
    .gallery .media-card:hover video {
        transform: scale(1.045);
    }

}


/* ==========================================
   MEDIA OVERLAY
========================================== */

.gallery .media-card::after {
    content: "";
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0) 55%,
            rgba(0,0,0,0.08) 100%
        );

    opacity: 0;
    pointer-events: none;

    transition:
        opacity 0.3s ease;
}


@media (hover: hover) and (pointer: fine) {

    .gallery .media-card:hover::after {
        opacity: 1;
    }

}


/* ==========================================
   CARD CONTENT
========================================== */

.gallery .media-card .card-content {
    transition:
        transform 0.28s ease;
}


@media (hover: hover) and (pointer: fine) {

    .gallery .media-card:hover .card-content {
        transform: translateY(-2px);
    }

}


/* ==========================================
   MEDIA TYPE BADGE
========================================== */

.gallery .media-card .media-type-badge {
    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}


@media (hover: hover) and (pointer: fine) {

    .gallery .media-card:hover .media-type-badge {
        transform: translateY(-2px);
    }

}


/* ==========================================
   ACCESSIBILITY
========================================== */

@media (prefers-reduced-motion: reduce) {

    .gallery .media-card,
    .gallery .media-card img,
    .gallery .media-card video,
    .gallery .media-card::after,
    .gallery .media-card .card-content,
    .gallery .media-card .media-type-badge {
        transition: none !important;
    }

    .gallery .media-card:hover {
        transform: none;
    }

    .gallery .media-card:hover img,
    .gallery .media-card:hover video {
        transform: none;
    }

}


/* ==========================================
   UPGRADE 3.4
   CARD QUICK ACTIONS
========================================== */

.card-quick-actions {
    position: absolute;
    top: 12px;
    right: 12px;

    display: flex;
    gap: 7px;

    z-index: 10;

    opacity: 0;
    transform: translateY(-6px);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}


/* Desktop hover */

@media (hover: hover) and (pointer: fine) {

    .media-card:hover .card-quick-actions {
        opacity: 1;
        transform: translateY(0);
    }

}


/* Buttons */

.card-quick-action {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid
        rgba(255, 255, 255, 0.15);

    border-radius: 10px;

    background:
        rgba(17, 20, 27, 0.88);

    color: #ffffff;

    font-size: 15px;

    cursor: pointer;

    backdrop-filter: blur(8px);

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}


/* Button hover */

@media (hover: hover) and (pointer: fine) {

    .card-quick-action:hover {
        transform: translateY(-2px);

        background:
            rgba(35, 39, 50, 0.95);

        border-color:
            rgba(255, 255, 255, 0.28);
    }

}


/* Keyboard focus */

.card-quick-action:focus-visible {
    outline: 2px solid
        currentColor;

    outline-offset: 2px;
}


/* Mobile */

@media (max-width: 600px) {

    .card-quick-actions {

        opacity: 1;

        transform: translateY(0);

        top: 10px;
        right: 10px;

        gap: 6px;

    }

    .card-quick-action {

        width: 34px;
        height: 34px;

        font-size: 14px;

    }

}


/* Reduced motion */

@media (prefers-reduced-motion: reduce) {

    .card-quick-actions,
    .card-quick-action {

        transition: none !important;

    }

}


/* ==========================================
   UPGRADE 3.5
   SEARCH CLEAR BUTTON
========================================== */

.search-wrapper {
    position: relative;
    width: 100%;
}


.search-wrapper #searchInput {
    width: 100%;
    padding-right: 46px;
}


.clear-search-btn {
    position: absolute;

    top: 50%;
    right: 12px;

    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    transform: translateY(-50%);

    border: 0;
    border-radius: 50%;

    background: transparent;

    color: var(--text-muted);

    font-size: 22px;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}


.clear-search-btn:hover {
    background:
        rgba(128, 128, 128, 0.14);

    color: var(--text);

    transform:
        translateY(-50%) scale(1.08);
}


.clear-search-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}


@media (prefers-reduced-motion: reduce) {

    .clear-search-btn {
        transition: none;
    }

}

/* ==========================================
   UPGRADE 3.5
   LIGHT THEME SEARCH VISIBILITY FIX
========================================== */

body.light-theme .search-wrapper #searchInput {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}

body.light-theme .search-wrapper #searchInput::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

body.light-theme .clear-search-btn {
    color: var(--text-muted);
}

body.light-theme .clear-search-btn:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.08);
}

/* ==========================================
   UPGRADE 3.6
   SORT CONTROL
========================================== */

.sort-group {
    display: flex;
    align-items: center;
    gap: 8px;
}


.sort-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}


.sort-select {
    min-height: 40px;

    padding: 8px 34px 8px 12px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface);
    color: var(--text);

    font: inherit;
    font-size: 0.85rem;

    cursor: pointer;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


.sort-select:hover {
    border-color: var(--text-muted);
}


.sort-select:focus {
    border-color: var(--text);
    box-shadow:
        0 0 0 3px rgba(128, 128, 128, 0.15);
}


/* ==========================================
   LIGHT THEME
========================================== */

body.light-theme .sort-label {
    color: var(--text-muted);
}


body.light-theme .sort-select {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 600px) {

    .sort-group {
        width: 100%;
        justify-content: space-between;
    }

    .sort-select {
        flex: 1;
        max-width: 220px;
    }

}


@media (max-width: 420px) {

    .sort-group {
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
    }

    .sort-select {
        width: 100%;
        max-width: none;
    }

}


/* ==========================================
   REDUCED MOTION
========================================== */

@media (prefers-reduced-motion: reduce) {

    .sort-select {
        transition: none;
    }

}

/* ==========================================
   MEDIA DETAILS PANEL
========================================== */

.media-details-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background: rgba(0, 0, 0, 0.68);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.media-details-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* PANEL */

.media-details-panel {
    position: relative;

    width: min(680px, 100%);
    max-height: min(850px, 92vh);

    overflow: hidden auto;

    border: 1px solid var(--border);
    border-radius: 20px;

    background: var(--surface);
    color: var(--text);

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.35);

    transform: translateY(20px) scale(0.97);

    transition:
        transform 0.28s ease;
}

.media-details-overlay.open
.media-details-panel {
    transform:
        translateY(0)
        scale(1);
}


/* CLOSE BUTTON */

.media-details-close {
    position: absolute;

    top: 14px;
    right: 14px;

    z-index: 5;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid
        rgba(255, 255, 255, 0.16);

    border-radius: 50%;

    background:
        rgba(15, 17, 23, 0.82);

    color: #ffffff;

    font-size: 25px;
    line-height: 1;

    cursor: pointer;

    backdrop-filter: blur(10px);

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.media-details-close:hover {
    transform: scale(1.08);

    background:
        rgba(35, 39, 50, 0.96);

    border-color:
        rgba(255, 255, 255, 0.28);
}

.media-details-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}


/* PREVIEW */

.media-details-preview {
    width: 100%;

    min-height: 220px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    background:
        rgba(0, 0, 0, 0.16);
}

.media-details-preview img,
.media-details-preview video {
    display: block;

    width: 100%;
    max-height: 390px;

    object-fit: contain;
}

.media-details-preview video {
    background: #000000;
}


/* CONTENT */

.media-details-content {
    padding: 28px;
}

.media-details-label {
    margin-bottom: 7px;

    font-size: 0.72rem;
    font-weight: 700;

    letter-spacing: 0.14em;

    color: var(--text-muted);
}

.media-details-title {
    margin: 0 0 24px;

    padding-right: 48px;

    font-size: clamp(
        1.25rem,
        3vw,
        1.65rem
    );

    line-height: 1.25;

    color: var(--text);

    overflow-wrap: anywhere;
}


/* DETAIL LIST */

.media-details-list {
    display: flex;
    flex-direction: column;

    border: 1px solid var(--border);
    border-radius: 14px;

    overflow: hidden;

    background:
        rgba(128, 128, 128, 0.035);
}

.media-detail-row {
    display: grid;

    grid-template-columns:
        minmax(100px, 0.4fr)
        minmax(0, 1fr);

    gap: 20px;

    padding: 15px 17px;

    border-bottom: 1px solid var(--border);
}

.media-detail-row:last-child {
    border-bottom: 0;
}

.media-detail-label {
    font-size: 0.82rem;
    font-weight: 600;

    color: var(--text-muted);
}

.media-detail-value {
    min-width: 0;

    font-size: 0.88rem;

    color: var(--text);

    overflow-wrap: anywhere;
    word-break: break-word;
}


/* LIGHT THEME */

body.light-theme
.media-details-overlay {
    background:
        rgba(0, 0, 0, 0.48);
}

body.light-theme
.media-details-panel {
    background: var(--surface);
    color: var(--text);

    border-color: var(--border);

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.22);
}

body.light-theme
.media-details-list {
    background:
        rgba(0, 0, 0, 0.025);

    border-color: var(--border);
}

body.light-theme
.media-details-close {
    background:
        rgba(30, 32, 38, 0.9);

    color: #ffffff;
}


/* MOBILE */

@media (max-width: 600px) {

    .media-details-overlay {
        align-items: flex-end;

        padding: 0;
    }

    .media-details-panel {
        width: 100%;

        max-height: 94vh;

        border-radius:
            22px 22px 0 0;

        transform:
            translateY(30px);
    }

    .media-details-overlay.open
    .media-details-panel {
        transform:
            translateY(0);
    }

    .media-details-preview {
        min-height: 190px;
    }

    .media-details-preview img,
    .media-details-preview video {
        max-height: 300px;
    }

    .media-details-content {
        padding: 22px 18px 26px;
    }

    .media-details-title {
        margin-bottom: 20px;
    }

    .media-detail-row {
        grid-template-columns:
            1fr;

        gap: 5px;

        padding: 13px 14px;
    }

}


/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {

    .media-details-overlay,
    .media-details-panel,
    .media-details-close {
        transition: none !important;
    }

}

/* ==========================================
   FULL MEDIA DETAIL VIEWER
========================================== */

.viewer-detail-page {
    min-height: 100vh;
    width: 100%;

    overflow-y: auto;

    background: #0d0f14;
    color: #ffffff;
}


/* ==========================================
   VIEWER TOP BAR
========================================== */

.viewer-topbar {
    position: sticky;
    top: 0;

    z-index: 20;

    min-height: 68px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    padding: 12px 24px;

    background:
        rgba(13, 15, 20, 0.92);

    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);

    backdrop-filter: blur(14px);
}


.viewer-topbar-left,
.viewer-topbar-actions {
    display: flex;
    align-items: center;

    gap: 12px;
}


.viewer-media-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 30px;

    padding: 5px 11px;

    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.09);

    border:
        1px solid rgba(255, 255, 255, 0.12);

    color: rgba(255, 255, 255, 0.82);

    font-size: 0.7rem;
    font-weight: 700;

    letter-spacing: 0.1em;
}


.viewer-counter {
    color:
        rgba(255, 255, 255, 0.58);

    font-size: 0.82rem;
    font-weight: 600;
}


/* ==========================================
   TOP ACTIONS
========================================== */

.viewer-action-button {
    min-height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 8px 14px;

    border:
        1px solid rgba(255, 255, 255, 0.12);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.07);

    color: #ffffff;

    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        border-color 0.2s ease;
}


.viewer-action-button:hover {
    background:
        rgba(255, 255, 255, 0.13);

    border-color:
        rgba(255, 255, 255, 0.22);

    transform:
        translateY(-1px);
}


.viewer-close {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border:
        1px solid rgba(255, 255, 255, 0.13);

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.07);

    color: #ffffff;

    font-size: 27px;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.viewer-close:hover {
    background:
        rgba(255, 255, 255, 0.15);

    transform:
        scale(1.06);
}


.viewer-close:focus-visible,
.viewer-action-button:focus-visible {
    outline:
        2px solid currentColor;

    outline-offset: 3px;
}


/* ==========================================
   MAIN MEDIA
========================================== */

.viewer-main {
    width: 100%;
}


.viewer-media-section {
    width: 100%;

    padding:
        30px 24px 10px;
}


.viewer-media-stage {
    width: min(1200px, 100%);
    min-height: 480px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    border-radius: 18px;

    background:
        #050608;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.35);
}


.viewer-media-stage img,
.viewer-media-stage video {
    display: block;

    width: 100%;
    height: auto;

    max-height: 720px;

    object-fit: contain;
}


.viewer-media-stage video {
    background: #000000;
}


/* ==========================================
   INFORMATION AREA
========================================== */

.viewer-information {
    width: min(1100px, 100%);

    margin: 0 auto;

    padding:
        36px 24px 70px;
}


.viewer-information-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 30px;

    padding-bottom: 28px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);
}


.viewer-media-type {
    margin-bottom: 8px;

    color:
        rgba(255, 255, 255, 0.48);

    font-size: 0.72rem;
    font-weight: 700;

    letter-spacing: 0.13em;
}


.viewer-title {
    margin: 0;

    color: #ffffff;

    font-size:
        clamp(1.6rem, 4vw, 2.5rem);

    line-height: 1.15;

    overflow-wrap: anywhere;
}


.viewer-view-count {
    flex-shrink: 0;

    padding-top: 26px;

    color:
        rgba(255, 255, 255, 0.55);

    font-size: 0.85rem;
    font-weight: 600;
}


/* ==========================================
   DESCRIPTION
========================================== */

.viewer-description-section {
    padding:
        30px 0;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);
}


.viewer-description-section h2,
.viewer-metadata-section h2 {
    margin:
        0 0 13px;

    color: #ffffff;

    font-size: 1.05rem;
}


.viewer-description-section p {
    max-width: 850px;

    margin: 0;

    color:
        rgba(255, 255, 255, 0.63);

    font-size: 0.94rem;

    line-height: 1.75;
}


/* ==========================================
   METADATA
========================================== */

.viewer-metadata-section {
    padding:
        30px 0;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);
}


.viewer-metadata-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 1px;

    overflow: hidden;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    border-radius: 14px;

    background:
        rgba(255, 255, 255, 0.08);
}


.viewer-metadata-item {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 7px;

    padding: 17px;

    background:
        #11141a;
}


.viewer-metadata-label {
    color:
        rgba(255, 255, 255, 0.42);

    font-size: 0.72rem;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.07em;
}


.viewer-metadata-value {
    min-width: 0;

    color:
        rgba(255, 255, 255, 0.86);

    font-size: 0.88rem;

    overflow-wrap: anywhere;
    word-break: break-word;
}


/* ==========================================
   ACTIONS
========================================== */

.viewer-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    padding:
        28px 0;
}


.viewer-secondary-action {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 9px 15px;

    border:
        1px solid rgba(255, 255, 255, 0.12);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.06);

    color: rgba(255, 255, 255, 0.86);

    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.viewer-secondary-action:hover {
    background:
        rgba(255, 255, 255, 0.11);

    border-color:
        rgba(255, 255, 255, 0.22);

    transform:
        translateY(-1px);
}


/* ==========================================
   SECTION HEADINGS
========================================== */

.viewer-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}


.viewer-section-label {
    display: block;

    margin-bottom: 5px;

    color:
        rgba(255, 255, 255, 0.38);

    font-size: 0.68rem;
    font-weight: 700;

    letter-spacing: 0.14em;
}


.viewer-section-heading h2 {
    margin: 0;

    color: #ffffff;

    font-size: 1.25rem;
}


/* ==========================================
   RELATED MEDIA
========================================== */

.viewer-related-section {
    padding-top: 12px;
}


.viewer-related-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;
}


.viewer-related-card {
    min-width: 0;

    padding: 0;

    overflow: hidden;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    border-radius: 13px;

    background:
        #11141a;

    color: #ffffff;

    text-align: left;

    cursor: pointer;

    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}


.viewer-related-card:hover {
    transform:
        translateY(-4px);

    border-color:
        rgba(255, 255, 255, 0.2);

    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.25);
}


.viewer-related-card:focus-visible {
    outline:
        2px solid currentColor;

    outline-offset: 3px;
}


.viewer-related-preview {
    position: relative;

    aspect-ratio: 16 / 10;

    overflow: hidden;

    background:
        #050608;
}


.viewer-related-preview img,
.viewer-related-preview video {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition:
        transform 0.3s ease;
}


.viewer-related-card:hover
.viewer-related-preview img,
.viewer-related-card:hover
.viewer-related-preview video {
    transform:
        scale(1.045);
}


.viewer-related-play {
    position: absolute;

    left: 50%;
    top: 50%;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    transform:
        translate(-50%, -50%);

    border-radius: 50%;

    background:
        rgba(0, 0, 0, 0.68);

    color: #ffffff;

    font-size: 13px;
}


.viewer-related-info {
    display: flex;
    flex-direction: column;

    gap: 5px;

    padding: 12px;
}


.viewer-related-title {
    color:
        rgba(255, 255, 255, 0.9);

    font-size: 0.82rem;
    font-weight: 600;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.viewer-related-type {
    color:
        rgba(255, 255, 255, 0.4);

    font-size: 0.7rem;
}


/* ==========================================
   MORE CONTENT
========================================== */

.viewer-more-section {
    width: min(1100px, 100%);

    margin: 0 auto;

    padding:
        35px 24px 80px;

    border-top:
        1px solid rgba(255, 255, 255, 0.08);
}


.viewer-scroll {
    width: 100%;
}


.viewer-list {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;
}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 800px) {

    .viewer-topbar {
        padding:
            10px 16px;
    }


    .viewer-media-section {
        padding:
            16px 14px 5px;
    }


    .viewer-media-stage {
        min-height: 330px;

        border-radius: 14px;
    }


    .viewer-information {
        padding:
            28px 18px 55px;
    }


    .viewer-information-header {
        flex-direction: column;

        gap: 12px;
    }


    .viewer-view-count {
        padding-top: 0;
    }


    .viewer-metadata-grid {
        grid-template-columns:
            1fr;
    }


    .viewer-related-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


    .viewer-more-section {
        padding:
            30px 18px 60px;
    }


    .viewer-list {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 520px) {

    .viewer-topbar {
        min-height: 60px;
    }


    .viewer-counter {
        display: none;
    }


    .viewer-action-button span {
        display: none;
    }


    .viewer-action-button {
        width: 40px;
        padding: 8px;
    }


    .viewer-close {
        width: 40px;
        height: 40px;
    }


    .viewer-media-stage {
        min-height: 250px;
    }


    .viewer-title {
        font-size: 1.5rem;
    }


    .viewer-related-grid {
        grid-template-columns:
            1fr 1fr;
    }


    .viewer-list {
        grid-template-columns:
            1fr;
    }


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


    .viewer-secondary-action {
        width: 100%;
    }

}


/* ==========================================
   REDUCED MOTION
========================================== */

@media (prefers-reduced-motion: reduce) {

    .viewer-action-button,
    .viewer-close,
    .viewer-secondary-action,
    .viewer-related-card,
    .viewer-related-preview img,
    .viewer-related-preview video {
        transition: none !important;
    }

}


/* ==========================================
   VIEWER SCROLL FIX
========================================== */

.viewer {
    overflow-y: auto;
    overflow-x: hidden;
}

.viewer-detail-page {
    height: auto;
    min-height: 100vh;
    overflow: visible;
}

.viewer-main {
    height: auto;
    overflow: visible;
}

.viewer-scroll {
    height: auto;
    max-height: none;
    overflow: visible;
}

.viewer-list {
    overflow: visible;
}


/* ==========================================
   VIEWER MEDIA CARD SIZE FIX
========================================== */

.viewer-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.viewer-list > * {
    min-width: 0;
    width: 100%;
}

.viewer-list img,
.viewer-list video {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.viewer-related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.viewer-related-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.viewer-related-preview {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.viewer-related-preview img,
.viewer-related-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.viewer-related-info {
    min-height: 72px;
}

/* ==========================================
   MEDIA DETAIL PAGE - FINAL LAYOUT FIX
========================================== */

/* The viewer itself is the page scroll container */
.viewer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999;
    background: #0d0f14;
}

/* The actual detail page must flow normally */
.viewer-detail-page {
    position: relative;
    width: 100%;
    min-height: 100%;
    height: auto;
    overflow: visible;
    display: block;
}

/* Top bar stays above the content */
.viewer-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

/* Main content must be normal vertical flow */
.viewer-main {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
    display: block;
}

/* ==========================================
   MAIN MEDIA
========================================== */

.viewer-media-section {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
    display: block;
}

.viewer-media-stage {
    position: relative;
    width: 100%;
    min-height: 500px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

/* Selected image/video */
.viewer-media-stage img,
.viewer-media-stage video {
    position: relative;
    display: block;
    width: 100%;
    max-width: 1400px;
    height: auto;
    max-height: 75vh;
    object-fit: contain;
    margin: 0 auto;
}

/* Videos should be immediately playable */
.viewer-media-stage video {
    background: #000;
}

/* ==========================================
   INFORMATION BELOW MEDIA
========================================== */

.viewer-information {
    position: relative;
    width: 100%;
    height: auto;
    overflow: visible;
    display: block;
}

/* ==========================================
   RELATED MEDIA
========================================== */

.viewer-related-section {
    position: relative;
    width: 100%;
    height: auto;
    overflow: visible;
    display: block;
}

.viewer-related-grid {
    position: relative;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    overflow: visible;
}

/* ==========================================
   BROWSE OTHER MEDIA
========================================== */

.viewer-more-section {
    position: relative;
    width: 100%;
    height: auto;
    overflow: visible;
    display: block;
}

.viewer-scroll {
    position: relative;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
}

.viewer-list {
    position: relative;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    overflow: visible;
}

/* ==========================================
   PREVENT OLD ABSOLUTE/FIXED MEDIA RULES
========================================== */

.viewer-media-stage > img,
.viewer-media-stage > video {
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
}

/* Related cards stay inside their own grid cells */
.viewer-related-card {
    position: relative;
    width: 100%;
    min-width: 0;
    height: auto;
    overflow: hidden;
}

/* Browse cards stay inside their own grid cells */
.viewer-list > * {
    position: relative;
    width: 100%;
    min-width: 0;
    height: auto;
    overflow: hidden;
}

/* ==========================================
   MOBILE
========================================== */

@media (max-width: 768px) {

    .viewer-media-stage {
        min-height: 300px;
    }

    .viewer-media-stage img,
    .viewer-media-stage video {
        max-height: 60vh;
    }

    .viewer-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .viewer-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {

    .viewer-related-grid,
    .viewer-list {
        grid-template-columns: 1fr;
    }

    .viewer-media-stage {
        min-height: 240px;
    }
}

/* ==========================================
   VIEWER TOP BAR - DO NOT OVERLAP CONTENT
========================================== */

.viewer-topbar {
    position: fixed !important;

    top: 0 !important;
    left: 0 !important;
    right: 0 !important;

    width: 100% !important;

    box-sizing: border-box;

    min-height: 68px;

    display: flex !important;
    align-items: center;
    justify-content: space-between;

    padding: 12px 24px;

    z-index: 100 !important;

    background: rgba(13, 15, 20, 0.96);

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.08);

    backdrop-filter: blur(14px);
}

.viewer-main {
    position: relative;
    z-index: 1;
}

.viewer-media-section,
.viewer-information,
.viewer-related-section,
.viewer-more-section {
    position: relative;
    z-index: 1;
}


/* ==========================================
   SELECTED MEDIA - LARGE HERO DISPLAY
========================================== */

.viewer-media-stage {
    width: 100%;
    min-height: 0;
    padding: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-main-video,
.viewer-main-image {
    display: block;
    width: 100%;
    margin: 0 auto;
    background: #000;
    
}

.viewer-main-video {
    width: 100%;
    max-width: 1400px;
    height: auto;
    max-height: 78vh;
    object-fit: contain;
}

.viewer-main-image {
    width: 100%;
    max-width: 1400px;
    max-height: 78vh;
    height: auto;
    object-fit: contain;
}


/* ==========================================
   BROWSE OTHER MEDIA - CARD LAYOUT
========================================== */

.viewer-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

.viewer-item {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
    background: #151820;
    border-radius: 12px;
}

.viewer-item-preview {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #000;
}

.viewer-item-preview .viewer-media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.viewer-item-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 18px;
    pointer-events: none;
}

.viewer-item-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
}

.viewer-item-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewer-item-type {
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.65;
}

.viewer-download {
    flex-shrink: 0;
    text-decoration: none;
}

@media (max-width: 900px) {

    .viewer-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {

    .viewer-list {
        grid-template-columns: 1fr;
    }

    .viewer-item-preview {
        height: 200px;
    }
}



/* ==========================================
   LIGHT THEME VISIBILITY FIX
========================================== */

body.light-theme {

    background: #f5f7fa;
    color: #111827;

}


/* ------------------------------------------
   HEADER
------------------------------------------ */

body.light-theme .site-header {

    background: rgba(
        255,
        255,
        255,
        0.95
    );

    border-bottom: 1px solid #dfe3e8;

}


/* ------------------------------------------
   GENERAL TEXT
------------------------------------------ */

body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme p {

    color: #111827;

}


/* ------------------------------------------
   MUTED TEXT
------------------------------------------ */

body.light-theme .hero-label,
body.light-theme .recent-label,
body.light-theme .trending-label,
body.light-theme .header-count,
body.light-theme .recent-count,
body.light-theme .trending-count,
body.light-theme .result-count {

    color: #5f6978;

}


/* ------------------------------------------
   LOGO
------------------------------------------ */

body.light-theme .logo {

    color: #111827;

}


/* ------------------------------------------
   SEARCH
------------------------------------------ */

body.light-theme .search-box {

    background: #ffffff;
    border-color: #dfe3e8;

}

body.light-theme .search-box input {

    color: #111827;

}

body.light-theme .search-box input::placeholder {

    color: #7a8492;

}


/* ------------------------------------------
   FILTER BUTTONS
------------------------------------------ */

body.light-theme .filter-button {

    background: #ffffff;
    color: #374151;
    border-color: #dfe3e8;

}

body.light-theme .filter-button:hover {

    background: #eef1f5;
    color: #111827;

}


/* ------------------------------------------
   MEDIA CARDS
------------------------------------------ */

body.light-theme .media-card {

    background: #ffffff;
    border-color: #dfe3e8;

}

body.light-theme .media-card h3,
body.light-theme .media-card .media-title {

    color: #111827;

}


/* ------------------------------------------
   RECENTLY ADDED
------------------------------------------ */

body.light-theme .recent-card {

    background: #ffffff;
    border-color: #dfe3e8;

}

body.light-theme .recent-title,
body.light-theme .recent-name {

    color: #111827;

}


/* ------------------------------------------
   TRENDING
------------------------------------------ */

body.light-theme .trending-card {

    background: #ffffff;
    border-color: #dfe3e8;

}

body.light-theme .trending-title,
body.light-theme .trending-name {

    color: #111827;

}

body.light-theme .trending-type {

    color: #5f6978;

}


/* ------------------------------------------
   MORE MENU
------------------------------------------ */

body.light-theme .more-menu {

    background: #ffffff;
    border-color: #dfe3e8;

    box-shadow:
        0 12px 30px
        rgba(0, 0, 0, 0.12);

}

body.light-theme .more-menu-button {

    background: #ffffff;
    color: #111827;
    border-color: #dfe3e8;

}

body.light-theme .more-menu-item {

    color: #111827;

}

body.light-theme .more-menu-item:hover {

    background: #f1f3f6;

}


/* ------------------------------------------
   EMPTY STATE
------------------------------------------ */

body.light-theme .empty-state h2 {

    color: #111827;

}

body.light-theme .empty-state p {

    color: #5f6978;

}


/* ==========================================
   MOVIEBOX-STYLE MEDIA DETAIL VIEWER
   FINAL OVERRIDE
========================================== */

/* ------------------------------------------
   VIEWER CONTAINER
------------------------------------------ */

.viewer {
    position: fixed !important;
    inset: 0 !important;

    width: 100% !important;
    height: 100vh !important;

    display: none !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    padding: 0 !important;

    z-index: 9999 !important;

    background: #0d0f14 !important;

    backdrop-filter: none !important;
}

.viewer.open {
    display: block !important;
}


/* ------------------------------------------
   DETAIL PAGE
------------------------------------------ */

.viewer-detail-page {
    position: relative !important;

    width: 100% !important;
    min-height: 100vh !important;
    height: auto !important;

    display: block !important;

    overflow: visible !important;

    background: #0d0f14 !important;
    color: #ffffff !important;
}


/* ------------------------------------------
   TOP BAR
------------------------------------------ */

.viewer-topbar {
    position: relative !important;

    top: auto !important;
    left: auto !important;
    right: auto !important;

    width: 100% !important;

    min-height: 68px;

    display: flex !important;
    align-items: center;
    justify-content: space-between;

    padding: 12px 24px;

    z-index: 100 !important;

    background:
        rgba(13, 15, 20, 0.96);

    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);

    backdrop-filter: blur(14px);
}


/* ------------------------------------------
   REMOVE OLD FIXED COUNTER BEHAVIOR
------------------------------------------ */

.viewer-counter {
    position: static !important;

    top: auto !important;
    left: auto !important;

    transform: none !important;

    padding: 0 !important;

    border: 0 !important;

    background: transparent !important;

    backdrop-filter: none !important;

    color:
        rgba(255, 255, 255, 0.55) !important;
}


/* ------------------------------------------
   CLOSE BUTTON
------------------------------------------ */

.viewer-topbar .viewer-close {
    position: relative !important;

    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;

    width: 42px !important;
    height: 42px !important;

    flex-shrink: 0;

    display: flex !important;
    align-items: center;
    justify-content: center;

    padding: 0 !important;

    border:
        1px solid rgba(255, 255, 255, 0.13);

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.07);

    color: #ffffff;

    font-size: 27px;

    cursor: pointer;
}


/* ------------------------------------------
   MAIN CONTENT
------------------------------------------ */

.viewer-main {
    position: relative !important;

    width: 100% !important;

    height: auto !important;
    min-height: 0 !important;

    display: block !important;

    overflow: visible !important;
}


/* ------------------------------------------
   SELECTED MEDIA SECTION
------------------------------------------ */

.viewer-media-section {
    position: relative !important;

    width: 100% !important;

    height: auto !important;
    min-height: 0 !important;

    padding: 92px 24px 10px !important;

    overflow: visible !important;

    display: block !important;
}


/* ------------------------------------------
   MAIN MEDIA STAGE
------------------------------------------ */

.viewer-media-stage {
    position: relative !important;

    width: min(1400px, 100%) !important;

    min-height: 0 !important;
    height: auto !important;

    margin: 0 auto !important;
    padding: 0 !important;

    display: flex !important;

    align-items: center;
    justify-content: center;

    overflow: hidden !important;

    border-radius: 16px;

    background: #000000;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.35);
}


/* ------------------------------------------
   ONLY THE SELECTED MEDIA IS LARGE
------------------------------------------ */

.viewer-media-stage > video.viewer-main-video,
.viewer-media-stage > img.viewer-main-image {
    position: relative !important;

    display: block !important;

    width: 100% !important;

    max-width: 1400px !important;

    height: auto !important;

    max-height: 78vh !important;

    margin: 0 auto !important;

    object-fit: contain !important;

    background: #000000;

    transform: none !important;
}


/* ------------------------------------------
   INFORMATION
------------------------------------------ */

.viewer-information {
    position: relative !important;

    width: min(1100px, 100%) !important;

    height: auto !important;

    margin: 0 auto !important;

    padding: 34px 24px 70px !important;

    overflow: visible !important;

    display: block !important;
}


/* ------------------------------------------
   DESCRIPTION / METADATA
------------------------------------------ */

.viewer-description-section,
.viewer-metadata-section {
    position: relative;

    width: 100%;

    height: auto;

    overflow: visible;
}


/* ------------------------------------------
   RELATED MEDIA
------------------------------------------ */

.viewer-related-section {
    position: relative !important;

    width: 100% !important;

    height: auto !important;

    margin-top: 10px;

    overflow: visible !important;

    display: block !important;
}


.viewer-related-grid {
    position: relative !important;

    width: 100% !important;

    height: auto !important;

    display: grid !important;

    grid-template-columns:
        repeat(3, minmax(0, 1fr)) !important;

    gap: 16px !important;

    overflow: visible !important;
}


.viewer-related-card {
    position: relative !important;

    width: 100% !important;

    min-width: 0 !important;

    height: auto !important;

    padding: 0 !important;

    overflow: hidden !important;

    cursor: pointer;
}


/* ------------------------------------------
   RELATED PREVIEW
------------------------------------------ */

.viewer-related-preview {
    position: relative !important;

    width: 100% !important;

    height: 190px !important;

    aspect-ratio: auto !important;

    overflow: hidden !important;

    background: #000000;
}


.viewer-related-preview img,
.viewer-related-preview video {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    max-height: none !important;

    object-fit: cover !important;
}


/* ------------------------------------------
   BROWSE OTHER MEDIA
------------------------------------------ */

.viewer-more-section {
    position: relative !important;

    width: min(1100px, 100%) !important;

    height: auto !important;

    margin: 0 auto !important;

    padding: 35px 24px 80px !important;

    overflow: visible !important;

    display: block !important;
}


.viewer-scroll {
    position: relative !important;

    width: 100% !important;

    height: auto !important;

    max-height: none !important;

    overflow: visible !important;
}


.viewer-list {
    position: relative !important;

    width: 100% !important;

    height: auto !important;

    display: grid !important;

    grid-template-columns:
        repeat(4, minmax(0, 1fr)) !important;

    gap: 16px !important;

    overflow: visible !important;
}


/* ------------------------------------------
   BROWSE CARD
------------------------------------------ */

.viewer-item {
    position: relative !important;

    width: 100% !important;

    min-width: 0 !important;

    height: auto !important;

    padding: 0 !important;

    overflow: hidden !important;

    border-radius: 12px;

    background: #151820;

    cursor: pointer;
}


.viewer-item-preview {
    position: relative !important;

    width: 100% !important;

    height: 220px !important;

    overflow: hidden !important;

    background: #000000;
}


.viewer-item-preview .viewer-media {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    max-height: none !important;

    object-fit: cover !important;
}


/* ------------------------------------------
   BROWSE CARD INFORMATION
------------------------------------------ */

.viewer-item-info {
    width: 100% !important;

    min-height: 72px;

    display: flex !important;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding: 12px !important;

    margin: 0 !important;
}


.viewer-item-title {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


.viewer-item-type {
    margin-top: 4px;
}


/* ------------------------------------------
   BROWSE DOWNLOAD
------------------------------------------ */

.viewer-item .viewer-download {
    position: relative;

    flex-shrink: 0;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    padding: 8px 10px;

    border-radius: 8px;

    background:
        rgba(255, 255, 255, 0.08);

    color: #ffffff;

    text-decoration: none;
}


/* ------------------------------------------
   OLD VIEWER ELEMENTS
   Disable old progress system
------------------------------------------ */

.viewer-progress {
    display: none !important;
}


/* ------------------------------------------
   MOBILE
------------------------------------------ */

@media (max-width: 800px) {

    .viewer-topbar {
        padding:
            10px 16px;
    }

    .viewer-media-section {
        padding:
            16px 14px 8px !important;
    }

    .viewer-media-stage {
        border-radius: 12px;
    }

    .viewer-media-stage > video.viewer-main-video,
    .viewer-media-stage > img.viewer-main-image {
        max-height: 65vh !important;
    }

    .viewer-information {
        padding:
            28px 18px 55px !important;
    }

    .viewer-related-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }

    .viewer-more-section {
        padding:
            30px 18px 60px !important;
    }

    .viewer-list {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }

}


@media (max-width: 520px) {

    .viewer-topbar {
        min-height: 60px;
    }

    .viewer-media-badge {
        font-size: 0.65rem;
    }

    .viewer-counter {
        display: none !important;
    }

    .viewer-action-button span {
        display: none;
    }

    .viewer-action-button {
        width: 40px;
        padding: 8px;
    }

    .viewer-topbar .viewer-close {
        width: 40px !important;
        height: 40px !important;
    }

    .viewer-media-stage > video.viewer-main-video,
    .viewer-media-stage > img.viewer-main-image {
        max-height: 60vh !important;
    }

    .viewer-related-grid {
        grid-template-columns:
            1fr 1fr !important;
    }

    .viewer-list {
        grid-template-columns:
            1fr !important;
    }

    .viewer-item-preview {
        height: 200px !important;
    }

}


@media (max-width: 380px) {

    .viewer-related-grid {
        grid-template-columns: 1fr !important;
    }

}


/* ==========================================
   MOVIEBOX DETAIL PAGE
   HIDE OLD SLIDESHOW COUNTER
========================================== */

.viewer-counter {
    display: none !important;
}


/* ==========================================
   MOVIEBOX VIEWER
   BACK BUTTON
========================================== */

.viewer-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;

    padding: 8px 13px;

    border: 1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.06);

    color: #ffffff;

    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.viewer-back-button:hover {
    background:
        rgba(255, 255, 255, 0.11);

    border-color:
        rgba(255, 255, 255, 0.2);

    transform:
        translateX(-2px);
}

.viewer-back-button:active {
    transform:
        translateX(-1px);
}

.viewer-back-icon {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    font-size: 1.35rem;
    line-height: 1;

    font-weight: 400;
}

.viewer-back-text {
    line-height: 1;
}

.viewer-topbar-left {
    display: flex !important;
    align-items: center;

    gap: 14px;

    min-width: 0;
}

.viewer-topbar-actions {
    display: flex !important;
    align-items: center;

    gap: 10px;

    flex-shrink: 0;
}


@media (max-width: 520px) {

    .viewer-back-button {
        width: 42px;
        min-width: 42px;

        padding: 8px;
    }

    .viewer-back-text {
        display: none;
    }

    .viewer-topbar-left {
        gap: 9px;
    }

}

/* ==========================================
   FINAL MOVIEBOX TOP BAR
   ALWAYS VISIBLE WHILE SCROLLING
========================================== */

.viewer-topbar {
    position: fixed !important;

    top: 0 !important;
    left: 0 !important;
    right: 0 !important;

    width: 100% !important;

    min-height: 68px !important;

    box-sizing: border-box !important;

    z-index: 100000 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;

    padding: 12px 24px !important;

    background:
        rgba(13, 15, 20, 0.96) !important;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.08) !important;

    backdrop-filter:
        blur(14px) !important;

    -webkit-backdrop-filter:
        blur(14px) !important;
}


/* Keep viewer content below fixed top bar */

.viewer-media-section {
    padding-top: 92px !important;
}


/* Make sure Back button is always clickable */

.viewer-back-button {
    position: relative !important;

    z-index: 100001 !important;

    flex-shrink: 0 !important;
}


/* Keep right-side controls visible */

.viewer-topbar-actions {
    position: relative !important;

    z-index: 100001 !important;

    flex-shrink: 0 !important;
}

@media (max-width: 520px) {

    .viewer-topbar {
        min-height: 60px !important;

        padding:
            9px 12px !important;
    }

    .viewer-media-section {
        padding-top:
            76px !important;
    }

}

/* ==========================================
   MOVIEBOX HERO MEDIA
   FINAL VISUAL REFINEMENT
========================================== */

.viewer-media-section {
    width: 100% !important;

    padding:
        92px 24px 24px !important;

    box-sizing: border-box !important;
}

.viewer-media-stage {
    width:
        min(1450px, 100%) !important;

    min-height:
        0 !important;

    margin:
        0 auto !important;

    display:
        flex !important;

    align-items:
        center !important;

    justify-content:
        center !important;

    overflow:
        hidden !important;

    background:
        #000000 !important;

    border:
        1px solid
        rgba(255, 255, 255, 0.08) !important;

    border-radius:
        18px !important;

    box-shadow:
        0 30px 80px
        rgba(0, 0, 0, 0.45) !important;
}

.viewer-media-stage > video.viewer-main-video,
.viewer-media-stage > img.viewer-main-image {
    display:
        block !important;

    width:
        100% !important;

    max-width:
        1450px !important;

    height:
        auto !important;

    max-height:
        76vh !important;

    margin:
        0 auto !important;

    object-fit:
        contain !important;

    background:
        #000000 !important;

    transform:
        none !important;
}

/* VIDEO */

.viewer-media-stage > video.viewer-main-video {
    aspect-ratio:
        16 / 9;

    object-fit:
        contain !important;
}

/* IMAGE */

.viewer-media-stage > img.viewer-main-image {
    max-height:
        76vh !important;

    object-fit:
        contain !important;
}

/* ==========================================
   MOBILE HERO
========================================== */

@media (max-width: 800px) {

    .viewer-media-section {
        padding:
            76px 14px 18px !important;
    }

    .viewer-media-stage {
        border-radius:
            12px !important;
    }

    .viewer-media-stage > video.viewer-main-video,
    .viewer-media-stage > img.viewer-main-image {
        max-height:
            65vh !important;
    }
}

@media (max-width: 520px) {

    .viewer-media-section {
        padding:
            70px 10px 14px !important;
    }

    .viewer-media-stage {
        border-radius:
            10px !important;
    }

    .viewer-media-stage > video.viewer-main-video,
    .viewer-media-stage > img.viewer-main-image {
        max-height:
            58vh !important;
    }
}


/* ==========================================
   MOVIEBOX MEDIA INFORMATION
   TITLE + DESCRIPTION + METADATA
========================================== */

.viewer-information {
    width: min(1450px, 100%);
    margin: 0 auto;
    padding: 28px 24px 10px;

    box-sizing: border-box;
}


/* ------------------------------------------
   TITLE HEADER
------------------------------------------ */

.viewer-information-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 22px;
}

.viewer-information-header > div:first-child {
    min-width: 0;
}

.viewer-media-type {
    margin-bottom: 7px;

    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;

    color: rgba(255, 255, 255, 0.55);
}

.viewer-title {
    margin: 0;

    font-size: clamp(
        1.8rem,
        3vw,
        3rem
    );

    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.025em;

    color: #ffffff;

    overflow-wrap: anywhere;
}

.viewer-view-count {
    flex-shrink: 0;

    padding: 8px 12px;

    border: 1px solid
        rgba(255, 255, 255, 0.10);

    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.05);

    color:
        rgba(255, 255, 255, 0.65);

    font-size: 0.82rem;
    font-weight: 600;

    white-space: nowrap;
}


/* ------------------------------------------
   DESCRIPTION
------------------------------------------ */

.viewer-description-section {
    max-width: 900px;

    margin-bottom: 30px;
}

.viewer-description-section h2 {
    margin: 0 0 10px;

    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;

    color:
        rgba(255, 255, 255, 0.45);
}

.viewer-description-section p {
    margin: 0;

    color:
        rgba(255, 255, 255, 0.72);

    font-size: 1rem;
    line-height: 1.75;
}


/* ------------------------------------------
   MEDIA INFORMATION
------------------------------------------ */

.viewer-metadata-section {
    margin-top: 6px;
    margin-bottom: 28px;

    padding-top: 24px;

    border-top: 1px solid
        rgba(255, 255, 255, 0.08);
}

.viewer-metadata-section h2 {
    margin: 0 0 16px;

    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;

    color:
        rgba(255, 255, 255, 0.45);
}

.viewer-metadata-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 12px;
}

.viewer-metadata-item {
    min-width: 0;

    padding: 15px 16px;

    border: 1px solid
        rgba(255, 255, 255, 0.08);

    border-radius: 12px;

    background:
        rgba(255, 255, 255, 0.035);
}

.viewer-metadata-label {
    display: block;

    margin-bottom: 6px;

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    color:
        rgba(255, 255, 255, 0.40);
}

.viewer-metadata-value {
    display: block;

    color: #ffffff;

    font-size: 0.88rem;
    font-weight: 600;

    overflow-wrap: anywhere;
}


/* ------------------------------------------
   RESPONSIVE
------------------------------------------ */

@media (max-width: 900px) {

    .viewer-information {
        padding:
            24px 18px 10px;
    }

    .viewer-metadata-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 600px) {

    .viewer-information {
        padding:
            20px 14px 8px;
    }

    .viewer-information-header {
        flex-direction: column;
        gap: 12px;
    }

    .viewer-title {
        font-size:
            clamp(1.55rem, 7vw, 2.1rem);
    }

    .viewer-view-count {
        align-self: flex-start;
    }

    .viewer-description-section p {
        font-size: 0.92rem;
        line-height: 1.65;
    }

    .viewer-metadata-grid {
        grid-template-columns: 1fr;
    }

    .viewer-metadata-item {
        padding: 13px 14px;
    }
}

/* ==========================================
   MOVIEBOX MEDIA ACTION BAR
   DOWNLOAD + COPY LINK + SHARE
========================================== */

.viewer-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: 4px;
    margin-bottom: 38px;

    padding-top: 24px;

    border-top: 1px solid
        rgba(255, 255, 255, 0.08);
}


/* ------------------------------------------
   BASE ACTION BUTTON
------------------------------------------ */

.viewer-actions button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 46px;

    padding: 11px 18px;

    border-radius: 10px;

    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;

    white-space: nowrap;
}


/* ------------------------------------------
   DOWNLOAD
------------------------------------------ */

.viewer-action-button {
    border: 1px solid
        rgba(255, 255, 255, 0.14) !important;

    background:
        rgba(255, 255, 255, 0.10) !important;

    color: #ffffff !important;
}

.viewer-action-button:hover {
    background:
        rgba(255, 255, 255, 0.17) !important;

    border-color:
        rgba(255, 255, 255, 0.24) !important;

    transform:
        translateY(-2px);

    box-shadow:
        0 8px 24px
        rgba(0, 0, 0, 0.25);
}


/* ------------------------------------------
   COPY LINK + SHARE
------------------------------------------ */

.viewer-secondary-action {
    border: 1px solid
        rgba(255, 255, 255, 0.10) !important;

    background:
        rgba(255, 255, 255, 0.045) !important;

    color:
        rgba(255, 255, 255, 0.82) !important;
}

.viewer-secondary-action:hover {
    background:
        rgba(255, 255, 255, 0.10) !important;

    border-color:
        rgba(255, 255, 255, 0.18) !important;

    color: #ffffff !important;

    transform:
        translateY(-2px);
}


/* ------------------------------------------
   ACTIVE / CLICK FEEDBACK
------------------------------------------ */

.viewer-actions button:active {
    transform:
        translateY(0) scale(0.98);
}


/* ------------------------------------------
   KEYBOARD ACCESSIBILITY
------------------------------------------ */

.viewer-actions button:focus-visible {
    outline:
        2px solid
        rgba(255, 255, 255, 0.55);

    outline-offset: 3px;
}


/* ------------------------------------------
   MOBILE
------------------------------------------ */

@media (max-width: 600px) {

    .viewer-actions {
        gap: 9px;

        margin-bottom: 30px;

        padding-top: 20px;
    }

    .viewer-actions button {
        min-height: 44px;

        padding:
            10px 14px;

        font-size:
            0.84rem;
    }
}


@media (max-width: 420px) {

    .viewer-actions {
        display: grid;

        grid-template-columns: 1fr 1fr;
    }

    .viewer-actions button {
        width: 100%;
    }

    /*
       Make Download span the full row
       so it remains the primary action.
    */

    .viewer-actions
    .viewer-action-button {
        grid-column:
            1 / -1;
    }
}


/* ==========================================
   MOVIEBOX RELATED MEDIA
   RECOMMENDATION SECTION
========================================== */

.viewer-related-section {
    width: 100%;

    margin-top: 12px;
    padding-top: 34px;

    border-top: 1px solid
        rgba(255, 255, 255, 0.08);
}


/* ------------------------------------------
   SECTION HEADING
------------------------------------------ */

.viewer-section-heading {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}

.viewer-section-label {
    display: block;

    margin-bottom: 6px;

    font-size: 0.72rem;
    font-weight: 800;

    letter-spacing: 0.16em;

    text-transform: uppercase;

    color:
        rgba(255, 255, 255, 0.42);
}

.viewer-section-heading h2 {
    margin: 0;

    color: #ffffff;

    font-size:
        clamp(1.35rem, 2.4vw, 2rem);

    line-height: 1.15;

    font-weight: 800;

    letter-spacing: -0.02em;
}


/* ------------------------------------------
   RELATED GRID
------------------------------------------ */

.viewer-related-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    width: 100%;
}


/* ------------------------------------------
   RELATED CARD
------------------------------------------ */

.viewer-related-card {
    position: relative;

    display: flex;

    flex-direction: column;

    min-width: 0;

    padding: 0;

    overflow: hidden;

    border:
        1px solid
        rgba(255, 255, 255, 0.08);

    border-radius: 12px;

    background:
        rgba(255, 255, 255, 0.035);

    color: #ffffff;

    cursor: pointer;

    text-align: left;

    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        background 0.22s ease,
        box-shadow 0.22s ease;
}

.viewer-related-card:hover {
    transform:
        translateY(-5px);

    border-color:
        rgba(255, 255, 255, 0.18);

    background:
        rgba(255, 255, 255, 0.065);

    box-shadow:
        0 16px 36px
        rgba(0, 0, 0, 0.32);
}


/* ------------------------------------------
   RELATED THUMBNAIL
------------------------------------------ */

.viewer-related-card
.viewer-related-thumbnail {
    position: relative;

    width: 100%;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: #000000;
}

.viewer-related-card
.viewer-related-thumbnail img,
.viewer-related-card
.viewer-related-thumbnail video {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    background: #000000;

    transition:
        transform 0.35s ease;
}

.viewer-related-card:hover
.viewer-related-thumbnail img,
.viewer-related-card:hover
.viewer-related-thumbnail video {
    transform:
        scale(1.045);
}


/* ------------------------------------------
   PLAY INDICATOR
------------------------------------------ */


.viewer-related-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.68);
    color: #ffffff;
    font-size: 13px;
    z-index: 3;
}


/* ------------------------------------------
   RELATED CARD CONTENT
------------------------------------------ */

.viewer-related-card
.viewer-related-content {
    display: flex;

    flex-direction: column;

    gap: 5px;

    padding: 13px 14px 15px;
}

.viewer-related-card
.viewer-related-title {
    margin: 0;

    color: #ffffff;

    font-size: 0.92rem;

    line-height: 1.3;

    font-weight: 700;

    display: -webkit-box;

    -webkit-box-orient: vertical;

    line-clamp: 2;
    -webkit-line-clamp: 2;

    -webkit-line-clamp: 2;

    overflow: hidden;
}

.viewer-related-card
.viewer-related-meta {
    color:
        rgba(255, 255, 255, 0.45);

    font-size: 0.74rem;

    line-height: 1.3;
}


/* ------------------------------------------
   TABLET
------------------------------------------ */

@media (max-width: 1050px) {

    .viewer-related-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}


/* ------------------------------------------
   SMALL TABLET
------------------------------------------ */

@media (max-width: 760px) {

    .viewer-related-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 12px;
    }

    .viewer-related-card
    .viewer-related-content {
        padding:
            11px 12px 13px;
    }
}


/* ------------------------------------------
   MOBILE
------------------------------------------ */

@media (max-width: 480px) {

    .viewer-related-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 9px;
    }

    .viewer-related-card {
        border-radius: 9px;
    }

    .viewer-related-card
    .viewer-related-content {
        padding:
            9px 10px 11px;
    }

    .viewer-related-card
    .viewer-related-title {
        font-size:
            0.78rem;
    }

    .viewer-related-card
    .viewer-related-meta {
        font-size:
            0.66rem;
    }

    .viewer-related-play {
        width: 28px;
        height: 28px;

        left: 8px;
        bottom: 8px;

        font-size:
            0.7rem;
    }
}


/* ==========================================
   MOVIEBOX BROWSE OTHER MEDIA
   HORIZONTAL CONTENT RAIL
========================================== */

.viewer-more-section {
    width: 100%;

    margin-top: 42px;

    padding-top: 34px;
    padding-bottom: 50px;

    border-top: 1px solid
        rgba(255, 255, 255, 0.08);
}


/* ------------------------------------------
   SECTION HEADING
------------------------------------------ */

.viewer-more-section
.viewer-section-heading {
    margin-bottom: 18px;
}


/* ------------------------------------------
   SCROLL CONTAINER
------------------------------------------ */

.viewer-scroll {
    width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    padding:
        4px 2px 18px;

    scroll-behavior: smooth;

    overscroll-behavior-x: contain;

    scrollbar-width: thin;
}


/* ------------------------------------------
   WEBKIT SCROLLBAR
------------------------------------------ */

.viewer-scroll::-webkit-scrollbar {
    height: 7px;
}

.viewer-scroll::-webkit-scrollbar-track {
    background:
        rgba(255, 255, 255, 0.04);

    border-radius: 999px;
}

.viewer-scroll::-webkit-scrollbar-thumb {
    background:
        rgba(255, 255, 255, 0.18);

    border-radius: 999px;
}

.viewer-scroll::-webkit-scrollbar-thumb:hover {
    background:
        rgba(255, 255, 255, 0.28);
}


/* ------------------------------------------
   CONTENT ROW
------------------------------------------ */

.viewer-list {
    display: flex;

    align-items: stretch;

    gap: 14px;

    width: max-content;

    min-width: 100%;
}


/* ------------------------------------------
   BROWSE CARD
------------------------------------------ */

.viewer-item {
    position: relative;

    flex:
        0 0 250px;

    width: 250px;

    min-width: 250px;

    overflow: hidden;

    border:
        1px solid
        rgba(255, 255, 255, 0.08);

    border-radius: 12px;

    background:
        rgba(255, 255, 255, 0.035);

    cursor: pointer;

    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        background 0.22s ease,
        box-shadow 0.22s ease;
}

.viewer-item:hover {
    transform:
        translateY(-5px);

    border-color:
        rgba(255, 255, 255, 0.18);

    background:
        rgba(255, 255, 255, 0.065);

    box-shadow:
        0 16px 36px
        rgba(0, 0, 0, 0.30);
}


/* ------------------------------------------
   BROWSE THUMBNAIL
------------------------------------------ */

.viewer-item
.viewer-item-media {
    position: relative;

    width: 100%;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: #000000;
}

.viewer-item
.viewer-item-media img,
.viewer-item
.viewer-item-media video {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    background: #000000;

    transition:
        transform 0.35s ease;
}

.viewer-item:hover
.viewer-item-media img,
.viewer-item:hover
.viewer-item-media video {
    transform:
        scale(1.045);
}


/* ------------------------------------------
   BROWSE CARD INFORMATION
------------------------------------------ */

.viewer-item
.viewer-item-info {
    display: flex;

    flex-direction: column;

    gap: 5px;

    padding:
        13px 14px 15px;
}

.viewer-item
.viewer-item-title {
    margin: 0;

    color: #ffffff;

    font-size: 0.9rem;

    line-height: 1.3;

    font-weight: 700;

    display: -webkit-box;

    -webkit-box-orient: vertical;

    line-clamp: 2;
    -webkit-line-clamp: 2;

    -webkit-line-clamp: 2;

    overflow: hidden;
}

.viewer-item
.viewer-item-meta {
    color:
        rgba(255, 255, 255, 0.45);

    font-size: 0.73rem;

    line-height: 1.3;
}


/* ------------------------------------------
   MOBILE / TOUCH DEVICES
------------------------------------------ */

@media (max-width: 700px) {

    .viewer-more-section {
        margin-top: 32px;

        padding-top: 28px;
        padding-bottom: 35px;
    }

    .viewer-list {
        gap: 11px;
    }

    .viewer-item {
        flex-basis: 205px;

        width: 205px;
        min-width: 205px;

        border-radius: 10px;
    }

    .viewer-item
    .viewer-item-info {
        padding:
            10px 11px 12px;
    }

    .viewer-item
    .viewer-item-title {
        font-size:
            0.78rem;
    }

    .viewer-item
    .viewer-item-meta {
        font-size:
            0.65rem;
    }
}


@media (max-width: 420px) {

    .viewer-item {
        flex-basis: 185px;

        width: 185px;
        min-width: 185px;
    }
}

/* ==========================================
   MOVIEBOX MEDIA BADGES + OVERLAYS
========================================== */


/* ------------------------------------------
   RELATED MEDIA — THUMBNAIL OVERLAY
------------------------------------------ */

.viewer-related-thumbnail {
    position: relative !important;
}


/* ------------------------------------------
   MEDIA TYPE BADGE
------------------------------------------ */

.viewer-media-type-badge {
    position: absolute;

    top: 10px;
    right: 10px;

    z-index: 3;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 24px;

    padding: 4px 8px;

    border:
        1px solid
        rgba(255, 255, 255, 0.16);

    border-radius: 6px;

    background:
        rgba(0, 0, 0, 0.72);

    color: #ffffff;

    font-size: 0.62rem;
    font-weight: 800;

    letter-spacing: 0.08em;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    pointer-events: none;
}


/* ------------------------------------------
   PLAY BUTTON
------------------------------------------ */

.viewer-related-play {
    z-index: 3;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.viewer-related-card:hover
.viewer-related-play {
    transform: scale(1.08);

    background:
        rgba(0, 0, 0, 0.84);
}


/* ------------------------------------------
   THUMBNAIL GRADIENT
------------------------------------------ */

.viewer-related-thumbnail::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 45%;

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.55),
            transparent
        );

    pointer-events: none;
}


/* ------------------------------------------
   BROWSE MEDIA OVERLAY
------------------------------------------ */

.viewer-item {
    position: relative;
}

.viewer-item-media {
    position: relative !important;
}


/* ------------------------------------------
   BROWSE MEDIA TYPE BADGE
------------------------------------------ */

.viewer-item-media::after {
    content: "MEDIA";

    position: absolute;

    top: 9px;
    right: 9px;

    z-index: 3;

    padding: 4px 7px;

    border:
        1px solid
        rgba(255, 255, 255, 0.15);

    border-radius: 5px;

    background:
        rgba(0, 0, 0, 0.68);

    color:
        rgba(255, 255, 255, 0.9);

    font-size: 0.58rem;
    font-weight: 800;

    letter-spacing: 0.07em;

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);

    pointer-events: none;
}


/* ------------------------------------------
   BROWSE THUMBNAIL GRADIENT
------------------------------------------ */

.viewer-item-media::before {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 45%;

    z-index: 2;

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.58),
            transparent
        );

    pointer-events: none;
}


/* ------------------------------------------
   BROWSE CARD HOVER
------------------------------------------ */

.viewer-item:hover {
    border-color:
        rgba(255, 255, 255, 0.20);
}


/* ------------------------------------------
   MAIN GALLERY CARD POLISH
------------------------------------------ */

.media-card {
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.media-card:hover {
    transform:
        translateY(-4px);
}


/* ------------------------------------------
   MOBILE
------------------------------------------ */

@media (max-width: 520px) {

    .viewer-media-type-badge {
        top: 7px;
        right: 7px;

        min-height: 21px;

        padding:
            3px 6px;

        font-size:
            0.55rem;
    }

}





/* ==========================================
   RELATED MEDIA PREVIEW CLASS ALIGNMENT
========================================== */

.viewer-related-preview {
    position: relative !important;

    width: 100% !important;

    aspect-ratio: 16 / 9 !important;

    overflow: hidden !important;

    background: #000000 !important;
}

.viewer-related-preview img,
.viewer-related-preview video {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    object-fit: cover !important;

    background: #000000 !important;

    transition:
        transform 0.35s ease;
}

.viewer-related-card:hover
.viewer-related-preview img,
.viewer-related-card:hover
.viewer-related-preview video {
    transform:
        scale(1.045);
}


/* ==========================================
   MEDIAFLOW VIEWER POLISH
========================================== */

.viewer-main-image,
.viewer-main-video {

    animation:
        viewerFadeIn
        0.35s ease;

}

@keyframes viewerFadeIn {

    from {

        opacity: 0;
        transform: scale(0.98);

    }

    to {

        opacity: 1;
        transform: scale(1);

    }

}

.viewer-related-card {

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;

}

.viewer-related-card:hover {

    transform: translateY(-4px);

}

.viewer-item {

    transition:
        transform 0.25s ease;

}

.viewer-item:hover {

    transform: translateY(-4px);

}




/* ==========================================
   MEDIAFLOW — VIEWER DETAIL PAGE POLISH
   Safe visual-only override
========================================== */

/* ------------------------------------------
   VIEWER INFORMATION
------------------------------------------ */

.viewer-information {
    width: min(1450px, 100%);
    margin: 0 auto;
    padding: 30px 24px 20px;
    box-sizing: border-box;
}

.viewer-information-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.viewer-information-header > div:first-child {
    min-width: 0;
}

.viewer-media-type {
    margin-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.55;
}

.viewer-title {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

.viewer-view-count {
    flex-shrink: 0;
    padding: 8px 13px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0.75;
}


/* ------------------------------------------
   DESCRIPTION
------------------------------------------ */

.viewer-description-section {
    max-width: 900px;
    margin-bottom: 32px;
}

.viewer-description-section h2,
.viewer-metadata-section h2 {
    margin: 0 0 11px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.45;
}

.viewer-description-section p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.75;
    opacity: 0.72;
}


/* ------------------------------------------
   METADATA
------------------------------------------ */

.viewer-metadata-section {
    margin-top: 6px;
    margin-bottom: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.viewer-metadata-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.viewer-metadata-item {
    min-width: 0;
    padding: 15px 16px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.035);
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.viewer-metadata-item:hover {
    background: rgba(255,255,255,0.055);
    border-color: rgba(255,255,255,0.14);
    transform: translateY(-2px);
}

.viewer-metadata-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.40;
}

.viewer-metadata-value {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}


/* ------------------------------------------
   ACTION BUTTONS
------------------------------------------ */

.viewer-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
    margin-bottom: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.viewer-actions button {
    min-height: 45px;
    padding: 10px 17px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.viewer-secondary-action {
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.045);
    color: rgba(255,255,255,0.82);
}

.viewer-secondary-action:hover {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.18);
    color: #fff;
    transform: translateY(-2px);
}


/* ------------------------------------------
   RELATED MEDIA
------------------------------------------ */

.viewer-related-section {
    width: 100%;
}

.viewer-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.viewer-section-label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.38;
}

.viewer-section-heading h2 {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    line-height: 1.2;
    font-weight: 800;
}

.viewer-related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.viewer-related-card {
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 13px;
    background: rgba(255,255,255,0.035);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.viewer-related-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.16);
    box-shadow: 0 14px 35px rgba(0,0,0,0.28);
}

.viewer-related-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.viewer-related-preview img,
.viewer-related-preview video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.viewer-related-card:hover
.viewer-related-preview img,
.viewer-related-card:hover
.viewer-related-preview video {
    transform: scale(1.045);
}

.viewer-media-type-badge {
    position: absolute;
    top: 9px;
    left: 9px;
    z-index: 2;
    padding: 5px 7px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    background: rgba(0,0,0,0.70);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.viewer-related-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 13px 14px;
}

.viewer-related-title {
    overflow: hidden;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewer-related-type {
    font-size: 0.73rem;
    opacity: 0.45;
}


/* ------------------------------------------
   BROWSE OTHER MEDIA
------------------------------------------ */

.viewer-more-section {
    width: 100%;
    margin-top: 45px;
    padding: 38px 24px 50px;
    box-sizing: border-box;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.viewer-more-section .viewer-section-heading {
    width: min(1450px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.viewer-scroll {
    width: min(1450px, 100%);
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
}

.viewer-list {
    display: flex;
    gap: 16px;
    width: max-content;
}

.viewer-item {
    width: 250px;
    flex: 0 0 250px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 13px;
    background: rgba(255,255,255,0.035);
    cursor: pointer;
    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.viewer-item:hover {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.16);
    box-shadow: 0 14px 35px rgba(0,0,0,0.28);
}

.viewer-item-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.viewer-item-preview img,
.viewer-item-preview video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.viewer-item:hover
.viewer-item-preview img,
.viewer-item:hover
.viewer-item-preview video {
    transform: scale(1.045);
}

.viewer-item-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 13px 14px;
}

.viewer-item-title {
    overflow: hidden;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewer-item-type {
    flex-shrink: 0;
    font-size: 0.70rem;
    opacity: 0.45;
}


/* ------------------------------------------
   HERO MEDIA — TRANSITION ONLY
   Existing sizing is intentionally preserved.
------------------------------------------ */

.viewer-main-image,
.viewer-main-video {
    animation: viewerMediaFadeIn 0.35s ease;
}

@keyframes viewerMediaFadeIn {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }

}


/* ------------------------------------------
   RESPONSIVE
------------------------------------------ */

@media (max-width: 1050px) {

    .viewer-related-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}

@media (max-width: 760px) {

    .viewer-information {
        padding: 24px 18px 15px;
    }

    .viewer-information-header {
        flex-direction: column;
        gap: 12px;
    }

    .viewer-view-count {
        align-self: flex-start;
    }

    .viewer-related-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .viewer-more-section {
        padding-left: 18px;
        padding-right: 18px;
    }

}

@media (max-width: 520px) {

    .viewer-information {
        padding: 20px 14px 12px;
    }

    .viewer-title {
        font-size: clamp(1.55rem, 7vw, 2.1rem);
    }

    .viewer-description-section p {
        font-size: 0.92rem;
        line-height: 1.65;
    }

    .viewer-metadata-grid {
        grid-template-columns: 1fr;
    }

    .viewer-actions {
        margin-bottom: 30px;
    }

    .viewer-actions button {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 0.84rem;
    }

    .viewer-related-grid {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .viewer-related-info {
        padding: 10px;
    }

    .viewer-related-title {
        font-size: 0.78rem;
    }

    .viewer-item {
        width: 190px;
        flex-basis: 190px;
    }

    .viewer-more-section {
        padding: 30px 14px 40px;
    }

}


/* ==========================================
   FAVORITES
========================================== */

#viewerFavorite {

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;

}

#viewerFavorite:hover {

    transform:
        translateY(-2px);

}


/* ==========================================
   FAVORITES / VIEWER ACTION BAR
   FINAL VISIBILITY FIX
========================================== */

.viewer-actions {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;

    width: 100%;
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;

    margin-top: 4px;
    margin-bottom: 40px;
    padding-top: 24px;

    border-top:
        1px solid rgba(255, 255, 255, 0.08);

    z-index: 5;
}

.viewer-actions .viewer-secondary-action {
    position: relative !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#viewerFavorite {
    position: relative !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}



/* ======================================
   FAVORITE BADGE
======================================= */

.media-card {
    position: relative;
}

.card-favorite-badge {
    position: absolute;
    top: 10px;
    right: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);

    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;

    font-size: 17px;

    z-index: 10;

    pointer-events: none;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ======================================
   SEARCH HIGHLIGHT
======================================= */

.search-highlight {
    padding: 0 2px;

    border-radius: 3px;

    background: rgba(255, 214, 64, 0.35);

    color: inherit;

    font-weight: 700;
}


/* ======================================
   IMPROVED EMPTY / NO-RESULTS STATE
======================================= */

.empty-state-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.empty-state p {
    margin: 0 auto 18px;
    max-width: 520px;
    line-height: 1.6;
}

.clear-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 0 18px;

    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;

    cursor: pointer;

    font: inherit;
    font-weight: 600;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.clear-search-button:hover {
    transform: translateY(-2px);
}

.clear-search-button:active {
    transform: translateY(0);
}



/* ======================================
   MEDIA CARD MICRO-INTERACTIONS
======================================= */

.media-card {
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease;
    will-change: transform;
}

.media-card:hover {
    transform: translateY(-4px);

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.18);
}

.media-card:active {
    transform: translateY(-1px);
}

.media-card img,
.media-card video {
    transition:
        transform 0.3s ease;
}

.media-card:hover img,
.media-card:hover video {
    transform: scale(1.025);
}


/* ======================================
   QUICK ACTION MICRO-INTERACTIONS
======================================= */

.card-quick-action {
    transition:
        transform 0.18s ease,
        opacity 0.18s ease,
        background 0.18s ease;
}

.card-quick-action:hover {
    transform: translateY(-2px) scale(1.05);
}

.card-quick-action:active {
    transform: scale(0.95);
}


/* ======================================
   CARD KEYBOARD FOCUS
======================================= */

.media-card:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 4px;
}

.card-quick-action:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ======================================
   REDUCED MOTION
======================================= */

@media (prefers-reduced-motion: reduce) {

    .media-card,
    .media-card img,
    .media-card video,
    .card-quick-action {
        transition: none !important;
    }

    .media-card:hover {
        transform: none;
    }

    .media-card:hover img,
    .media-card:hover video {
        transform: none;
    }

}





/* ==========================================
   MOBILE MORE MENU
========================================== */

@media (max-width: 768px) {

    .more-menu-wrapper {
        position: relative;
    }

    .more-menu-button {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 14px;
        white-space: nowrap;
    }

    .more-menu {
        position: fixed;

        top: 72px;
        right: 14px;
        left: 14px;

        width: auto;
        max-width: none;

        max-height: calc(100vh - 90px);

        overflow-y: auto;
        overscroll-behavior: contain;

        border-radius: 16px;

        z-index: 1001;

        transform: translateY(-12px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition:
            opacity 0.2s ease,
            transform 0.2s ease,
            visibility 0.2s ease;
    }

    .more-menu.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .more-menu-item {
        width: 100%;
        min-height: 48px;

        padding: 13px 16px;

        display: flex;
        align-items: center;

        text-align: left;

        font-size: 15px;
    }

    .more-menu-backdrop {
        position: fixed;

        inset: 0;

        z-index: 1000;

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition:
            opacity 0.2s ease,
            visibility 0.2s ease;
    }

    .more-menu-backdrop.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

}


/* ==========================================
   SMALL PHONES
========================================== */

@media (max-width: 480px) {

    .more-menu {
        top: 66px;
        right: 10px;
        left: 10px;

        max-height: calc(100vh - 78px);

        border-radius: 14px;
    }

    .more-menu-button {
        min-height: 42px;
        padding: 9px 12px;
        font-size: 13px;
    }

    .more-menu-item {
        min-height: 50px;
        padding: 14px 15px;
        font-size: 15px;
    }

}

@media (max-width: 768px) {

    body.more-menu-open {
        overflow: hidden;
    }

}

/* ==========================================
   MORE MENU TOUCH INTERACTION
========================================== */

.more-menu-item {
    position: relative;
    cursor: pointer;

    -webkit-tap-highlight-color: transparent;

    transition:
        background 0.18s ease,
        transform 0.18s ease;
}

.more-menu-item:hover {
    transform: translateX(2px);
}

.more-menu-item:active {
    transform: scale(0.98);
}

.more-menu-item:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: -3px;
}


/* ==========================================
   MOBILE TOUCH FEEDBACK
========================================== */

@media (max-width: 768px) {

    .more-menu-item {
        min-height: 50px;

        -webkit-tap-highlight-color: transparent;

        touch-action: manipulation;
    }

    .more-menu-item:active {
        transform: scale(0.97);
    }

}


/* ==========================================
   REDUCED MOTION
========================================== */

@media (prefers-reduced-motion: reduce) {

    .more-menu-item {
        transition: none !important;
    }

    .more-menu-item:hover,
    .more-menu-item:active {
        transform: none !important;
    }

}

/* ==========================================
   MOBILE HEADER
========================================== */

@media (max-width: 768px) {

    .site-header {
        width: 100%;
    }

    .header-inner {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .logo {
        min-width: 0;
        flex: 1 1 auto;

        display: flex;
        align-items: center;

        gap: 8px;

        white-space: nowrap;
        overflow: hidden;
    }

    .logo > span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-actions {
        flex: 0 0 auto;

        display: flex;
        align-items: center;

        gap: 8px;
    }

    .header-count {
        white-space: nowrap;
        font-size: 13px;
    }

    .more-menu-wrapper {
        flex: 0 0 auto;
    }

}


/* ==========================================
   SMALL PHONES
========================================== */

@media (max-width: 480px) {

    .header-inner {
        gap: 7px;
    }

    .logo {
        gap: 6px;
        font-size: 15px;
    }

    .logo-icon {
        flex: 0 0 auto;
    }

    .header-actions {
        gap: 6px;
    }

    .header-count {
        font-size: 12px;
    }

    .more-menu-button {
        padding-left: 10px;
        padding-right: 10px;
    }

}


/* ==========================================
   VERY SMALL PHONES
========================================== */

@media (max-width: 360px) {

    .header-count {
        display: none;
    }

    .logo {
        font-size: 14px;
    }

}



/* ==========================================
   MOBILE GALLERY CONTROLS
========================================== */

@media (max-width: 768px) {

    .gallery-controls {
        width: 100%;

        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 12px;
    }

    .search-box {
        width: 100%;
    }

    .search-wrapper {
        width: 100%;
    }

    #searchInput {
        width: 100%;
        min-height: 46px;

        font-size: 16px;
    }

    .filter-group {
        width: 100%;

        display: flex;
        flex-wrap: wrap;

        gap: 8px;

        overflow-x: auto;
        scrollbar-width: thin;

        padding-bottom: 3px;
    }

    .filter-button {
        flex: 0 0 auto;

        min-height: 42px;
        padding: 9px 14px;

        white-space: nowrap;

        touch-action: manipulation;
    }

    .sort-group {
        width: 100%;

        display: flex;
        align-items: center;

        gap: 8px;
    }

    .sort-label {
        flex: 0 0 auto;
    }

    .sort-select {
        flex: 1 1 auto;

        min-height: 44px;

        font-size: 15px;
    }

    .result-count {
        width: 100%;

        text-align: left;

        font-size: 13px;
    }

}


/* ==========================================
   SMALL PHONES
========================================== */

@media (max-width: 480px) {

    .gallery-controls {
        gap: 10px;
    }

    .filter-group {
        flex-wrap: nowrap;

        overflow-x: auto;

        padding-bottom: 6px;

        scrollbar-width: none;
    }

    .filter-group::-webkit-scrollbar {
        display: none;
    }

    .filter-button {
        min-height: 44px;
        padding: 10px 14px;
    }

    .sort-group {
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
    }

    .sort-select {
        width: 100%;
        min-height: 46px;
    }

    .result-count {
        text-align: center;
    }

}

/* ==========================================
   MOBILE GALLERY GRID
========================================== */

@media (max-width: 768px) {

    .gallery {
        width: 100%;

        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 14px;
    }

    .media-card {
        min-width: 0;
        width: 100%;

        border-radius: 12px;
        overflow: hidden;
    }

    .media-card img,
    .media-card video {
        width: 100%;
        height: auto;

        aspect-ratio: 4 / 3;
        object-fit: cover;
    }

    .card-info {
        min-width: 0;
        padding: 10px;
    }

    .card-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .card-type {
        font-size: 12px;
    }

    .card-quick-actions {
        gap: 6px;
    }

    .card-quick-action {
        width: 34px;
        height: 34px;

        min-width: 34px;
        min-height: 34px;
    }

}


/* ==========================================
   SMALL PHONES
========================================== */

@media (max-width: 480px) {

    .gallery {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;
    }

    .media-card {
        border-radius: 10px;
    }

    .media-card img,
    .media-card video {
        aspect-ratio: 1 / 1;
    }

    .card-info {
        padding: 8px;
    }

    .card-title {
        font-size: 13px;
    }

    .card-type {
        font-size: 11px;
    }

    .card-quick-action {
        width: 32px;
        height: 32px;

        min-width: 32px;
        min-height: 32px;
    }

    .card-favorite-badge {
        top: 7px;
        right: 7px;

        width: 30px;
        height: 30px;

        font-size: 15px;
    }

}


/* ==========================================
   VERY SMALL PHONES
========================================== */

@media (max-width: 360px) {

    .gallery {
        gap: 8px;
    }

    .card-info {
        padding: 7px;
    }

    .card-title {
        font-size: 12px;
    }

    .card-quick-action {
        width: 30px;
        height: 30px;

        min-width: 30px;
        min-height: 30px;
    }

}



/* ==========================================
   MOBILE CAROUSELS
========================================== */

@media (max-width: 768px) {

    .recent-carousel,
    .trending-carousel {
        width: 100%;

        display: flex;
        gap: 12px;

        overflow-x: auto;
        overflow-y: hidden;

        scroll-behavior: smooth;
        scroll-snap-type: x proximity;

        overscroll-behavior-x: contain;

        -webkit-overflow-scrolling: touch;

        scrollbar-width: thin;

        padding-bottom: 8px;
    }

    .recent-carousel > *,
    .trending-carousel > * {
        flex: 0 0 78%;

        min-width: 0;

        scroll-snap-align: start;
    }

    .recent-carousel::-webkit-scrollbar,
    .trending-carousel::-webkit-scrollbar {
        height: 5px;
    }

}


/* ==========================================
   SMALL PHONES
========================================== */

@media (max-width: 480px) {

    .recent-carousel,
    .trending-carousel {
        gap: 10px;

        scrollbar-width: none;
    }

    .recent-carousel::-webkit-scrollbar,
    .trending-carousel::-webkit-scrollbar {
        display: none;
    }

    .recent-carousel > *,
    .trending-carousel > * {
        flex: 0 0 82%;
    }

}


/* ==========================================
   VERY SMALL PHONES
========================================== */

@media (max-width: 360px) {

    .recent-carousel > *,
    .trending-carousel > * {
        flex: 0 0 88%;
    }

}


/* ==========================================
   REDUCED MOTION
========================================== */

@media (prefers-reduced-motion: reduce) {

    .recent-carousel,
    .trending-carousel {
        scroll-behavior: auto;
    }

}


/* ==========================================
   MOBILE MEDIA VIEWER
========================================== */

@media (max-width: 768px) {

    .viewer-topbar {
        min-height: 58px;

        padding:
            10px
            12px;

        gap: 8px;
    }

    .viewer-topbar-left {
        min-width: 0;

        display: flex;
        align-items: center;

        gap: 8px;
    }

    .viewer-back-button {
        min-width: 44px;
        min-height: 44px;

        padding: 8px 10px;
    }

    .viewer-back-text {
        display: none;
    }

    .viewer-media-badge {
        max-width: 90px;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .viewer-counter {
        white-space: nowrap;
        font-size: 13px;
    }

    .viewer-topbar-actions {
        flex: 0 0 auto;

        display: flex;
        align-items: center;

        gap: 6px;
    }

    .viewer-action-button {
        min-width: 44px;
        min-height: 44px;

        padding: 8px;
    }

    .viewer-action-button span {
        display: none;
    }

    .viewer-close {
        width: 44px;
        height: 44px;

        min-width: 44px;
        min-height: 44px;
    }

    .viewer-content {
        width: 100%;

        padding:
            12px;
    }

    .viewer-actions {
        gap: 8px;

        margin-bottom: 24px;
        padding-top: 18px;
    }

    .viewer-actions .viewer-secondary-action {
        min-height: 44px;

        padding:
            10px
            13px;

        font-size: 14px;
    }

}


/* ==========================================
   SMALL PHONES
========================================== */

@media (max-width: 480px) {

    .viewer-topbar {
        min-height: 54px;

        padding:
            8px
            10px;
    }

    .viewer-topbar-left {
        gap: 6px;
    }

    .viewer-back-button {
        width: 42px;
        min-width: 42px;

        padding: 8px;
    }

    .viewer-media-badge {
        display: none;
    }

    .viewer-counter {
        font-size: 12px;
    }

    .viewer-topbar-actions {
        gap: 5px;
    }

    .viewer-action-button,
    .viewer-close {
        width: 42px;
        min-width: 42px;
        min-height: 42px;
    }

    .viewer-content {
        padding: 8px;
    }

    .viewer-actions {
        display: grid !important;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;

        padding-top: 16px;
        margin-bottom: 20px;
    }

    .viewer-actions .viewer-secondary-action {
        width: 100%;

        justify-content: center;

        min-height: 46px;
    }

}


/* ==========================================
   VERY SMALL PHONES
========================================== */

@media (max-width: 360px) {

    .viewer-topbar {
        padding:
            7px
            8px;
    }

    .viewer-counter {
        font-size: 11px;
    }

    .viewer-action-button,
    .viewer-close,
    .viewer-back-button {
        width: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .viewer-content {
        padding: 6px;
    }

}


/* ==========================================
   ACCESSIBILITY — FOCUS STATES
========================================== */

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}


/* More menu items */
.more-menu-item:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: -3px;
}


/* Filter buttons */
.filter-button:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}


/* Search controls */
#searchInput:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}


/* Viewer controls */
.viewer-back-button:focus-visible,
.viewer-action-button:focus-visible,
.viewer-close:focus-visible,
.viewer-secondary-action:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}


/* Don't show keyboard outlines from mouse clicks */
button:focus:not(:focus-visible),
select:focus:not(:focus-visible),
input:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}


/* ==========================================
   ACCESSIBILITY — REDUCED MOTION
========================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }

    .more-menu,
    .more-menu-backdrop,
    .viewer,
    .viewer-actions,
    .media-card,
    .media-card img,
    .media-card video,
    .card-quick-action,
    .more-menu-item {
        transition: none !important;
        animation: none !important;
    }

}