/* TrendClip Decluttered Responsive UI: Clean Audience Mode + Creator Intel Mode */
.btp-yt-card {
    position: relative;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.btp-yt-card:focus-visible,
.tc-save-btn:focus-visible,
.tc-cast-btn:focus-visible {
    outline: 3px solid #38bdf8 !important;
    outline-offset: 2px;
}
.btp-yt-card__thumb {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.btp-yt-card:hover .btp-yt-card__thumb-img {
    transform: scale(1.03);
    transition: transform 0.25s ease;
}

/* Bookmark button: clean on idle cards, visible on hover or when saved */
.tc-save-btn {
    opacity: 0;
    transition: opacity 0.15s ease;
}
.btp-yt-card:hover .tc-save-btn,
.tc-save-btn.is-saved {
    opacity: 1;
}

/* Free Tier: clean YouTube-like cards (hide VPH/Outlier/Velocity pills on normal free feeds, reveal on 3-card Pro preview) */
body.tc-tier-free #videosGrid:not(.tc-is-pro-preview) .btp-yt-card__metric-pill--vph,
body.tc-tier-free .btp-yt-card__metric-pill--outlier,
body.tc-tier-free .btp-yt-card__metric-pill--velocity,
body.tc-tier-free .btp-yt-card__metric-pill--accel,
body.tc-tier-free .btp-yt-card__sparkline {
    display: none !important;
}
.tc-gated-card {
    position: relative;
    filter: blur(6px);
    opacity: 0.52;
    pointer-events: none;
    user-select: none;
}

/* Bookmark button (Creator Mode / Hover) */
.tc-save-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 15;
    background: rgba(15, 19, 28, 0.88);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

/* Quick-Play & Cast Modals */
.tc-qp-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.tc-qp-overlay.is-open {
    display: flex;
}
.tc-qp-dialog {
    width: 100%;
    max-width: 920px;
    background: #0f131c;
    border: 1px solid #30363d;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75);
}
.tc-qp-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid #242c3d;
    color: #fff;
    gap: 10px;
}
.tc-qp-player {
    position: relative;
    padding-top: 56.25%;
    background: #000;
}
.tc-qp-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.tc-qp-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 18px;
    background: #131822;
}
.tc-cast-btn {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    padding: 7px 12px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tc-cast-btn:hover {
    background: #334155;
    color: #fff;
}

/* Watch Page Intelligence Drawer */
.tc-intel-drawer {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 16px;
    margin: 14px 0;
    color: #e6edf3;
}
.tc-intel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.tc-intel-cell {
    background: #161b22;
    border: 1px solid #242c3d;
    border-radius: 8px;
    padding: 10px 12px;
}
.tc-intel-cell small {
    display: block;
    color: #8b949e;
    font-size: 11px;
    text-transform: uppercase;
}
.tc-intel-cell strong {
    font-size: 16px;
    color: #58a6ff;
}

@media (max-width: 767px) {
    .btp-yt-navbar { padding: 0 8px !important; gap: 4px !important; }
    .btp-yt-brand-tagline, .btp-yt-topbar-dropdown__text, #tcTopbarModeLabel { display: none !important; }
    .tc-qp-foot { flex-direction: column; align-items: stretch; text-align: center; }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .btp-yt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (min-width: 1800px) {
    body { font-size: 18px; }
    .btp-yt-card__title a { font-size: 17px !important; line-height: 1.35 !important; }
}
.btp-yt-card__title a {
    color: #f1f5f9 !important;
}

/* YouTube-ToS-Compliant Borderless Scalable Miniplayer (PiP >= 200px height) */
.tc-mini-player {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 360px;
    height: 203px;
    background: #000;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.72);
    z-index: 950;
    display: none;
}
.tc-mini-player.is-open {
    display: block;
}
.tc-mini-player:fullscreen,
.tc-mini-player:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: 0 !important;
}
.tc-mini-actions {
    position: absolute;
    top: 8px;
    right: 48px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.92;
    transition: opacity 0.16s ease;
}
.tc-mini-player:hover .tc-mini-actions,
.tc-mini-player:focus-within .tc-mini-actions,
.tc-mini-player:hover .tc-mini-resize {
    opacity: 1;
}
@media (max-width: 767px) {
    .tc-mini-player {
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: calc(100vw - 16px) !important;
        max-width: 420px;
        height: auto !important;
        aspect-ratio: 16 / 9;
    }
    .tc-mini-actions { opacity: 1; right: 8px; }
    .tc-mini-btn { min-width: 40px; min-height: 40px; }
    .tc-mini-resize { display: none !important; }
}
.tc-mini-btn {
    background: rgba(15, 19, 28, 0.82);
    color: #fff;
    border: none;
    border-radius: 999px;
    height: 28px;
    min-width: 28px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    backdrop-filter: blur(6px);
    transition: background 0.12s, transform 0.12s;
}
.tc-mini-btn:hover {
    background: rgba(15, 19, 28, 0.96);
    transform: scale(1.06);
}
.tc-mini-resize {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 10;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(15, 19, 28, 0.82);
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: nwse-resize;
    opacity: 0;
    transition: opacity 0.16s ease;
    user-select: none;
}
.tc-mini-resize:hover {
    color: #fff;
    background: rgba(15, 19, 28, 0.96);
}
.tc-mini-frame {
    width: 100%;
    height: 100%;
    background: #000;
}
.tc-mini-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Loading Skeleton Cards (CLS Prevention) */
.tc-skeleton-card {
    background: #131822;
    border: 1px solid #1e293b;
    border-radius: 12px;
    overflow: hidden;
    padding-bottom: 12px;
}
.tc-skeleton-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(90deg, #161c28 25%, #232b3d 50%, #161c28 75%);
    background-size: 200% 100%;
    animation: tc-shimmer 1.4s infinite linear;
}
.tc-skeleton-line {
    height: 12px;
    margin: 10px 12px 0;
    border-radius: 6px;
    background: linear-gradient(90deg, #161c28 25%, #232b3d 50%, #161c28 75%);
    background-size: 200% 100%;
    animation: tc-shimmer 1.4s infinite linear;
}
.tc-skeleton-line.is-short { width: 58%; height: 10px; margin-top: 8px; }
@keyframes tc-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mobile Topbar Horizontal Pill Scroll & Clean Wrap */
@media (max-width: 768px) {
    .btp-yt-navbar {
        flex-wrap: wrap !important;
        height: auto !important;
        padding: 8px 12px !important;
        gap: 6px !important;
    }
    .btp-yt-navbar__left { order: 1; }
    .btp-yt-navbar__right { order: 2; margin-left: auto; }
    .btp-yt-navbar__center {
        order: 3;
        flex: 1 0 100% !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px 0 2px !important;
    }
    .btp-yt-navbar__center::-webkit-scrollbar { display: none; }
    .btp-yt-topbar-group {
        flex-wrap: nowrap !important;
        flex-shrink: 0 !important;
    }
    .btp-yt-topbar-pill { flex-shrink: 0; }
}

/* Trending Now Ticker Strip */
.tc-ticker-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(19, 24, 34, 0.85);
    border: 1px solid #1e293b;
    overflow: hidden;
    font-size: 12px;
}
.tc-ticker-badge {
    flex-shrink: 0;
    background: rgba(255, 56, 92, 0.16);
    color: #ff385c;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}
.tc-ticker-viewport {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}
.tc-ticker-track {
    display: inline-flex;
    align-items: center;
    gap: 28px;
    animation: tc-marquee 34s linear infinite;
}
.tc-ticker-bar:hover .tc-ticker-track { animation-play-state: paused; }
.tc-ticker-item {
    color: #cbd5e1;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tc-ticker-item:hover { color: #fff; }
.tc-ticker-vph { color: #38bdf8; font-weight: 700; }
@keyframes tc-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Search Autocomplete Dropdown */
.btp-yt-search-form { position: relative; }
.tc-search-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #131822;
    border: 1px solid #242c3d;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    overflow: hidden;
}
.tc-search-suggest.is-open { display: block; }
.tc-search-suggest__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 14px;
    color: #e2e8f0;
    font-size: 13px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.tc-search-suggest__item:last-child { border-bottom: 0; }
.tc-search-suggest__item:hover { background: rgba(56, 189, 248, 0.12); color: #fff; }
.tc-search-suggest__tag {
    font-size: 10px;
    text-transform: uppercase;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Watch History Indicator & Hide Watched Toggle */
.btp-yt-card.tc-is-watched {
    opacity: 0.68;
}
.btp-yt-card.tc-is-watched .btp-yt-thumb-wrap::after {
    content: "WATCHED";
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 4;
    background: rgba(15, 19, 28, 0.88);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.35);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.4px;
}
.tc-hide-watched-btn {
    background: #161b22;
    color: #cbd5e1;
    border: 1px solid #30363d;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tc-hide-watched-btn.is-active {
    border-color: #38bdf8;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
}

/* Language Selector & Hide Google Translate Top Banner */
.tc-lang-select {
    background: #131822;
    color: #e2e8f0;
    border: 1px solid #242c3d;
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    height: 32px;
}
.goog-te-banner-frame.skiptranslate,
iframe.VIpgJd-ZVi9od-ORHb-OEVmcd {
    display: none !important;
}
body {
    top: 0 !important;
}
