/* ==========================================================================
   FRONTEND HOMEPAGE DEDICATED STYLES
   - Unified Portrait Grid (Every Video & Multi-Image Post has Identical Size)
   - Multi-Image Auto-Slideshow Transition (1-2s Smooth Crossfade like Reels)
   - Real Database Views & Counts (Zero Fake/Demo Stats)
   - Integrated In-Feed Monetization Ads
   - Dual Theme Support: 3D Cream Clay (Light) & Obsidian Cyberpunk (Dark)
   Page: index.php
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. HERO BANNER & ANIMATED TYPOGRAPHY
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   1. HERO BANNER & COMPACT TYPOGRAPHY
   -------------------------------------------------------------------------- */
.hero-banner {
    padding: 10px 0 2px;
    text-align: center;
}

.hero-title-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: fit-content;
    margin: 0 auto;
    padding: 6px 18px;
    border-radius: 999px;
    text-align: center;
    transition: all 0.25s ease;
}

.hero-title,
.hero-title.anime-animated-title {
    font-family: var(--font-heading, 'Outfit');
    font-size: 14px !important;
    font-weight: 800;
    margin: 0;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 6px;
}

.title-glow-line {
    display: none !important;
}

/* Light Theme: Compact Hero Pill */
[data-theme="light"] .hero-title-wrapper {
    background: #ffffff !important;
    border: 1.5px solid #ffffff !important;
    box-shadow: 0 3px 0 #ded6cb, 0 4px 10px rgba(65, 50, 35, 0.05) !important;
}

