/* ==========================================================
 *  GALLERY.CSS — Styling utama halaman gallery kumpulenak
 *  File ini memuat semua style untuk:
 *  - CSS Custom Properties (Dark/Light mode)
 *  - Layout & Reset
 *  - Header & Navigation (dengan sliding tab indicator)
 *  - Banner & Verify Button
 *  - Card Grid & Animations (hover overlay, badges)
 *  - Video Player Modal
 *  - Pagination
 *  - Footer
 *  - Search (clear button)
 *  - Back to Top Button
 *  - Skeleton, Empty, Error States
 *  - Dark/Light Theme Toggle
 *  - Responsive
 * ========================================================== */

/* ===== CSS CUSTOM PROPERTIES — Tema Dark (default) & Light ===== */
:root,
[data-theme="dark"] {
    --bg: #080808;
    --bg-secondary: #111;
    --text: #fff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.5);
    --card-bg: transparent;
    --card-meta-bg: transparent;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: rgba(0, 0, 0, 0.4);
    --accent: #e8a800;
    --accent-dark: #d4990a;
    --green: #006600;
    --skeleton-base: #1a1a2e;
    --skeleton-shine: #252540;
    --modal-bg: #1a1a1a;
    --input-bg: #111;
    --input-border: #333;
    --scrollbar-track: #111;
    --content-wrapper-start: #c99500;
    --content-wrapper-mid: #e8a800;
    --content-wrapper-end: #e8a800;
    --card-img-bg: linear-gradient(135deg, #1a1a2e, #222);
    --footer-text: rgba(0, 0, 0, 0.5);
    --page-btn-bg: rgba(255, 255, 255, 0.1);
    --page-btn-color: rgba(255, 255, 255, 0.8);
    --page-btn-hover-bg: rgba(255, 255, 255, 0.18);
    --page-info-bg: rgba(255, 255, 255, 0.1);
    --page-info-color: rgba(255, 255, 255, 0.8);
    --footer-bg: linear-gradient(135deg, #1a1800 0%, #2a2200 100%);
    --footer-link-color: #e8a800;
    --footer-link-hover: #ffc107;
    --footer-p-color: rgba(255, 255, 255, 0.4);
    --content-wrapper-bg: linear-gradient(180deg, #2a2000 0%, #1e1800 30%, #181400 100%);
}

[data-theme="light"] {
    --bg: #f5f5f5;
    --bg-secondary: #e8e8e8;
    --text: #111;
    --text-secondary: rgba(0, 0, 0, 0.65);
    --text-muted: rgba(0, 0, 0, 0.4);
    --card-bg: #fff;
    --card-meta-bg: #fff;
    --border: rgba(0, 0, 0, 0.1);
    --shadow: rgba(0, 0, 0, 0.12);
    --accent: #e8a800;
    --accent-dark: #d4990a;
    --green: #006600;
    --skeleton-base: #e0e0e0;
    --skeleton-shine: #f0f0f0;
    --modal-bg: #fff;
    --input-bg: #f5f5f5;
    --input-border: #ddd;
    --scrollbar-track: #e8e8e8;
    --content-wrapper-start: #d4a000;
    --content-wrapper-mid: #e8a800;
    --content-wrapper-end: #e8a800;
    --card-img-bg: linear-gradient(135deg, #ddd, #ccc);
    --footer-text: rgba(0, 0, 0, 0.5);
    --page-btn-bg: #fff;
    --page-btn-color: #b08600;
    --page-btn-hover-bg: #fff3cd;
    --page-info-bg: #fff;
    --page-info-color: #b08600;
    --footer-bg: linear-gradient(135deg, #e8a800 0%, #d49a00 100%);
    --footer-link-color: #004400;
    --footer-link-hover: #000;
    --footer-p-color: rgba(0, 0, 0, 0.5);
    --content-wrapper-bg: linear-gradient(180deg, var(--content-wrapper-start) 0%, var(--content-wrapper-mid) 30%, var(--content-wrapper-end) 100%);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    font-family: 'Inter', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans KR',
        'Hiragino Kana', 'Yu Gothic', 'Meiryo',
        'PingFang SC', 'Microsoft YaHei',
        'Malgun Gothic', sans-serif;
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: #e8a800;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ffc107;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, #e8a800 0%, #d4990a 100%);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.logo {
    font-size: 24px;
    font-weight: 900;
    color: #006600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: -1px;
    transition: transform 0.2s;
}

.logo:hover {
    transform: scale(1.05);
}

/* ===== NAV TABS — Dengan sliding pill indicator ===== */
.nav-tabs {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 3px;
    position: relative;
}

.nav-tab-indicator {
    position: absolute;
    top: 3px;
    left: 3px;
    height: calc(100% - 6px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    opacity: 0;
    pointer-events: none;
}

.nav-tab {
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 600;
    font-size: 13px;
    padding: 7px 18px;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.25s ease;
    font-family: inherit;
    position: relative;
    z-index: 1;
}

.nav-tab:hover {
    color: #000;
}

.nav-tab.active {
    color: #000;
    /* background dihandle oleh indicator */
    background: transparent;
}

/* ===== SEARCH BOX ===== */
.search-box {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.search-box input {
    border: none;
    border-radius: 10px;
    padding: 8px 60px 8px 14px;
    font-size: 13px;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    width: 140px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-box input:focus {
    width: 200px;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.search-box input::placeholder {
    color: #999;
}

/* Tombol clear (×) dalam search box */
.search-clear-btn {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 2px 6px;
    color: #999;
    transition: color 0.2s;
    display: none;
    line-height: 1;
    z-index: 2;
}

.search-clear-btn:hover {
    color: #333;
}

/* Tombol search (🔍) */
.search-submit-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    color: #666;
    transition: color 0.2s;
}

.search-submit-btn:hover {
    color: #000;
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(20deg) scale(1.1);
}

/* ===== BANNER ===== */
.banner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 10px 5px;
}

.banner-img {
    width: 100%;
    min-height: 90px;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 40%, #0f3460 100%);
    border-radius: 12px;
    text-align: center;
    color: #e8a800;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(232, 168, 0, 0.3);
    border: 1px solid rgba(232, 168, 0, 0.15);
    position: relative;
    overflow: visible;
}

.banner-img::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(232, 168, 0, 0.06) 0%, transparent 70%);
    animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {

    0%,
    100% {
        transform: translateX(-30%);
    }

    50% {
        transform: translateX(30%);
    }
}

/* ===== VERIFY BUTTON ===== */
.verify-btn {
    display: block;
    max-width: 520px;
    margin: 16px auto;
    background: linear-gradient(135deg, #ff6b35 0%, #e8541e 50%, #d44316 100%);
    color: #fff;
    text-align: center;
    padding: 15px 24px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: 0 6px 24px rgba(255, 107, 53, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: verifyPulse 2.5s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.verify-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s;
}

.verify-btn:hover::after {
    left: 100%;
}

.verify-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.5);
}

.verify-btn:active {
    transform: translateY(0);
}

@keyframes verifyPulse {

    0%,
    100% {
        box-shadow: 0 6px 24px rgba(255, 107, 53, 0.35);
    }

    50% {
        box-shadow: 0 6px 35px rgba(255, 107, 53, 0.6);
    }
}

/* ===== MAIN CONTENT ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

.content-wrapper {
    background: var(--content-wrapper-bg);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 15px;
    box-shadow: 0 8px 30px rgba(232, 168, 0, 0.15);
}

.section-label {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
}

/* ===== CARD GRID ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    min-height: 200px;
}

/* ===== IN-GRID BANNER AD ===== */
.ingrid-banner-ad {
    grid-column: 1 / -1;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ingrid-banner-ad:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(232, 168, 0, 0.25);
}

.ingrid-banner-link {
    display: block;
    width: 100%;
    text-decoration: none;
}

.ingrid-banner-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.card {
    background: var(--card-bg);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    opacity: 0;
    animation: cardFadeIn 0.5s ease forwards;
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s ease;
    overflow: hidden;
}

/* Light mode: card punya shadow */
[data-theme="light"] .card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.card:hover {
    transform: translateY(-4px) scale(1.02);
}

/* Staggered card animation — sampai 24 card per halaman */
.card:nth-child(1) {
    animation-delay: 0s;
}

.card:nth-child(2) {
    animation-delay: 0.04s;
}

.card:nth-child(3) {
    animation-delay: 0.08s;
}

.card:nth-child(4) {
    animation-delay: 0.12s;
}

.card:nth-child(5) {
    animation-delay: 0.16s;
}

.card:nth-child(6) {
    animation-delay: 0.20s;
}

.card:nth-child(7) {
    animation-delay: 0.24s;
}

.card:nth-child(8) {
    animation-delay: 0.28s;
}

.card:nth-child(9) {
    animation-delay: 0.32s;
}

.card:nth-child(10) {
    animation-delay: 0.36s;
}

.card:nth-child(11) {
    animation-delay: 0.40s;
}

.card:nth-child(12) {
    animation-delay: 0.44s;
}

.card:nth-child(13) {
    animation-delay: 0.48s;
}

.card:nth-child(14) {
    animation-delay: 0.52s;
}

.card:nth-child(15) {
    animation-delay: 0.56s;
}

.card:nth-child(16) {
    animation-delay: 0.60s;
}

.card:nth-child(17) {
    animation-delay: 0.64s;
}

.card:nth-child(18) {
    animation-delay: 0.68s;
}

.card:nth-child(19) {
    animation-delay: 0.72s;
}

.card:nth-child(20) {
    animation-delay: 0.76s;
}

.card:nth-child(21) {
    animation-delay: 0.80s;
}

.card:nth-child(22) {
    animation-delay: 0.84s;
}

.card:nth-child(23) {
    animation-delay: 0.88s;
}

.card:nth-child(24) {
    animation-delay: 0.92s;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CARD IMAGE WRAPPER ===== */
.card-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    background-color: var(--card-img-bg);
}

.blur-overlay {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    /* Scale besar (2.5x) untuk "melewati/memotong" black-bars bawaan dari gambar API */
    transform: scale(2.5);
    filter: blur(15px) brightness(0.45);
    z-index: 0;
    pointer-events: none;
}

.card-img-wrapper img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    opacity: 0;
    z-index: 1;
}

.card-img-wrapper img.loaded {
    opacity: 1;
}

.card:hover .card-img-wrapper img {
    transform: scale(1.08);
}

/* ===== HOVER OVERLAY — Gradient gelap + judul besar ===== */
.card-img-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 40%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.card:hover .card-img-wrapper::after {
    opacity: 1;
}

/* Judul overlay saat hover (tampil di atas gradien) */
.card::before {
    content: attr(data-title);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    z-index: 3;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.card:hover::before {
    opacity: 1;
    transform: translateY(0);
}

/* ===== BADGE: Durasi (kiri bawah gambar) ===== */
.badge-duration {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 4;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

/* ===== BADGE: Rating (kanan bawah gambar) ===== */
.badge-rating {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffd700;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 4;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

/* ===== BADGE: Featured (kiri atas gambar) ===== */
.badge-featured {
    position: absolute;
    top: 6px;
    left: 6px;
    background: linear-gradient(135deg, #ffd700, #e8a800);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(232, 168, 0, 0.4);
}

/* ===== CARD META ===== */
.card-meta {
    padding: 8px 2px 2px;
    background: var(--card-meta-bg);
}

.card-date-views {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.card-date-views span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.card-title {
    font-size: 12px;
    color: var(--text);
    line-height: 1.4;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Inter', 'Noto Sans JP', 'Noto Sans SC',
        'Hiragino Kana', 'Yu Gothic', 'Meiryo',
        'PingFang SC', 'Microsoft YaHei',
        'Malgun Gothic', sans-serif;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px 0 8px;
    flex-wrap: wrap;
}

.page-btn {
    background: var(--page-btn-bg);
    border: none;
    border-radius: 8px;
    min-width: 32px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--page-btn-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.page-btn:hover:not(.disabled):not(.active) {
    background: var(--page-btn-hover-bg);
    transform: translateY(-1px);
}

.page-btn.active {
    background: #006600;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 102, 0, 0.3);
}

.page-btn.disabled {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.3);
    cursor: default;
}

.page-info {
    background: var(--page-info-bg);
    border-radius: 8px;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--page-info-color);
    white-space: nowrap;
}

.page-ellipsis {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 700;
    padding: 0 2px;
}

/* ===== AD SPACE ===== */
.ad-space {
    background: linear-gradient(135deg, #0f0f23, #16213e);
    border-radius: 8px;
    margin: 16px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.2);
    font-size: 12px;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 60px;
    overflow: hidden;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--footer-bg);
    border-radius: 14px;
    padding: 24px 20px;
    text-align: center;
    margin: 16px auto 40px;
    max-width: 1200px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.footer a {
    color: var(--footer-link-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--footer-link-hover);
    text-decoration: underline;
}

.footer p {
    font-size: 11px;
    color: var(--footer-p-color);
    margin-top: 6px;
}


/* Animasi modal masuk */
@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== VIDEO PLAYER MODAL ===== */
.player-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.player-overlay.show {
    display: flex;
}

.player-content {
    background: #111;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    position: relative;
    animation: modalIn 0.3s ease;
    border: 1px solid rgba(232, 168, 0, 0.3);
    overflow: hidden;
}

.player-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-close:hover {
    background: rgba(232, 168, 0, 0.8);
    color: #000;
    transform: scale(1.1);
}

.player-iframe-wrapper {
    width: 100%;
    background: #000;
}

.player-iframe-wrapper iframe {
    display: block;
    width: 100%;
    height: 400px;
    border: none;
}

.player-info {
    padding: 16px 20px;
}

.player-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.player-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.player-open-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #e8a800, #d49a00);
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}

.player-open-tab:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 168, 0, 0.3);
}


/* ===== NO RESULTS & EMPTY STATE ===== */
.no-results,
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: var(--text-secondary);
    font-size: 15px;
}

.no-results .emoji {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.empty-svg {
    width: 100px;
    height: 100px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.empty-message {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.empty-btn,
.error-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #e8a800, #d49a00);
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.empty-btn:hover,
.error-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(232, 168, 0, 0.3);
}

/* ===== ERROR STATE ===== */
.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
}

.error-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.error-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ===== IMAGE SKELETON ===== */
.img-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    z-index: 10;
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===== SKELETON CARD (full card placeholder) ===== */
.skeleton-card {
    pointer-events: none;
}

.skeleton-text {
    display: block;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #e8a800, #d49a00);
    color: #000;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 900;
    box-shadow: 0 4px 16px rgba(232, 168, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 24px rgba(232, 168, 0, 0.5);
}

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

/* Tablet landscape */
@media (max-width: 900px) {
    .header-inner {
        flex-wrap: wrap;
    }

}

/* Tablet portrait */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .nav-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
        padding-top: 5px;
    }

    .search-box {
        order: 2;
    }

    .search-box input {
        width: 110px;
    }

    .search-box input:focus {
        width: 150px;
    }

    .theme-toggle {
        order: 2;
    }

    .card-grid {
        gap: 12px;
    }

    .card-title {
        font-size: 13px;
    }

    .player-iframe-wrapper iframe {
        height: 260px;
    }
}

/* Mobile - fullscreen player modal */
@media (max-width: 600px) {
    .player-overlay {
        padding: 0;
        align-items: stretch;
    }

    .player-content {
        max-width: 100%;
        border-radius: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .player-iframe-wrapper {
        flex-shrink: 0;
    }

    .player-iframe-wrapper iframe {
        height: 240px;
    }

    .player-info {
        flex: 1;
        overflow-y: auto;
    }
}

/* Mobile small */
@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 16px;
    }

    .card-title {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    .content-wrapper {
        padding: 12px 10px;
    }

    .logo {
        font-size: 20px;
    }

    .nav-tab {
        font-size: 12px;
        padding: 6px 12px;
    }

    .verify-btn {
        margin-left: 10px;
        margin-right: 10px;
        font-size: 14px;
    }

    .footer {
        margin-left: 10px;
        margin-right: 10px;
    }

    .banner {
        padding: 10px 8px 4px;
    }


    .page-info {
        font-size: 11px;
        padding: 3px 8px;
    }

    .back-to-top {
        width: 38px;
        height: 38px;
        font-size: 15px;
        bottom: 18px;
        left: 18px;
    }

    .pagination {
        gap: 4px;
    }

    .page-btn {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Mobile min (375px) */
@media (max-width: 375px) {
    .header-inner {
        gap: 8px;
        padding: 0;
    }

    .logo {
        font-size: 18px;
    }

    .search-box input {
        width: 90px;
        font-size: 12px;
        padding: 6px 50px 6px 10px;
    }

    .search-box input:focus {
        width: 120px;
    }

    .card-grid {
        gap: 12px;
    }

    .badge-duration,
    .badge-rating {
        font-size: 9px;
        padding: 1px 4px;
    }
}

/* ===== VIRAL FILTER BAR ===== */
.viral-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0 16px;
    justify-content: flex-start;
}

.viral-filter-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.viral-filter-btn:hover {
    background: rgba(232, 168, 0, 0.15);
    border-color: var(--accent);
    color: var(--text);
}

.viral-filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 700;
}

[data-theme="light"] .viral-filter-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-secondary);
}

[data-theme="light"] .viral-filter-btn:hover {
    background: rgba(232, 168, 0, 0.2);
}

/* ===== KATEGORI GRID ===== */
.kategori-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 10px 0 20px;
}

.kategori-card-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-family: inherit;
    padding: 16px 10px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-align: center;
}

.kategori-card-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(232, 168, 0, 0.35);
}

