:root {
    --primary: #e50914;
    --bg: #141414;
    --surface: #1f1f1f;
    --text: #ffffff;
    --text-sec: #b3b3b3;
}

* {
    box-sizing: border_box;
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
}

header {
    padding: 20px 4%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 10%, transparent);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    color: var(--primary);
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.hero {
    height: 40vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 4%;
    background: linear-gradient(to top, var(--bg), transparent), url('https://source.unsplash.com/random/1920x1080/?cinema,dark') no-repeat center center/cover;
}

.episodes-container {
    padding: 20px 4%;
}

h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    background-color: var(--surface);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
    position: relative;
}

.card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.card-img-placeholder {
    width: 100%;
    height: 140px;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 3rem;
    position: relative;
}

.card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.card-content {
    padding: 15px;
}

.card-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-sec);
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-live {
    background-color: var(--primary);
    color: white;
    animation: pulse 1.5s infinite;
}

.badge-vod {
    background-color: rgba(0,0,0,0.6);
    border: 1px solid white;
}

.locked {
    opacity: 0.5;
    pointer-events: none;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Chat Layout */
.watch-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.video-section {
    flex: 1;
    background: black;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

video {
    width: 100%;
    max-height: 100vh;
}

.chat-sidebar {
    width: 350px;
    background-color: var(--surface);
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid #333;
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    font-size: 0.9rem;
}

.username {
    color: var(--text-sec);
    font-weight: bold;
    margin-right: 5px;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid #333;
    display: flex;
}

input[type="text"] {
    flex: 1;
    padding: 10px;
    background: #333;
    border: none;
    color: white;
    border-radius: 4px;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    margin-left: 10px;
    cursor: pointer;
    border-radius: 4px;
}

/* Modal for Nickname */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.modal input {
    margin: 20px 0;
    width: 100%;
}