[data-theme="light"] .title-gradient {
    background: linear-gradient(135deg, #3d2315 20%, #ee7059 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

[data-theme="light"] .title-ampersand {
    color: #ee7059 !important;
    font-weight: 800;
}

[data-theme="light"] .title-highlight {
    background: linear-gradient(135deg, #ea6e56, #f78d78) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Dark Theme: Compact Hero Pill */
:root:not([data-theme="light"]) .hero-title-wrapper,
[data-theme="dark"] .hero-title-wrapper {
    background: #141b2c !important;
    border: 1.5px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 3px 0 #0b0f19, 0 4px 10px rgba(0, 0, 0, 0.4) !important;
}

:root:not([data-theme="light"]) .title-gradient,
[data-theme="dark"] .title-gradient {
    background: linear-gradient(135deg, #ffffff 30%, #ff2a6d 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

:root:not([data-theme="light"]) .title-ampersand,
[data-theme="dark"] .title-ampersand {
    color: #05d9e8 !important;
    font-weight: 800;
}

:root:not([data-theme="light"]) .title-highlight,
[data-theme="dark"] .title-highlight {
    background: linear-gradient(135deg, #ff2a6d, #ff758c) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* --------------------------------------------------------------------------
   2. UNIFIED BLENDED GRID SYSTEM (All Cards Identical Shape & Size!)
   -------------------------------------------------------------------------- */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 18px;
    align-items: stretch;
}

/* --------------------------------------------------------------------------
   3. UNIFIED POSTER CARD (Used for both Shorts and Photo Posts)
   -------------------------------------------------------------------------- */
.anime-poster-card {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    cursor: pointer;
    content-visibility: auto;
    contain-intrinsic-size: 185px 330px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.poster-media {
    overflow: hidden;
    position: relative;
    background: #110e0c;
    aspect-ratio: 9 / 16;
    contain: paint;
}

.poster-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.poster-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Multi-Image Auto-Slideshow Transition */
.post-slideshow-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 9 / 16;
    background: #110e0c;
    contain: paint;
}

.post-slideshow-track {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.post-slide-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.75s ease-in-out, transform 1.2s ease-out;
    transform: scale(1.02);
    pointer-events: none;
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.post-slide-img.active {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
}

/* Modern Glassmorphic Poster Badges (Hot, Viral, Photos, Pinned) */
.poster-badge {
    position: absolute;
    top: 9px;
    left: 9px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3.5px 9px 3.5px 8px;
    border-radius: 999px;
    font-family: var(--font-heading, 'Outfit'), system-ui, -apple-system, sans-serif;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    z-index: 3;
    color: #ffffff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.anime-poster-card:hover .poster-badge {
    transform: translateY(-1px) scale(1.03);
}

.poster-badge-hot {
    background: linear-gradient(135deg, rgba(255, 23, 68, 0.94) 0%, rgba(255, 82, 82, 0.94) 45%, rgba(255, 145, 0, 0.94) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 14px rgba(255, 23, 68, 0.45);
}

.poster-badge-popular {
    background: linear-gradient(135deg, rgba(255, 143, 0, 0.94) 0%, rgba(255, 179, 0, 0.94) 50%, rgba(255, 213, 79, 0.94) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 14px rgba(255, 143, 0, 0.45);
}

.poster-badge-trending {
    background: linear-gradient(135deg, rgba(0, 176, 255, 0.94) 0%, rgba(0, 145, 234, 0.94) 50%, rgba(41, 121, 255, 0.94) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 14px rgba(0, 176, 255, 0.45);
}

.poster-badge-viral {
    background: linear-gradient(135deg, rgba(213, 0, 249, 0.94) 0%, rgba(170, 0, 255, 0.94) 50%, rgba(245, 0, 87, 0.94) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 14px rgba(213, 0, 249, 0.45);
}

.poster-badge-ultra {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.94) 0%, rgba(0, 200, 83, 0.94) 50%, rgba(0, 176, 255, 0.94) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 14px rgba(0, 230, 118, 0.45);
}

.poster-badge-featured {
    background: linear-gradient(135deg, rgba(255, 179, 0, 0.94) 0%, rgba(255, 143, 0, 0.94) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 14px rgba(255, 179, 0, 0.45);
}

.poster-badge-pinned {
    background: linear-gradient(135deg, rgba(255, 145, 0, 0.94) 0%, rgba(255, 109, 0, 0.94) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 14px rgba(255, 109, 0, 0.45);
}

.poster-badge-photos {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.94) 0%, rgba(101, 31, 255, 0.94) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 14px rgba(0, 229, 255, 0.45);
}

.poster-badge-post {
    background: linear-gradient(135deg, rgba(41, 121, 255, 0.94) 0%, rgba(21, 101, 192, 0.94) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 14px rgba(41, 121, 255, 0.45);
}

/* Center Play Button Overlay (Visible ONLY on Hover with Smooth Animation) */
.poster-hover-overlay {
    position: absolute;
    inset: 0;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0 !important;
    z-index: 5;
    pointer-events: none;
    border-radius: inherit;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.anime-poster-card:hover .poster-hover-overlay {
    opacity: 1 !important;
}

.poster-play-icon {
    width: 54px !important;
    height: 54px !important;
    border-radius: 50% !important;
    background: rgba(20, 18, 28, 0.72) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 2px solid rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45) !important;
    transform: scale(0.85) !important;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s, border-color 0.2s, box-shadow 0.2s !important;
}

.anime-poster-card:hover .poster-play-icon {
    transform: scale(1.08) !important;
    background: rgba(234, 110, 86, 0.92) !important;
    border-color: #ffffff !important;
    box-shadow: 0 6px 24px rgba(234, 110, 86, 0.5) !important;
}

.poster-play-icon svg {
    width: 22px !important;
    height: 22px !important;
    margin-left: 3px !important;
    fill: #ffffff !important;
    opacity: 0.95;
}

.poster-hover-views {
    display: none !important;
}

/* Card Information (Title, Real Views, Date) */
.poster-info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.poster-title {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.poster-sub {
    font-size: 11.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.poster-datetime {
    font-size: 10.5px;
}

/* YouTube Card Base: Clean, Transparent, Seamless */
.anime-poster-card,
[data-theme="light"] .anime-poster-card,
:root:not([data-theme="light"]) .anime-poster-card,
[data-theme="dark"] .anime-poster-card {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.anime-poster-card:hover,
[data-theme="light"] .anime-poster-card:hover,
:root:not([data-theme="light"]) .anime-poster-card:hover,
[data-theme="dark"] .anime-poster-card:hover {
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
}

.poster-media,
.yt-long-media,
.yt-short-media,
.post-slideshow-media {
    border-radius: 14px !important;
    overflow: hidden;
    position: relative;
    background: #0d0a14;
    box-shadow: none !important;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.anime-poster-card:hover .poster-media,
.anime-poster-card:hover .yt-long-media,
.anime-poster-card:hover .yt-short-media,
.anime-poster-card:hover .post-slideshow-media {
    transform: scale(1.015);
    box-shadow: none !important;
}

/* While video preview is running, only show play icon when user hovers */
.anime-poster-card.is-previewing .poster-hover-overlay {
    opacity: 0 !important;
    pointer-events: none;
}

.anime-poster-card.is-previewing:hover .poster-hover-overlay {
    opacity: 1 !important;
}

.anime-poster-card.is-previewing:hover .poster-play-icon {
    transform: scale(1.08) !important;
    background: rgba(234, 110, 86, 0.92) !important;
    border-color: #ffffff !important;
}

[data-theme="light"] .poster-title {
    color: #1a1523 !important;
}

[data-theme="light"] .poster-sub {
    color: #606060 !important;
}

[data-theme="light"] .poster-datetime {
    color: #767676 !important;
}

:root:not([data-theme="light"]) .poster-title,
[data-theme="dark"] .poster-title {
    color: #f1f1f5 !important;
}

:root:not([data-theme="light"]) .poster-sub,
[data-theme="dark"] .poster-sub {
    color: #aaa !important;
}

:root:not([data-theme="light"]) .poster-datetime,
[data-theme="dark"] .poster-datetime {
    color: #888 !important;
}

/* Glassmorphic Neon Glowing Badges in Dark Mode (No Harsh 3D Bevels) */
:root:not([data-theme="light"]) .poster-badge-hot,
[data-theme="dark"] .poster-badge-hot {
    background: linear-gradient(135deg, rgba(255, 23, 68, 0.95) 0%, rgba(255, 82, 82, 0.95) 45%, rgba(255, 145, 0, 0.95) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 16px rgba(255, 23, 68, 0.55) !important;
}

:root:not([data-theme="light"]) .poster-badge-popular,
[data-theme="dark"] .poster-badge-popular {
    background: linear-gradient(135deg, rgba(255, 143, 0, 0.95) 0%, rgba(255, 179, 0, 0.95) 50%, rgba(255, 213, 79, 0.95) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 16px rgba(255, 143, 0, 0.55) !important;
}

:root:not([data-theme="light"]) .poster-badge-trending,
[data-theme="dark"] .poster-badge-trending {
    background: linear-gradient(135deg, rgba(0, 176, 255, 0.95) 0%, rgba(0, 145, 234, 0.95) 50%, rgba(41, 121, 255, 0.95) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 16px rgba(0, 176, 255, 0.55) !important;
}

:root:not([data-theme="light"]) .poster-badge-viral,
[data-theme="dark"] .poster-badge-viral {
    background: linear-gradient(135deg, rgba(213, 0, 249, 0.95) 0%, rgba(170, 0, 255, 0.95) 50%, rgba(245, 0, 87, 0.95) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 16px rgba(213, 0, 249, 0.55) !important;
}

:root:not([data-theme="light"]) .poster-badge-ultra,
[data-theme="dark"] .poster-badge-ultra {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.95) 0%, rgba(0, 200, 83, 0.95) 50%, rgba(0, 176, 255, 0.95) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 16px rgba(0, 230, 118, 0.55) !important;
}

:root:not([data-theme="light"]) .poster-badge-photos,
[data-theme="dark"] .poster-badge-photos {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.95) 0%, rgba(101, 31, 255, 0.95) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 16px rgba(0, 229, 255, 0.55) !important;
}

:root:not([data-theme="light"]) .poster-badge-pinned,
[data-theme="dark"] .poster-badge-pinned {
    background: linear-gradient(135deg, rgba(255, 145, 0, 0.95) 0%, rgba(255, 109, 0, 0.95) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 16px rgba(255, 109, 0, 0.55) !important;
}

:root:not([data-theme="light"]) .poster-badge-post,
[data-theme="dark"] .poster-badge-post {
    background: linear-gradient(135deg, rgba(41, 121, 255, 0.95) 0%, rgba(21, 101, 192, 0.95) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 16px rgba(41, 121, 255, 0.55) !important;
}

/* ==========================================================================
   3.5 YOUTUBE DUAL FORMAT CARDS: LONG VIDEOS (16:9) & SHORTS (9:16)
   ========================================================================== */

/* Grid Column Spanning */
.yt-long-card {
    grid-column: span 2;
}

.yt-short-card {
    grid-column: span 1;
}

.post-poster-card {
    grid-column: span 1;
}

/* --- LONG VIDEO CARDS (16:9 Landscape Cinema) --- */
.yt-long-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.yt-long-media {
    aspect-ratio: 16 / 9 !important;
    position: relative;
    overflow: hidden;
    background: #0d0a14;
    border-radius: 14px !important;
    box-shadow: none !important;
}

.yt-duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2.5px 7px;
    border-radius: 5px;
    letter-spacing: 0.4px;
    z-index: 4;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.yt-long-info {
    display: flex;
    gap: 12px;
    padding: 12px 2px 2px 2px !important;
    align-items: flex-start;
}

.yt-long-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    display: block;
}

.yt-long-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yt-long-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.yt-long-title {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    font-family: var(--font-heading, 'Outfit');
}

.yt-long-title a {
    color: #f0f3fc;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

:root[data-theme="light"] .yt-long-title a {
    color: #2d2621;
}

.yt-long-title a:hover {
    color: #05d9e8 !important;
}

.yt-long-channel-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.yt-long-channel-name {
    font-size: 12px;
    color: #8e9bb5;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

:root[data-theme="light"] .yt-long-channel-name {
    color: #6b5e54;
}

.yt-long-channel-name:hover {
    color: #ffffff;
}

:root[data-theme="light"] .yt-long-channel-name:hover {
    color: #ea6e56;
}

.yt-long-meta-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: #5c6882;
}

:root[data-theme="light"] .yt-long-meta-row {
    color: #887a70;
}

.meta-dot {
    opacity: 0.6;
}

/* --- SHORTS CARDS (9:16 Vertical) --- */
.yt-short-card {
    position: relative;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.yt-short-media,
.post-slideshow-media {
    aspect-ratio: 9 / 16 !important;
    position: relative;
    border-radius: 14px !important;
    overflow: hidden;
    height: 100%;
    box-shadow: none !important;
}

.yt-shorts-pill-badge {
    display: none !important;
}

.yt-short-bottom-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 10px 12px;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 8, 16, 0.72) 45%, rgba(10, 8, 16, 0.96) 100%);
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
}

.yt-short-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff !important;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    font-family: var(--font-heading, 'Outfit');
}

.yt-short-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.88);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* --------------------------------------------------------------------------
   4. IN-FEED ADS MONETIZATION CARD
   -------------------------------------------------------------------------- */
.feed-ad-card {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin: 8px 0;
    padding: 14px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
}

[data-theme="light"] .feed-ad-card {
    background: rgba(250, 245, 238, 0.8) !important;
    border: 1.5px dashed rgba(65, 50, 35, 0.15) !important;
}

[data-theme="dark"] .feed-ad-card {
    background: rgba(15, 21, 35, 0.7) !important;
    border: 1px dashed rgba(255, 255, 255, 0.12) !important;
}

.feed-ad-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim, #887a70);
    margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   5. MOBILE RESPONSIVE SYSTEM (<= 768px Phones & Tablets)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {

    /* Ultra-Compact Hero Banner */
    .hero-banner {
        padding: 4px 0 2px !important;
    }

    .hero-title-wrapper {
        padding: 5px 14px !important;
        border-radius: 999px !important;
        max-width: 95% !important;
    }

    .hero-title,
    .hero-title.anime-animated-title {
        font-size: 13px !important;
        line-height: 1.25 !important;
        gap: 3px 5px !important;
    }

    .title-ampersand {
        font-size: 12px !important;
    }

    .title-glow-line {
        display: none !important;
    }

    /* 2-Columns Mobile Grid */
    .anime-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Long Video (16:9 Landscape) takes full width on mobile */
    .yt-long-card {
        grid-column: span 2 !important;
        contain-intrinsic-size: 320px 240px;
    }

    /* Shorts (9:16 Vertical) take 1 column each (side-by-side) */
    .yt-short-card {
        grid-column: span 1 !important;
        contain-intrinsic-size: 155px 280px;
    }

    .yt-long-info {
        padding: 10px 10px 10px 10px !important;
        gap: 10px !important;
    }

    .yt-long-avatar {
        width: 32px !important;
        height: 32px !important;
    }

    .yt-long-title {
        font-size: 13px !important;
        line-height: 1.3 !important;
    }

    .yt-long-channel-name,
    .yt-long-meta-row {
        font-size: 11px !important;
    }

    .anime-poster-card {
        contain-intrinsic-size: 160px 290px;
    }

    .poster-title {
        font-size: 12.5px !important;
    }

    .poster-info {
        padding: 8px 10px !important;
    }

    /* Natural Footer Clearance on Mobile */
    .site-footer {
        margin-top: 28px !important;
        padding-top: 18px !important;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
        position: relative !important;
        z-index: 10 !important;
    }
}

/* Extra Small Phones (<= 360px) */
@media (max-width: 360px) {
    .anime-grid {
        gap: 8px !important;
    }

    .hero-title {
        font-size: 12.5px !important;
    }
}

/* ==========================================================================
   FEATURE: INSTANT CATEGORY FILTER CHIPS (YouTube Style Pill Bar)
   ========================================================================== */
.category-chips-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 6px 18px;
    margin: 0 auto 10px;
    width: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-chips-bar::-webkit-scrollbar {
    display: none;
}

@media (max-width: 880px) {
    .category-chips-bar {
        justify-content: flex-start;
        padding-left: 14px;
        padding-right: 14px;
    }
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 999px;
    padding: 7px 16px;
    font-family: var(--font-heading, 'Outfit');
    font-size: 12.5px;
    font-weight: 700;
    color: #6b5e54;
    box-shadow: 0 4px 12px rgba(65, 50, 35, 0.05), inset 0 1px 2px #ffffff;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.category-chip:hover {
    color: #ea6e56;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(65, 50, 35, 0.08), inset 0 1px 2px #ffffff;
}

/* Distinct 3D Clay Gradient for Reels Mode Chip */
.chip-reels-launch {
    background: linear-gradient(135deg, #ff2a6d, #ff5e36) !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    border-radius: 999px !important;
    box-shadow:
        0 3px 0 #c9184a,
        0 6px 16px rgba(255, 42, 109, 0.35) !important;
    text-decoration: none !important;
    gap: 7px;
    padding: 7px 18px;
}

.chip-reels-launch:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow:
        0 4px 0 #a01037,
        0 8px 22px rgba(255, 42, 109, 0.5) !important;
    color: #ffffff !important;
}

.chip-reels-launch:active {
    transform: translateY(1px) !important;
    box-shadow: 0 1px 0 #c9184a, 0 3px 8px rgba(255, 42, 109, 0.3) !important;
}

.chip-reels-launch .live-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50% !important;
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff;
    animation: livePulse 1.2s infinite ease-in-out;
    display: inline-block;
    margin-left: 2px;
}

[data-theme="dark"] .chip-reels-launch {
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow:
        0 3px 0 #881337,
        0 6px 18px rgba(255, 42, 109, 0.45) !important;
}

.category-chip.active {
    background: linear-gradient(180deg, #f78d78, #ea6e56);
    color: #ffffff !important;
    border-color: #ffffff;
    box-shadow: 0 3px 0 #c7523c, 0 6px 16px rgba(234, 110, 86, 0.35);
    transform: translateY(-1px);
}

.chip-icon {
    font-size: 13px;
    line-height: 1;
}

.chip-count {
    font-size: 10.5px;
    font-weight: 800;
    background: rgba(65, 50, 35, 0.08);
    color: inherit;
    padding: 1px 6px;
    border-radius: 999px;
}

.category-chip.active .chip-count {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

/* Card Filtering Animation */
.anime-poster-card.filter-hidden,
.feed-ad-card.filter-hidden {
    display: none !important;
}

.anime-poster-card.filter-show {
    animation: chipFadeIn 0.3s ease forwards;
}

@keyframes chipFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Dark Theme Adjustments for Chips */
[data-theme="dark"] .category-chip {
    background: #111726;
    border-color: rgba(255, 255, 255, 0.08);
    color: #8e9bb5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .category-chip:hover {
    color: #ff2a6d;
    border-color: rgba(255, 42, 109, 0.4);
}

[data-theme="dark"] .category-chip.active {
    background: linear-gradient(135deg, #ff2a6d, #9d4edd);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 16px rgba(255, 42, 109, 0.5);
}

/* Mobile Optimization for Hero Title Pill */
@media (max-width: 768px) {
    .hero-banner {
        padding: 4px 0 2px;
    }
    .hero-title-wrapper {
        padding: 4px 12px;
    }
    .hero-title,
    .hero-title.anime-animated-title {
        font-size: 11.5px !important;
        gap: 3px 5px;
    }
}