:root {
    --accent: #ff3366;
    --accent-2: #00d4ff;
    --green: #2ecc71;
    --bg: #080a0f;
    --surface: #11141c;
    --surface-2: #1a1f2b;
    --border: #2a3040;
    --muted: #9aa3b2;
    --text: #f7f8fb;
    --header-h: 70px;
    --radius: 8px;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
    --transition: 180ms ease;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    padding-top: var(--header-h);
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.55;
    overflow-x: hidden;
}

a {
    color: inherit;
}

img,
video {
    max-width: 100%;
}

button,
input,
select {
    font: inherit;
}

.main-header {
    position: fixed;
    inset: 0 0 auto;
    height: var(--header-h);
    z-index: 1000;
    display: flex;
    align-items: center;
    background: rgba(8, 10, 15, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
}

.header-content {
    width: min(1500px, 94vw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo {
    color: var(--accent);
    font-size: 26px;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0;
    white-space: nowrap;
}

.search-box,
.admin-search {
    position: relative;
}

.search-box {
    flex: 1;
    max-width: 420px;
}

.search-box i,
.admin-search i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.search-box input,
.admin-search input,
input,
select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #0c0f16;
    color: var(--text);
    outline: none;
    padding: 9px 12px;
}

.search-box input,
.admin-search input {
    padding-left: 38px;
}

.advanced-search-toggle {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 8px 12px;
    margin-left: 8px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.advanced-search-toggle:hover {
    background: var(--surface-2);
    color: var(--text);
}

.advanced-search-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    max-width: 600px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 8px;
    z-index: 1000;
    box-shadow: var(--shadow);
}

input:focus,
select:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.14);
}

.main-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-item {
    color: #c7ccd6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 13px;
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
    background: var(--accent);
    color: #fff;
}

.nav-admin {
    color: #fff;
    background: rgba(255, 51, 102, 0.12);
}

.menu-toggle {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: #fff;
    cursor: pointer;
}

.hero-banner {
    position: relative;
    min-height: min(620px, 62vh);
    overflow: hidden;
    background: #000;
}

.hero-vid {
    width: 100%;
    height: 100%;
    min-height: min(620px, 62vh);
    object-fit: cover;
    opacity: 0.62;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.72), transparent 62%), linear-gradient(0deg, var(--bg), transparent 45%);
}

.hero-info {
    position: absolute;
    left: max(5vw, 24px);
    bottom: 12%;
    width: min(720px, 88vw);
}

.hero-kicker,
.format-badge,
.view-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 800;
}

.hero-kicker {
    background: var(--accent);
    padding: 5px 12px;
    text-transform: uppercase;
}

.hero-title {
    margin: 14px 0 12px;
    font-size: clamp(30px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: 0;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #d4d8e2;
    margin-bottom: 22px;
}

.btn-play,
.btn-next,
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    border: 0;
    border-radius: var(--radius);
    padding: 10px 18px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.btn-play {
    background: #fff;
    color: #000;
}

.btn-play:hover {
    background: var(--accent);
    color: #fff;
}

.movie-container,
.suggestions-container {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 28px 0 50px max(18px, 4vw);
}

.section-heading {
    margin: 12px max(18px, 4vw) 24px 0;
    border-left: 4px solid var(--accent);
    padding-left: 14px;
    font-size: 22px;
}

.movie-row {
    display: flex;
    gap: 18px;
    margin-bottom: 36px;
}

.row-sidebar {
    flex: 0 0 175px;
    padding-top: 8px;
}

.row-title {
    margin: 0 0 9px;
    font-size: 20px;
    line-height: 1.25;
}

.view-all {
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
}

.row-wrapper {
    min-width: 0;
    flex: 1;
    position: relative;
}

.row-scroller {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px max(18px, 4vw) 14px 0;
    scrollbar-width: none;
}

.row-scroller::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    position: absolute;
    top: 42%;
    z-index: 5;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition), transform var(--transition);
}

.row-wrapper:hover .nav-btn {
    opacity: 1;
}

.btn-left {
    left: 6px;
}

.btn-right {
    right: max(20px, 4vw);
}

.item-card {
    flex: 0 0 clamp(175px, 19vw, 250px);
    width: clamp(175px, 19vw, 250px);
    color: #fff;
    text-decoration: none;
}

