/* Content2 Page - Browse-first content discovery styles */
/* Isolated CSS - delete this file along with content2-page.js to remove feature */

.content2-page {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.content2-header {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--discord-bg-secondary);
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--discord-divider);
}

.content2-header.header-hidden {
    top: -60px;
}

.content2-search-container {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--discord-input-bg);
    border-radius: 4px;
    padding: 8px 12px;
    max-width: 400px;
}

.content2-search-container .material-icons {
    color: var(--discord-text-muted);
    margin-right: 8px;
    font-size: 20px;
}

.content2-search-container input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--discord-text-normal);
    font-size: 14px;
    outline: none;
}

.content2-search-container input::placeholder {
    color: var(--discord-text-muted);
}

.content2-scroll-top-btn,
.content2-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--discord-text-muted);
    cursor: pointer;
    border-radius: 4px;
}

.content2-scroll-top-btn:hover,
.content2-settings-btn:hover {
    background: var(--discord-bg-hover);
    color: var(--discord-text-normal);
}

.content2-tabs {
    display: flex;
    gap: 4px;
    padding: 6px 16px;
    background: var(--discord-bg-primary);
    border-bottom: 1px solid var(--discord-divider);
    position: sticky;
    top: 53px;
    z-index: 9;
}

.content2-tabs.header-hidden {
    top: -100px;
}

.content2-tab {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--discord-text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.content2-tab:hover {
    background: var(--discord-bg-hover);
    color: var(--discord-text-normal);
}

.content2-tab.active {
    background: var(--discord-bg-tertiary);
    color: var(--discord-text-normal);
}

.content2-view {
    flex: 1;
    overflow-y: auto;
    overflow-anchor: none;
}

.content2-browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 16px;
}

.content2-browse-card {
    background: var(--discord-bg-secondary);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    text-align: center;
}

.content2-browse-card:hover {
    background: var(--discord-bg-tertiary);
}

.content2-browse-card-name {
    font-weight: 600;
    color: var(--discord-text-normal);
    margin-bottom: 4px;
    word-break: break-word;
}

.content2-browse-card-count {
    font-size: 12px;
    color: var(--discord-text-muted);
}

.content2-filtered-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--discord-bg-secondary);
}

.content2-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--discord-text-link);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
}

.content2-back-btn:hover {
    background: var(--discord-bg-hover);
}

.content2-filter-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--discord-text-normal);
}

.content2-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: var(--discord-text-muted);
}

.content2-empty-state .material-icons {
    font-size: 48px;
    margin-bottom: 16px;
}

.content2-empty-state p {
    font-size: 14px;
}

.content2-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: var(--discord-text-muted);
    font-size: 14px;
}

/* ===== Content Watch Page (direct-landing /content/item/{name}) ===== */
.watch-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
    min-height: 100dvh;
}
.watch-loading {
    padding: 48px 16px;
    color: #888;
    font-size: 15px;
}
.watch-main { min-width: 0; }
.watch-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}
.watch-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
}
.watch-title {
    font-size: 22px;
    font-weight: 600;
    color: #f0f0f0;
    margin: 16px 0 6px;
    line-height: 1.3;
}
.watch-desc {
    font-size: 14px;
    color: #aaa;
    margin: 0 0 14px;
}
.watch-meta-row,
.watch-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.watch-tags-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #777;
    margin-right: 4px;
}
.watch-chip {
    display: inline-block;
    padding: 5px 11px;
    background: #1a1a1a;
    color: #cfcfcf;
    border-radius: 999px;
    font-size: 13px;
    text-decoration: none;
}
a.watch-chip:hover { background: #2a2a2a; color: #fff; }
.watch-chip-plain { background: transparent; color: #999; padding-left: 0; padding-right: 0; }

/* Related rail */
.watch-related-title {
    font-size: 15px;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0 0 12px;
}
.watch-related-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.watch-related-card {
    display: flex;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    padding: 4px;
}
.watch-related-card:hover { background: #161616; }
.watch-related-thumb {
    flex: 0 0 140px;
    width: 140px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
}
.watch-related-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.watch-related-info { min-width: 0; padding-top: 2px; }
.watch-related-name {
    font-size: 13px;
    color: #e8e8e8;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.watch-related-sub { font-size: 12px; color: #888; margin-top: 3px; }

@media (max-width: 900px) {
    .watch-page { grid-template-columns: 1fr; gap: 16px; padding: 0 0 24px; }
    .watch-video-wrapper { border-radius: 0; }
    .watch-title, .watch-desc, .watch-meta-row, .watch-tags { padding-left: 12px; padding-right: 12px; }
    .watch-related { padding: 0 12px; }
    .watch-related-thumb { flex-basis: 120px; width: 120px; }
}

/* Watch page: the inner .abr-player-wrapper carries the modal's scoped Shaka styling
   (abr-player.css). Size/position it to fill the 16:9 .watch-video-wrapper box so Shaka's
   absolutely-positioned controls/container anchor correctly in the inline (non-modal) context. */
.watch-video-wrapper .abr-player-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Watch page: frame-preview thumbnail shown while hovering the Shaka seek bar (ported from
   the modal). Anchored to the inner .abr-player-wrapper (position:relative), sits just above
   the control bar; pointer-events:none so it never blocks scrubbing. */
.watch-video-wrapper .watch-frame-preview {
    position: absolute;
    bottom: 56px;
    width: 160px;
    z-index: 30;
    pointer-events: none;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.watch-video-wrapper .watch-frame-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #000;
}
.watch-video-wrapper .watch-frame-time {
    text-align: center;
    font-size: 12px;
    color: #fff;
    padding: 3px 0;
    background: rgba(0, 0, 0, 0.7);
}

/* Override: fill the 16:9 box ABSOLUTELY so the player is constrained from the very first
   paint. Fixes "video huge at first" — the <video>/poster briefly rendered at native
   resolution because height:100% couldn't resolve until Shaka mounted and forced a reflow.
   Later same-specificity rule, so it wins over the earlier position:relative declaration. */
.watch-video-wrapper > .abr-player-wrapper,
.watch-video-wrapper > video.watch-video,
.watch-video-wrapper > img.watch-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Watch page: back-to-browse pill (top-left, above the video) → /content */
.watch-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin: 0 0 12px;
    padding: 7px 14px 7px 10px;
    background: #1a1a1a;
    color: #cfcfcf;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}
.watch-back:hover { background: #2a2a2a; color: #fff; }
.watch-back .material-icons { font-size: 18px; }
@media (max-width: 900px) {
    .watch-back { margin-left: 12px; margin-top: 12px; }
}
