﻿/* BBS Forum Style - Dark Slate and Indigo Accent */
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-meta: #94a3b8;
    --primary-indigo: #6366f1;
    --primary-indigo-hover: #4f46e5;
    --border-slate: #334155;
    --bg-avatar: #475569;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    font-size: 14px;
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-indigo);
}

.container-bbs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header & Navigation */
header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-slate);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.bbs-logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-indigo);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    flex: 1;
    max-width: 400px;
    min-width: 250px;
}

.search-form {
    display: flex;
    width: 100%;
}

.search-input {
    flex: 1;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-slate);
    border-right: none;
    border-radius: 6px 0 0 6px;
    padding: 8px 12px;
    color: var(--text-main);
    outline: none;
    font-size: 13px;
}

.search-input:focus {
    border-color: var(--primary-indigo);
}

.search-btn {
    background-color: var(--primary-indigo);
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: background-color 0.2s;
}

.search-btn:hover {
    background-color: var(--primary-indigo-hover);
}

.nav-row {
    border-top: 1px solid var(--border-slate);
    padding: 10px 0;
    overflow-x: auto;
    white-space: nowrap;
}

.nav-row::-webkit-scrollbar {
    display: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-links a {
    color: var(--text-meta);
    font-weight: 600;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
}

.nav-links a.active, .nav-links a:hover {
    color: #fff;
    background-color: var(--primary-indigo);
}

/* Layout */
.main-wrapper {
    display: flex;
    gap: 20px;
    margin: 20px auto;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Forum Boards & Threads */
.bbs-board-header {
    background-color: var(--bg-card);
    border: 1px solid var(--border-slate);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.board-info h1 {
    font-size: 18px;
    font-weight: 800;
}

.board-stats {
    font-size: 12px;
    color: var(--text-meta);
    margin-top: 4px;
}

.thread-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.thread-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-slate);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 15px;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}

.thread-item:hover {
    border-color: var(--primary-indigo);
    transform: translateY(-1px);
}

.thread-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--bg-avatar);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.thread-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thread-details {
    flex: 1;
    min-width: 0;
}

.thread-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.thread-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    color: #fff;
    background-color: var(--primary-indigo);
}

.thread-badge.sponsored {
    background-color: #f59e0b;
}

.thread-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    word-break: break-all;
}

.thread-meta {
    font-size: 12px;
    color: var(--text-meta);
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.thread-excerpt {
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.thread-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    color: var(--text-meta);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 10px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Sidebar Widgets */
.sidebar-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border-slate);
    border-radius: 8px;
    padding: 16px;
}

.widget-title {
    font-size: 15px;
    font-weight: bold;
    border-left: 3px solid var(--primary-indigo);
    padding-left: 10px;
    margin-bottom: 15px;
    color: var(--text-main);
}

.sidebar-threads-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-thread-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-thread-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-thread-rank {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    background-color: var(--bg-avatar);
}

.sidebar-thread-item:nth-child(1) .sidebar-thread-rank { background-color: #ef4444; }
.sidebar-thread-item:nth-child(2) .sidebar-thread-rank { background-color: #f97316; }
.sidebar-thread-item:nth-child(3) .sidebar-thread-rank { background-color: #f59e0b; }

.sidebar-thread-title {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bbs-tag {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-slate);
    color: var(--text-meta);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    transition: all 0.2s;
}

.bbs-tag:hover {
    color: #fff;
    background-color: var(--primary-indigo);
    border-color: var(--primary-indigo);
}

/* Play Page & Player */
.play-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-slate);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.play-header {
    margin-bottom: 15px;
}

.play-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    color: #fff;
}

.player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #000;
    border-radius: 6px;
    overflow: visible;
    margin-bottom: 20px;
    border: 1px solid var(--border-slate);
}

.player-iframe-container {
    width: 100%;
    height: 100%;
}

.player-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.play-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn-indigo {
    background-color: var(--primary-indigo);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-indigo:hover {
    background-color: var(--primary-indigo-hover);
    color: #fff;
}

.play-content-section {
    margin-top: 25px;
    border-top: 1px solid var(--border-slate);
    padding-top: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--primary-indigo);
}

