/* --- 1. GLOBAL RESET & CORE --- */
* { box-sizing: border-box; }

:root {
    --primary: #E50914; 
    --dark: #0f0f0f;
    --header-bg: rgba(15, 15, 15, 0.95);
    --surface: #1f1f1f;
    --surface-hover: #333;
    --text-main: #ffffff;
    --text-muted: #d1d1d1; /* AAA Contrast */
    --border: rgba(255, 255, 255, 0.15);
    --header-height: 70px;
}

body {
    font-family: 'Poppins', 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--dark);
    color: var(--text-main);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- 2. HEADER --- */
header {
    background-color: var(--header-bg);
    will-change: transform; /* Performance Hint */
    height: var(--header-height);
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
}
.logo span { color: var(--primary); }
.logo img { height: 40px; width: auto; object-fit: contain; }

nav { display: flex; gap: 30px; align-items: center; }

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 0;
    position: relative;
    transition: color 0.2s ease-in-out;
}

nav a:hover, nav a.active { color: var(--text-main); }

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary);
    transition: width 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}
nav a:hover::after, nav a.active::after { width: 100%; }

.menu-toggle { display: none; background: none; border: none; color: white; font-size: 1.8rem; cursor: pointer; }

@media (max-width: 900px) {
    header { padding: 0 20px; }
    .menu-toggle { display: block; }
    nav {
        position: absolute; top: var(--header-height); left: 0; width: 100%;
        background-color: #121212; flex-direction: column; gap: 0;
        max-height: 0; overflow: hidden;
        transition: max-height 0.3s ease-out;
        border-bottom: 1px solid var(--border);
    }
    nav.active { max-height: 400px; }
    nav a { width: 100%; text-align: center; padding: 18px; border-bottom: 1px solid rgba(255,255,255,0.03); margin: 0; }
    nav a::after { display: none; }
}

/* --- 3. MAIN LAYOUT --- */
main {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.container { 
    max-width: 1600px; 
    margin: 0 auto; 
    padding: 30px 24px; 
    width: 100%;
}

.section-title { font-size: 1.5rem; margin: 30px 0 20px; font-weight: 700; border-left: 4px solid var(--primary); padding-left: 15px; }

/* Grids */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    row-gap: 40px;
}

.card { 
    display: block; 
    text-decoration: none; 
    color: inherit; 
    transition: transform 0.2s ease;
    will-change: transform;
}
.card:hover { transform: translateY(-4px); }

.card-media-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.card-media {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover;
}

.card-title {
    margin: 0 0 6px 0; font-size: 1rem; font-weight: 600; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { font-size: 0.85rem; color: var(--text-muted); }

/* --- 4. HERO SLIDER --- */
.hero-slider { position: relative; width: 100%; height: 60vh; overflow: hidden; background: #000; }
.hero-slide { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    opacity: 0; 
    transition: opacity 0.8s ease-in-out; 
    display: flex; align-items: flex-end; 
    pointer-events: none;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }

.hero-bg-img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay { 
    position: relative; z-index: 1;
    background: linear-gradient(to top, #0f0f0f 10%, transparent 90%); 
    width: 100%; padding: 40px 5%; 
}
.hero-tag { background: var(--primary); color: white; padding: 5px 10px; font-weight: bold; font-size: 0.8rem; border-radius: 4px; display: inline-block; margin-bottom: 10px; }
.hero-title { font-size: 3rem; margin: 0 0 10px 0; text-shadow: 2px 2px 4px black; line-height: 1.1; }
.hero-btn { background: white; color: black; padding: 10px 25px; text-decoration: none; font-weight: bold; border-radius: 30px; display: inline-block; transition: background 0.2s; }
.hero-btn:hover { background: #ccc; }

@media(max-width:768px) { 
    .hero-slider { height: 50vh; } 
    .hero-title { font-size: 1.8rem; } 
}

/* --- 5. VIEW PAGE STYLES (CRITICAL RESTORE) --- */
.view-container {
    max-width: 1700px;
    margin: 0 auto;
    padding: 30px 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px; /* Video | Sidebar */
    gap: 24px;
    align-items: start;
    width: 100%;
}

.main-stage { min-width: 0; width: 100%; }

/* Video Player */
.video-player-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.video-player-wrapper iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}
.video-player-wrapper.shorts-mode {
    padding-bottom: 0; height: 80vh; width: 100%; max-width: 500px; margin: 0 auto;
}

/* Info & Actions */
.content-header { margin: 20px 0 15px; }
.page-title { font-size: 1.4rem; font-weight: 700; margin: 0; line-height: 1.3; }

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.channel-info { display: flex; align-items: center; gap: 12px; }

/* FIX FOR LOGO SIZE ON PC */
.channel-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--surface);
    display: flex; align-items: center; justify-content: center;
}
.channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.channel-text h4 { margin: 0; font-size: 1rem; color: var(--text-main); }
.channel-text span { font-size: 0.8rem; color: var(--text-muted); }

.share-actions { display: flex; gap: 10px; }
.btn-pill {
    background-color: var(--surface);
    color: var(--text-main);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-pill:hover { background-color: var(--surface-hover); }

/* Description Box */
.description-box {
    background-color: var(--surface);
    border-radius: 12px;
    padding: 15px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
    margin-top: 15px;
}
.views-date { font-weight: 700; font-size: 0.9rem; display: block; margin-bottom: 8px; }

/* Sidebar */
.sidebar { width: 100%; }
.sidebar h3 { font-size: 1.1rem; margin-top: 0; margin-bottom: 15px; }
.sidebar-grid { display: flex; flex-direction: column; gap: 12px; }

.sidebar-card {
    display: flex; gap: 10px; text-decoration: none; color: inherit;
    transition: background 0.2s;
    border-radius: 8px;
    padding: 5px;
}
.sidebar-card:hover { background: var(--surface); }

.sidebar-thumb {
    width: 160px; height: 90px;
    border-radius: 8px;
    background-size: cover; background-position: center;
    flex-shrink: 0;
    background-color: #000;
}
.sidebar-info h4 {
    margin: 0 0 5px 0; font-size: 0.9rem; font-weight: 600;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sidebar-info small { color: var(--text-muted); font-size: 0.8rem; display:block;}
.badge-new { background: var(--surface-hover); padding: 2px 5px; border-radius: 3px; font-size: 0.7rem; }

/* Responsive View Page */
@media (max-width: 1024px) {
    .view-container { grid-template-columns: 1fr; }
    .video-player-wrapper.shorts-mode { max-width: 100%; height: 75vh; }
}

/* Video Page Grid Fix */
.video-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px; row-gap: 30px;
}
@media (max-width: 768px) {
    .video-page-grid { grid-template-columns: 1fr; } /* 1 Column Mobile */
}

/* --- FOOTER --- */
footer {
    background-color: #0a0a0a;
    padding: 40px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    margin-top: auto;
}
.footer-links a { color: var(--text-muted); margin: 0 10px; text-decoration: none; }
.footer-links a:hover { color: var(--primary); }