:root {
    --netflix-red: #e50914;
    --bg-dark: #141414;
    --panel-dark: #1f1f1f;
    --text-main: #f5f5f1;
    --text-muted: #b3b3b3;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.72)),
        url('https://images.unsplash.com/photo-1489599511485-c5f8b6f86f89?auto=format&fit=crop&w=1800&q=80');
    background-size: cover;
    background-position: center;
    position: relative;
}

.overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(229, 9, 20, 0.3), rgba(0, 0, 0, 0.92));
}

.auth-card {
    position: relative;
    z-index: 1;
    width: min(420px, 90vw);
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

h1, h2, h3 {
    margin-top: 0;
}

h1 {
    color: var(--netflix-red);
    margin-bottom: 0.4rem;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.auth-form,
.upload-form,
.caption-form {
    display: grid;
    gap: 0.65rem;
}

input[type='text'],
input[type='password'],
input[type='file'],
select,
textarea {
    width: 100%;
    background: #2b2b2b;
    color: var(--text-main);
    border: 1px solid #3d3d3d;
    border-radius: 4px;
    padding: 0.65rem 0.75rem;
}

button {
    border: 0;
    border-radius: 4px;
    padding: 0.6rem 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.primary {
    background: var(--netflix-red);
    color: #fff;
}

.secondary {
    background: #444;
    color: #fff;
}

.button-row {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.notice {
    border-radius: 4px;
    padding: 0.6rem 0.75rem;
    margin: 0 0 1rem;
}

.notice.success { background: rgba(47, 138, 63, 0.45); }
.notice.error { background: rgba(194, 38, 38, 0.45); }

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #000;
    border-bottom: 1px solid #2d2d2d;
    gap: 1rem;
}

.brand {
    color: var(--netflix-red);
    font-size: 1.6rem;
    font-weight: 700;
}

.session-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.session-meta a {
    color: #fff;
    text-decoration: none;
    background: #303030;
    padding: 0.4rem 0.7rem;
    border-radius: 4px;
}

.dashboard-main {
    padding: 1.5rem;
}


.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.2rem;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 1.2rem;
}

.admin-nav-list {
    display: grid;
    gap: 0.6rem;
}

.admin-nav-tab,
.admin-nav-link {
    width: 100%;
    display: block;
    text-align: left;
    border: 1px solid #373737;
    background: #222;
    color: #fff;
    border-radius: 6px;
    padding: 0.7rem 0.85rem;
    font-size: 0.95rem;
    text-decoration: none;
}

.admin-nav-tab.active,
.admin-subtab.active {
    background: var(--netflix-red);
    border-color: var(--netflix-red);
}

.admin-page-panel,
.admin-subpanel {
    display: none;
}

.admin-page-panel.active,
.admin-subpanel.active {
    display: block;
}

.admin-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.admin-subtab {
    border: 1px solid #373737;
    background: #292929;
    color: #fff;
}

.admin-subpanel {
    margin-top: 0.8rem;
}

.form-switch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.form-switch-grid article {
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0.8rem;
    background: #1a1a1a;
}

.wrap-row {
    flex-wrap: wrap;
}

.inline-form {
    margin: 0;
}

.admin-users-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 2fr 1fr;
}

.users-table-wrap {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.users-table th,
.users-table td {
    border-bottom: 1px solid #333;
    text-align: left;
    padding: 0.65rem 0.5rem;
    vertical-align: top;
}

@media (max-width: 1000px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

    .admin-users-grid {
        grid-template-columns: 1fr;
    }
}


.admin-panel {
    background: var(--panel-dark);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.video-card {
    background: var(--panel-dark);
    border-radius: 8px;
    border: 1px solid #333;
    padding: 0.8rem;
}

video {
    width: 100%;
    border-radius: 6px;
    background: #000;
}

.poster-preview {
    width: 100%;
    border-radius: 6px;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.caption {
    margin: 0.65rem 0;
    font-weight: 600;
}

.empty {
    color: var(--text-muted);
}

.viewer-body main {
    padding-bottom: 2rem;
}

.hero {
    position: relative;
    min-height: 420px;
    background: linear-gradient(to top, #141414 0%, rgba(20, 20, 20, 0.55) 40%, rgba(20, 20, 20, 0.2) 100%);
    border-bottom: 1px solid #202020;
}

.hero-video {
    width: 100%;
    max-height: 68vh;
    object-fit: cover;
    border-radius: 0;
}

.hero-copy,
.hero-empty {
    padding: 1.4rem 1.6rem;
    background: linear-gradient(to top, rgba(20, 20, 20, 0.95), rgba(20, 20, 20, 0.2));
}

.hero-empty {
    min-height: 340px;
    display: grid;
    align-content: end;
}

.posterboard-section {
    padding: 1.4rem 1.6rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}

.scroll-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.scroll-row::-webkit-scrollbar {
    display: none;
}

.scroll-row-wrap {
    position: relative;
}

.row-scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.6rem;
    height: 4.4rem;
    border-radius: 0.35rem;
    background: rgba(20, 20, 20, 0.78);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
}

.scroll-row-wrap.has-overflow .row-scroll-button {
    display: flex;
}

.row-scroll-left {
    left: 0;
}

.row-scroll-right {
    right: 0;
}

.row-scroll-button:disabled {
    opacity: 0.2;
    cursor: default;
}

.scroll-row .poster-tile {
    min-width: 190px;
    flex: 0 0 190px;
}

.top-ten-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.poster-tile {
    background: #1b1b1b;
    border: 1px solid #303030;
    border-radius: 8px;
    padding: 0.7rem;
}

.poster-tile h3 {
    margin-bottom: 0.55rem;
    color: #ddd;
    font-size: 0.95rem;
}

.poster-tile img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.poster-tile p {
    margin: 0.55rem 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.poster-link {
    color: inherit;
    text-decoration: none;
}

.empty-slot {
    color: var(--text-muted);
}

.content-page-card {
    max-width: 900px;
    margin: 0 auto;
}

.content-media {
    display: flex;
    justify-content: center;
    margin-bottom: 0.8rem;
}

.content-media video {
    max-width: 100%;
}

.content-meta {
    color: var(--text-muted);
}

.content-comment-form textarea {
    resize: vertical;
}

.comments-list {
    margin-top: 1rem;
}

.comment-item {
    border-top: 1px solid #333;
    padding: 0.7rem 0;
}

.comment-item span {
    color: var(--text-muted);
    margin-left: 0.5rem;
    font-size: 0.85rem;
}

.poster-placeholder {
    aspect-ratio: 2/3;
    border-radius: 6px;
    border: 1px dashed #666;
    display: grid;
    place-items: center;
    text-align: center;
    color: #8f8f8f;
    padding: 0.6rem;
    font-size: 0.84rem;
}


.danger {
    background: #9e2727;
    color: #fff;
    margin-top: 0.5rem;
}

.content-poster {
    aspect-ratio: 16/9;
    margin-bottom: 0.8rem;
}


.wrap-row {
    flex-wrap: wrap;
}

.inline-form {
    display: inline-block;
}

.form-switch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.form-switch-grid article {
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0.9rem;
    background: #191919;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-popup {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1000;
    min-width: 260px;
    max-width: 420px;
    padding: 0.75rem 0.95rem;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    color: #fff;
}

.status-popup.success {
    background: rgba(42, 130, 59, 0.95);
}

.status-popup.error {
    background: rgba(180, 38, 38, 0.95);
}

.status-popup.show {
    opacity: 1;
    transform: translateY(0);
}