.kategori-icon {
    font-size: 24px;
    line-height: 1;
}

.kategori-label {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
}

[data-theme="light"] .kategori-card-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

/* ===== CJK FONT FIX FOR PLAYER & STATES ===== */
.player-title,
.empty-message,
.error-message {
    font-family: 'Inter', 'Noto Sans JP', 'Noto Sans SC',
        'Hiragino Kana', 'Yu Gothic', 'Meiryo',
        'PingFang SC', 'Microsoft YaHei',
        'Malgun Gothic', sans-serif;
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 480px) {
    .kategori-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .viral-filter-bar {
        gap: 6px;
        padding: 10px 0 12px;
    }

    .viral-filter-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* ===== THUMBNAIL HOVER PREVIEW — Progress bar ===== */
.thumb-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.thumb-progress-bar.active {
    opacity: 1;
}

.thumb-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #e8a800, #ffd700);
    border-radius: 0 2px 2px 0;
    width: calc((var(--thumb-index, 0) + 1) / var(--thumb-count, 15) * 100%);
    transition: width 0.3s ease;
}

/* ===== SORT BAR ===== */
.sort-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0 14px;
    justify-content: center;
}

.sort-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sort-btn:hover {
    background: rgba(232, 168, 0, 0.12);
    border-color: rgba(232, 168, 0, 0.4);
    color: var(--text);
}