.item-poster {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.item-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 260ms ease, opacity 260ms ease;
}

.item-card:hover img {
    transform: scale(1.05);
    opacity: 0.72;
}

.view-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.68);
    padding: 4px 8px;
}

.play-hint {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--accent);
    font-size: 38px;
    opacity: 0;
    transition: opacity var(--transition);
}

.item-card:hover .play-hint {
    opacity: 1;
}

.format-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    background: rgba(255, 51, 102, 0.9);
    padding: 3px 7px;
    font-size: 10px;
}

.item-name {
    display: block;
    margin-top: 10px;
    color: #e6e9ef;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state,
.site-footer {
    color: var(--muted);
    text-align: center;
    padding: 44px 20px;
}

.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #05070a;
}

.player-container {
    width: min(1120px, 94vw);
    margin: 26px auto 0;
}

.video-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
    background: #000;
    box-shadow: var(--shadow);
}

#main-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-watermark {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 3;
    width: 80px;
    opacity: 0.45;
    pointer-events: none;
}

.live-tag {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(229, 9, 20, 0.88);
    border-radius: 5px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.2;
    }
}

.resume-modal {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 8;
    width: min(420px, 88%);
    transform: translate(-50%, -50%);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: rgba(15, 17, 24, 0.96);
    padding: 26px;
    text-align: center;
    box-shadow: var(--shadow);
}

.resume-modal.is-visible {
    display: block;
}

.resume-modal h3 {
    margin: 0 0 8px;
}

.resume-modal p,
.movie-details p {
    color: var(--muted);
}

.resume-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.btn-resume,
.btn-restart {
    border: 0;
    border-radius: var(--radius);
    padding: 11px 18px;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.btn-resume,
.btn-next {
    background: var(--accent);
    color: #fff;
}

.btn-restart {
    background: #303747;
}

.movie-details {
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--surface);
}

.details-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    color: #c7ccd6;
    font-size: 14px;
}

.movie-details h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 36px);
    letter-spacing: 0;
}

.movie-details small {
    color: var(--muted);
    font-size: 0.65em;
}

.next-ep-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 22px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.next-ep-box span {
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.next-ep-box h3 {
    margin: 5px 0 0;
}

.admin-page {
    padding-top: 0;
    background: #0d1018;
}

.admin-container {
    width: min(1500px, 96vw);
    margin: 0 auto;
    padding: 18px 0 36px;
}

.admin-sticky-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0 22px;
    background: rgba(13, 16, 24, 0.94);
    backdrop-filter: blur(12px);
}