.vod-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    color: var(--text-meta);
}

.vod-detail-item {
    font-size: 13px;
}

.vod-desc-text {
    line-height: 1.7;
    color: #cbd5e1;
    font-size: 13.5px;
}

/* BBS Reply / Comments Section */
.reply-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-slate);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.reply-input-box {
    margin-bottom: 20px;
}

.reply-textarea {
    width: 100%;
    height: 80px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-slate);
    border-radius: 6px;
    padding: 10px;
    color: var(--text-main);
    resize: none;
    font-size: 13px;
    outline: none;
    margin-bottom: 10px;
}

.reply-textarea:focus {
    border-color: var(--primary-indigo);
}

.reply-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reply-post {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 15px;
}

.reply-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.reply-user-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-meta);
    margin-bottom: 6px;
}

.reply-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.reply-body {
    font-size: 13px;
    line-height: 1.6;
    color: #cbd5e1;
}

/* Footer styling */
footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-slate);
    padding: 30px 0;
    color: var(--text-meta);
    text-align: center;
    font-size: 12px;
    margin-top: 40px;
}

.footer-hot-links {
    margin-bottom: 20px;
    text-align: left;
}

.footer-hot-links h4 {
    color: var(--text-main);
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
}

.footer-hot-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-hot-item {
    font-size: 11px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-slate);
    color: var(--text-meta);
    padding: 3px 8px;
    border-radius: 4px;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    color: var(--text-meta);
    margin: 0 8px;
}

.footer-links a:hover {
    color: var(--primary-indigo);
}

/* Floating Ads */
.floating-ad { position: fixed; top: 50%; transform: translateY(-50%); width: 130px; z-index: 999999; }

.floating-ad-left {
    left: 15px;
}

.floating-ad-right {
    right: 15px;
}

.bottom-floating-ad {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 728px;
    background: #000;
    border: 2px solid var(--primary-indigo);
    border-bottom: none;
    z-index: 1000;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    border-radius: 8px 8px 0 0;
}

.bottom-floating-ad img {
    max-width: 100%;
    height: auto;
    max-height: 90px;
    display: block;
    margin: 0 auto;
}

.bottom-floating-ad-close {
    position: absolute;
    top: -12px;
    right: 10px;
    background: var(--primary-indigo);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Ad pre-roll count down */
.ad-preroll-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.ad-preroll-overlay a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.ad-preroll-overlay img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ad-preroll-timer {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    border: 1px solid rgba(255,255,255,0.2);
    pointer-events: none;
}

.ad-preroll-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #f59e0b;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 992px) {
    .main-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .floating-ad { position: fixed; top: 50%; transform: translateY(-50%); width: 130px; z-index: 999999; }
}

@media screen and (max-width: 768px) {
    .floating-ad {
        display: block !important;
        width: 80px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 999999 !important;
    }
}






/* GLOBAL FLOATING ADS FIX */
.floating-ad-container {
    position: absolute !important;
    top: 50%;
    transform: translateY(-50%) !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    transition: top 0.5s cubic-bezier(0.23, 1, 0.32, 1) !important;
}
.floating-ad-container-left {
    left: 10px !important;
    right: auto !important;
}
.floating-ad-container-right {
    right: 10px !important;
    left: auto !important;
}

/* Hide standalone ads to prevent FOUC (Flash of Unstyled Content) layout shift */
.floating-ad, .floating-ad-esi {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Reveal and format them correctly once JS wraps them in the container */
.floating-ad-container .floating-ad, 
.floating-ad-container .floating-ad-esi {
    position: relative !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    width: 140px !important;
    display: block !important;
    margin: 0 !important;
}

.floating-ad img, .floating-ad-esi img {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
    display: block !important;
    margin: 0 !important;
}
@media screen and (max-width: 768px) {
    .floating-ad-container .floating-ad, 
    .floating-ad-container .floating-ad-esi {
        width: 110px !important;
    }
}