.sort-btn.active {
    background: linear-gradient(135deg, #e8a800, #d49a00);
    border-color: #e8a800;
    color: #000;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(232, 168, 0, 0.3);
}

[data-theme="light"] .sort-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .sort-btn:hover {
    background: rgba(232, 168, 0, 0.15);
}

/* ===== CARD KEYWORD TAGS ===== */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 5px;
}

.card-tag {
    display: inline-block;
    background: rgba(232, 168, 0, 0.1);
    border: 1px solid rgba(232, 168, 0, 0.2);
    color: var(--accent);
    font-size: 9px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-tag:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    transform: translateY(-1px);
}

[data-theme="light"] .card-tag {
    background: rgba(232, 168, 0, 0.08);
    border-color: rgba(232, 168, 0, 0.25);
}

/* ===== PLAYER MODAL TAGS ===== */
.player-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 12px;
}

.player-tag {
    display: inline-block;
    background: rgba(232, 168, 0, 0.1);
    border: 1px solid rgba(232, 168, 0, 0.25);
    color: #e8a800;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.player-tag:hover {
    background: #e8a800;
    color: #000;
    border-color: #e8a800;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(232, 168, 0, 0.3);
}

/* ===== RESPONSIVE: Sort bar & tags mobile ===== */
@media (max-width: 480px) {
    .sort-bar {
        gap: 4px;
        padding: 6px 0 10px;
    }

    .sort-btn {
        font-size: 10px;
        padding: 4px 8px;
    }

    .card-tag {
        font-size: 8px;
        padding: 1px 5px;
    }

    .player-tags {
        gap: 4px;
    }

    .player-tag {
        font-size: 10px;
        padding: 3px 8px;
    }
}