.admin-title-group,
.admin-actions,
.title-line,
.series-fields {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-title-group h1 {
    margin: 0;
    color: var(--accent);
    font-size: 23px;
}

.admin-search {
    width: min(340px, 36vw);
}

.admin-btn {
    color: #fff;
    background: var(--surface-2);
}

.admin-btn-save,
.admin-btn-add {
    color: #041015;
    background: var(--accent-2);
}

.admin-btn-download {
    background: var(--accent);
}

.admin-btn-muted {
    background: #242a38;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card,
.admin-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    font-size: 22px;
}

.stat-blue {
    color: var(--accent-2);
    background: rgba(0, 212, 255, 0.12);
}

.stat-red {
    color: var(--accent);
    background: rgba(255, 51, 102, 0.12);
}

.stat-green {
    color: var(--green);
    background: rgba(46, 204, 113, 0.12);
}

.stat-info h4 {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.stat-info span {
    font-size: 25px;
    font-weight: 800;
}

.status-msg {
    margin-bottom: 22px;
    border: 1px solid rgba(0, 212, 255, 0.45);
    border-radius: var(--radius);
    background: rgba(0, 212, 255, 0.11);
    color: #bff5ff;
    padding: 14px 16px;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
}

.admin-section {
    padding: 22px;
}

.section-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.admin-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 19px;
}

.section-top h2 {
    margin: 0;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.row-new td {
    background: rgba(255, 51, 102, 0.04);
}

.movie-title-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.movie-title-cell input {
    min-width: 280px;
    color: var(--accent-2);
    font-weight: 700;
}

.file-name {
    color: #758092;
    font-family: Consolas, monospace;
    font-size: 12px;
}

.new-badge {
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 800;
}

.series-fields input:first-child {
    width: 95px;
}

.series-fields input:last-child {
    width: 72px;
}

.center-cell {
    text-align: center;
}

.delete-button,
.genre-tag button {
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.stack-form p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.genre-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.genre-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #242a38;
    padding: 6px 10px;
    color: #d7dce6;
    font-size: 13px;
}

.danger-section {
    border-color: rgba(255, 51, 102, 0.55);
}

@media (max-width: 980px) {
    .menu-toggle {
        display: inline-grid;
        place-items: center;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: calc(var(--header-h) - 1px);
        right: 3vw;
        width: min(290px, 92vw);
        flex-direction: column;
        align-items: stretch;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: #111722;
        padding: 8px;
        box-shadow: var(--shadow);
    }

    .main-nav.show,
    .watch-nav {
        display: flex;
    }

    .watch-nav {
        position: static;
        width: auto;
        flex-direction: row;
        border: 0;
        background: transparent;
        padding: 0;
        box-shadow: none;
    }

    .movie-row {
        display: block;
    }

    .row-sidebar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-right: max(18px, 4vw);
        margin-bottom: 8px;
    }

    .stats-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-sticky-bar,
    .admin-title-group {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-search {
        width: 100%;
    }
}

@media (max-width: 680px) {
    :root {
        --header-h: 64px;
    }

    .header-content {
        gap: 10px;
    }

    .logo {
        font-size: 22px;
    }

    .search-box {
        max-width: none;
    }

    .search-box input {
        min-height: 38px;
    }

    .hero-banner,
    .hero-vid {
        min-height: 430px;
    }

    .hero-info {
        bottom: 9%;
    }

    .movie-container,
    .suggestions-container {
        padding-left: 16px;
    }

    .item-card {
        flex-basis: 165px;
        width: 165px;
    }

    .nav-btn {
        display: none;
    }

    .player-container {
        width: 100%;
        margin-top: 0;
    }

    .video-wrapper,
    .movie-details {
        border-radius: 0;
    }

    .movie-details {
        padding: 18px;
    }

    .details-meta,
    .next-ep-box,
    .admin-actions,
    .section-top {
        align-items: stretch;
        flex-direction: column;
    }

    .btn-next,
    .admin-btn {
        width: 100%;
    }
}

.buffer-indicator {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10;
    color: #fff;
    gap: 12px;
}

.buffer-indicator .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.buffer-indicator span {
    font-size: 16px;
    font-weight: 600;
}

.player-error {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10;
    color: #fff;
    padding: 20px;
    text-align: center;
    gap: 16px;
}

.player-error p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.player-error button {
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: var(--radius);
    font-weight: 800;
    cursor: pointer;
    font-size: 14px;
}

.player-error button:hover {
    background: #fff;
    color: var(--accent);
}

.site-footer {
    color: var(--muted);
    text-align: center;
    padding: 44px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #05070a;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-left strong {
    color: var(--accent);
}

.footer-right a {
    color: #ccc;
    text-decoration: none;
    margin-left: 20px;
    transition: 0.3s;
}

.footer-right a:hover {
    color: var(--accent);
}

.version-tag {
    background: var(--surface-2);
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 20px;
    font-size: 11px;
    color: var(--muted);
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .footer-right a {
        margin: 0 10px;
    }
}

/* =============================================
   RATING & REVIEW SYSTEM
   ============================================= */

.rating-section {
    padding: 24px;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--surface);
    margin-top: 22px;
}

.rating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.rating-header h2 {
    margin: 0;
    font-size: 20px;
}

.movie-rating-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-stars i {
    color: #ffc107;
    font-size: 18px;
}

.rating-stars i.empty {
    color: var(--muted);
}

.rating-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
}

.total-reviews {
    color: var(--muted);
    font-size: 14px;
}

.user-rating-form {
    margin-bottom: 24px;
}

.user-rating-form h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.star-rating {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 24px;
    color: var(--muted);
    transition: all 0.2s;
}

.star-btn:hover,
.star-btn.active {
    color: #ffc107;
    transform: scale(1.1);
}

.review-form {
    margin-top: 16px;
}

