:root {
    --bg-black: #0a0a0a;
    --bg-grey: #161616;
    --bg-card: #1d1d1d;
    --bg-light-grey: #2c2c2c;
    --accent-red: #e50914;
    --accent-red-hover: #b80710;
    --text-white: #ffffff;
    --text-muted: #a3a3a3;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-black);
    color: var(--text-white);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 5%;
    background-color: rgba(10, 10, 10, 0.96);
    border-bottom: 1px solid var(--bg-light-grey);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 44px;
    object-fit: contain;
}

.search-box {
    flex: 1;
    max-width: 440px;
    min-width: 220px;
    display: flex;
}

.search-box input {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-grey);
    border: 1px solid var(--bg-light-grey);
    color: var(--text-white);
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.25s;
}

.search-box input:focus {
    border-color: var(--accent-red);
}

.nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-links a {
    color: var(--text-white);
    text-decoration: none;
    background: var(--accent-red);
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.25s;
}

.nav-links a:hover {
    background: var(--accent-red-hover);
}

.nav-links a.btn-secondary {
    background: var(--bg-light-grey);
}

.nav-links a.btn-secondary:hover {
    background: #3d3d3d;
}

/* Container & Categories */
.container {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 32px 5%;
}

.category-section {
    margin-bottom: 48px;
}

.category-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent-red);
    padding-left: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
    gap: 22px;
}

.media-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-light-grey);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    color: var(--text-white);
    display: flex;
    flex-direction: column;
}

.media-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-red);
    box-shadow: 0 10px 24px rgba(229, 9, 20, 0.28);
}

.media-card img {
    width: 100%;
    height: 295px;
    object-fit: cover;
    background: #111;
}

.media-info {
    padding: 14px;
}

.media-info h3 {
    font-size: 1.02rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-info span {
    font-size: 0.8rem;
    color: var(--accent-red);
    font-weight: 700;
    text-transform: uppercase;
}

/* Watch Page & Live Comments */
.watch-container {
    width: 100%;
    max-width: 1080px;
    margin: 28px auto;
    padding: 0 5%;
}

.video-wrapper {
    width: 100%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--bg-light-grey);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75);
}

video {
    width: 100%;
    max-height: 600px;
    display: block;
    background: #000;
}

.video-details {
    margin-top: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--bg-light-grey);
}

.video-details h1 {
    font-size: 1.9rem;
    margin-bottom: 10px;
}

.badge {
    display: inline-block;
    background: var(--accent-red);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.video-details p {
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 0.98rem;
}

.comments-section {
    margin-top: 30px;
    background: var(--bg-grey);
    border: 1px solid var(--bg-light-grey);
    padding: 25px;
    border-radius: 10px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #ff4d4d;
    font-weight: 700;
    margin-left: 10px;
}

.live-dot {
    width: 9px;
    height: 9px;
    background: var(--accent-red);
    border-radius: 50%;
    animation: pulse 1.4s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.25); }
    100% { opacity: 1; transform: scale(1); }
}

.comment-form, .standard-form, .admin-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-black);
    border: 1px solid var(--bg-light-grey);
    color: var(--text-white);
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-red);
}

.btn-red {
    background: var(--accent-red);
    color: #ffffff;
    border: none;
    padding: 12px 22px;
    font-size: 0.98rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.25s;
}

.btn-red:hover {
    background: var(--accent-red-hover);
}

.comment-box {
    background: var(--bg-black);
    border: 1px solid var(--bg-light-grey);
    padding: 14px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 3px solid var(--accent-red);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.comment-header strong {
    color: var(--text-white);
    font-size: 0.92rem;
}

/* Info Pages (About, Terms, Contact) */
.page-card {
    background: var(--bg-grey);
    border: 1px solid var(--bg-light-grey);
    border-radius: 10px;
    padding: 35px;
    max-width: 860px;
    margin: 20px auto;
}

.page-card h1 {
    font-size: 2rem;
    margin-bottom: 16px;
    border-left: 4px solid var(--accent-red);
    padding-left: 14px;
}

.page-card h2 {
    font-size: 1.2rem;
    color: var(--accent-red);
    margin: 22px 0 8px;
}

.page-card p {
    color: var(--text-muted);
    margin-bottom: 14px;
}

.alert-success {
    background: rgba(22, 163, 74, 0.18);
    border: 1px solid #22c55e;
    color: #86efac;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* Admin Panel */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1.45fr;
    gap: 28px;
    align-items: start;
}

.admin-card {
    background: var(--bg-grey);
    border: 1px solid var(--bg-light-grey);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 24px;
}

.source-group {
    background: var(--bg-black);
    border: 1px solid var(--bg-light-grey);
    padding: 14px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.source-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.divider-or {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
}

.progress-wrapper {
    display: none;
    width: 100%;
    background: var(--bg-black);
    border-radius: 6px;
    overflow: hidden;
    height: 24px;
    border: 1px solid var(--bg-light-grey);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-red);
    text-align: center;
    line-height: 24px;
    font-size: 12px;
    font-weight: 700;
    transition: width 0.2s;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

th, td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--bg-light-grey);
    font-size: 0.9rem;
}

th {
    background: var(--bg-black);
    color: var(--accent-red);
    text-transform: uppercase;
    font-size: 0.8rem;
}

.action-btn {
    padding: 6px 11px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    margin-right: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.edit-btn { background: #3b3b3b; }
.edit-btn:hover { background: #525252; }
.delete-btn { background: var(--accent-red); }
.delete-btn:hover { background: var(--accent-red-hover); }

/* Footer */
.site-footer {
    background: var(--bg-grey);
    border-top: 1px solid var(--bg-light-grey);
    padding: 32px 5% 24px;
    margin-top: 50px;
    text-align: center;
}

.footer-logo img {
    height: 38px;
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 18px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-red);
}

.footer-copy {
    color: #737373;
    font-size: 0.85rem;
}

@media (max-width: 860px) {
    .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .media-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
    .media-card img { height: 225px; }
    .page-card { padding: 22px; }
    .search-box { max-width: 100%; order: 3; flex-basis: 100%; }
}