/* ==========================================
   AsiaTube HD - HDZOG 5-Column Widescreen Layout
   ========================================== */

:root {
    --bg-main: #f5f5f7;
    --bg-card: #ffffff;
    --border-color: #e2e2e8;
    
    --primary-red: #e60033;
    --primary-blue: #0066cc;
    --rating-green: #00aa55;
    
    --text-primary: #1a1a1a;
    --text-muted: #777777;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-full: 9999px;
}

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

body.light-theme {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 6px;
}

.logo-box {
    background: var(--primary-red);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.logo-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #111;
}

.highlight { color: var(--primary-red); }

.header-search {
    flex: 1;
    max-width: 600px;
    display: flex;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 8px 45px 8px 16px;
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
    transition: border 0.2s;
}

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

.search-btn {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 42px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.95rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-back-home {
    color: #444;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 4px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fcfcfc;
    transition: background 0.2s;
}

.btn-back-home:hover {
    background: #eee;
    color: #000;
}

.badge-18 {
    background: #333;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Multi-row Tag Cloud */
.tag-bar-section {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}

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

.tag-pill {
    background: #f0f0f4;
    border: 1px solid #e0e0e6;
    color: #444;
    padding: 5px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tag-pill:hover {
    background: #e4e4ec;
    color: #000;
}

.tag-pill.active {
    background: var(--primary-blue);
    color: #ffffff;
    border-color: var(--primary-blue);
}

/* Main Content Grid */
.main-body {
    padding: 20px 0 40px 0;
}

.grid-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ddd;
}

.grid-title-bar h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #222;
}

.grid-meta-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sort-dropdown {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    outline: none;
    font-size: 0.85rem;
}

/* 5-Column Widescreen Tube Grid Layout */
.tube-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

@media (max-width: 1100px) {
    .tube-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 850px) {
    .tube-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 550px) {
    .tube-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Compact Widescreen Video Card */
.tube-card {
    background: var(--bg-card);
    border: 1px solid #e2e2e8;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}

.tube-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    border-color: #bbb;
}

.card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0d0c1d;
}

.duration-tag {
    position: absolute;
    bottom: 5px; right: 5px;
    background: rgba(0,0,0,0.82);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 2px;
}

.card-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.7em;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: auto;
}

.rating-text {
    color: var(--rating-green);
    font-weight: 700;
}

/* Pagination Bar & Ellipsis Style */
.pagination-section {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.pagination-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.page-btn {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #333;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
    background: #e8e8f0;
    border-color: #999;
}

.page-btn.active {
    background: var(--primary-red);
    color: #fff;
    border-color: var(--primary-red);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 0 6px;
    color: #777;
    font-weight: 700;
    font-size: 1rem;
    user-select: none;
}

/* Dedicated Player Page Styles */
.player-page-main {
    padding: 24px 0 60px 0;
}

.main-embed-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-bottom: 16px;
}

.main-embed-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-meta-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 18px 20px;
    border-radius: 6px;
    margin-bottom: 28px;
}

.player-video-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 10px;
}

.player-meta-stats {
    display: flex;
    align-items: center;
    gap: 18px;
    color: #666;
    font-size: 0.9rem;
}

.badge-category {
    background: #eef2ff;
    color: var(--primary-blue);
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Related / Recommended Section */
.related-section {
    margin-top: 20px;
}

.section-title-bar {
    padding-bottom: 10px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--primary-red);
}

.section-title-bar h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.age-card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    text-align: center;
}

.age-icon { font-size: 3rem; color: var(--primary-red); margin-bottom: 12px; }
.age-card h2 { font-size: 1.4rem; margin-bottom: 10px; }
.age-desc { color: #666; font-size: 0.9rem; margin-bottom: 20px; }
.age-actions { display: flex; gap: 10px; }

.btn {
    flex: 1; padding: 10px; border-radius: 4px; border: none; cursor: pointer; font-weight: 700;
}
.btn-primary { background: var(--primary-red); color: #fff; }
.btn-secondary { background: #eee; color: #333; }

.site-footer {
    background: #fff; border-top: 1px solid var(--border-color); padding: 20px 0; text-align: center; font-size: 0.82rem; color: #777;
}