.review-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
}

.review-form textarea:focus {
    outline: none;
    border-color: var(--accent-2);
}

.review-actions {
    display: flex;
    gap: 12px;
}

.btn-submit {
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
}

.btn-submit:hover {
    background: #e62e5e;
}

.btn-cancel {
    padding: 10px 20px;
    background: var(--surface-2);
    color: var(--text);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.btn-cancel:hover {
    background: var(--border);
}

.reviews-list {
    margin-top: 24px;
}

.loading-reviews,
.no-reviews,
.error {
    text-align: center;
    padding: 20px;
    color: var(--muted);
}

.review-item {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.review-stars {
    color: #ffc107;
    font-size: 14px;
}

.review-date {
    color: var(--muted);
    font-size: 12px;
}

.review-text {
    margin: 0;
    line-height: 1.6;
    color: var(--text);
}

/* =============================================
   MOVIE ACTIONS & WATCHLIST
   ============================================= */

.movie-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--border);
}

.action-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.action-btn.active:hover {
    background: #e62e5e;
}

.action-btn i {
    font-size: 16px;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* =============================================
   VIDEO PLAYER CONTROLS
   ============================================= */

.player-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-control label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.speed-control select {
    padding: 6px 12px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
}

.speed-control select:focus {
    outline: none;
    border-color: var(--accent-2);
}

.control-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.control-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Seek and volume indicators */
.seek-indicator,
.volume-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    pointer-events: none;
}

/* Theater mode */
.theater-mode {
    background: #000;
}

.theater-mode .player-container {
    max-width: 100%;
    margin: 0;
}

.theater-mode .movie-details {
    max-width: 1200px;
    margin: 0 auto;
}

.theater-mode .video-wrapper {
    border-radius: 0;
}

.theater-mode main {
    padding: 0;
}

/* =============================================
   ADVANCED SEARCH UI
   ============================================= */

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 120px;
}

.search-submit-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    align-self: flex-end;
}

.search-submit-btn:hover {
    background: #e62e5e;
}

/* =============================================
   WATCH HISTORY PAGE
   ============================================= */

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.history-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
}

.history-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.history-item-poster {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--surface-2);
}

.history-item-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-item-info {
    padding: 12px;
}

.history-item-title {
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
}

.history-item-progress {
    margin-top: 8px;
    height: 4px;
    background: var(--surface-2);
    border-radius: 2px;
    overflow: hidden;
}

.history-item-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
}

/* =============================================
   WATCHLIST PAGE STYLES
   ============================================= */

.list-tabs {
    display: flex;
    gap: 12px;
}

.list-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    transition: all 0.2s;
}

.list-tab:hover,
.list-tab.active {
    background: var(--accent);
    color: #fff;
}

.list-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
}

.list-badge.favorite {
    background: var(--accent);
}

.list-badge.watch-later {
    background: var(--accent-2);
}

.history-item-notes {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

/* =============================================
   NAVIGATION UPDATES
   ============================================= */

.main-nav .nav-item-new {
    position: relative;
}

.main-nav .nav-item-new::after {
    content: 'Mới';
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* =============================================
   ADMIN RATING DISPLAY
   ============================================= */

.rating-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.rating-stars-small {
    color: #ffc107;
    font-size: 12px;
    letter-spacing: 1px;
}

.rating-number-small {
    font-size: 14px;
    font-weight: 800;
    color: var(--accent);
}

.rating-count-small {
    font-size: 11px;
    color: var(--muted);
}

.no-rating {
    font-size: 12px;
    color: var(--muted);
    font-style: italic;
}

/* =============================================
   RESPONSIVE IMPROVEMENTS
   ============================================= */

@media (max-width: 768px) {
    .main-nav .nav-item-new {
        display: none;
    }

    .advanced-search-panel {
        position: relative;
        max-width: 100%;
        margin-top: 12px;
    }

    .search-filters {
        flex-direction: column;
    }

    .filter-group select,
    .filter-group input {
        min-width: 100%;
    }

    .player-controls {
        flex-wrap: wrap;
    }

    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .list-tabs {
        flex-direction: column;
    }

    .history-grid {
        grid-template-columns: 1fr;
    }

    .movie-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }
}