/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff0000;
    --bg-dark: #0f0f0f;
    --bg-secondary: #212121;
    --bg-hover: #3f3f3f;
    --text-primary: #f1f1f1;
    --text-secondary: #aaaaaa;
    --border-color: #303030;
    --sidebar-width: 240px;
}

body {
    font-family: "Roboto", "Arial", sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background-color: var(--bg-hover);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: bold;
    color: var(--text-primary);
}

.logo i {
    color: var(--primary-color);
    font-size: 24px;
}

.header-center {
    flex: 0 1 600px;
    max-width: 600px;
}

.search-form {
    display: flex;
    height: 40px;
}

.search-form input {
    flex: 1;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 40px 0 0 40px;
    padding: 0 16px;
    color: var(--text-primary);
    font-size: 14px;
}

.search-form input:focus {
    outline: none;
    border-color: #1c62b9;
}

.search-form button {
    width: 64px;
    background-color: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 0 40px 40px 0;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.search-form button:hover {
    background-color: #505050;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-link {
    padding: 8px 16px;
    background-color: var(--primary-color);
    border-radius: 20px;
    font-size: 14px;
    transition: opacity 0.2s;
}

.admin-link:hover {
    opacity: 0.9;
}

/* Container */
.container {
    display: flex;
    margin-top: 56px;
    min-height: calc(100vh - 56px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    width: var(--sidebar-width);
    height: calc(100vh - 56px);
    background-color: var(--bg-secondary);
    overflow-y: auto;
    padding: 12px 0;
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    color: var(--text-primary);
    font-size: 14px;
    transition: background 0.2s;
}

.nav-item:hover {
    background-color: var(--bg-hover);
}

.nav-item.active {
    background-color: var(--bg-hover);
}

.nav-item i {
    width: 24px;
    font-size: 18px;
}

.sidebar-section {
    border-top: 1px solid var(--border-color);
    margin-top: 12px;
    padding-top: 12px;
}

.sidebar-section h3 {
    padding: 8px 24px;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    transition: margin-left 0.3s;
}

.main-content.expanded {
    margin-left: 0;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Movies Grid */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

/* Movie Card */
.movie-card {
    cursor: pointer;
    transition: transform 0.2s;
}

.movie-card:hover {
    transform: scale(1.02);
}

.movie-thumbnail {
    position: relative;
    padding-bottom: 150%;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    display: block;
}

.movie-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.movie-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.movie-thumbnail:hover .movie-overlay {
    opacity: 1;
}

.movie-overlay i {
    font-size: 48px;
    color: white;
}

.movie-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.movie-rating i {
    color: #ffd700;
    font-size: 12px;
}

.movie-info {
    padding: 12px 0;
}

.movie-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
}

/* Movie Detail Page */
.movie-detail {
    max-width: 1280px;
    margin: 0 auto;
}

.player-container {
    position: relative;
    padding-bottom: 56.25%;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.player-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.movie-detail-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
}

.movie-detail-title {
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 16px;
}

.movie-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 14px;
}

.movie-detail-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.meta-rating {
    color: var(--text-primary) !important;
}

.meta-rating i {
    color: #ffd700;
}

.movie-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.genre-tag {
    padding: 6px 12px;
    background-color: var(--bg-hover);
    border-radius: 16px;
    font-size: 13px;
    transition: background 0.2s;
}

.genre-tag:hover {
    background-color: #505050;
}

.movie-overview h2 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 12px;
}

.movie-overview p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Recommended Movies */
.movie-secondary h2 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
}

.recommended-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recommended-item {
    display: flex;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.recommended-item:hover {
    background-color: var(--bg-hover);
}

.recommended-item img {
    width: 120px;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
}

.recommended-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recommended-info h4 {
    font-size: 14px;
    font-weight: 500;
}

.rec-rating {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.rec-rating i {
    color: #ffd700;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin: 32px 0;
}

.pagination-btn {
    padding: 10px 20px;
    background-color: var(--bg-secondary);
    border-radius: 20px;
    font-size: 14px;
    transition: background 0.2s;
}

.pagination-btn:hover {
    background-color: var(--bg-hover);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 14px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.no-results i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-results p {
    font-size: 18px;
    margin-bottom: 24px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 14px;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

/* Footer */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.footer-content p {
    margin: 4px 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .movie-detail-content {
        grid-template-columns: 1fr;
    }
    
    .recommended-list {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .recommended-item {
        flex-direction: column;
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .header-center {
        flex: 1;
        max-width: none;
    }
    
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .movie-detail-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 8px;
    }
    
    .logo span {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #606060;
}
/* ... (CSS sebelumnya tetap) ... */

/* Enhanced Related Videos Animations */
.related-item {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Related Item Hover Effects */
.related-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.related-item:hover .related-thumbnail::after {
    opacity: 1;
}

.related-item:hover .related-thumbnail img {
    transform: scale(1.05);
    transition: transform 0.3s;
}

/* Skeleton Loading for Images */
.related-thumbnail img[data-src] {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Ad Responsive Scaling */
@media (max-width: 768px) {
    .ad-banner-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ad-banner > div,
    .ad-square > div {
        min-width: max-content;
    }
}

/* Print Styles */
@media print {
    .ad-banner-container,
    .ad-square-container,
    .share-buttons {
        display: none !important;
    }
}
.ad-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
}
/* Add to existing style.css */

/* Header Right - Login Button */
.btn-login {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
}

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

/* User Menu Dropdown */
.user-menu {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    display: none;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.user-dropdown a:hover {
    background: var(--bg-hover);
}

.user-dropdown .divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header-center {
        display: none;
    }
    
    .header-right .btn-login span {
        display: none;
    }
    
    .user-wallet span {
        display: none;
    }
}
/* ===== SIDEBAR FIXES FOR MOBILE ===== */

/* Sidebar Container */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 250px;
    height: calc(100vh - 60px);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 900; /* Lower than header (1000) */
    transition: transform 0.3s ease;
    transform: translateX(0);
}

/* Mobile: Hide sidebar by default */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%); /* Hidden off-screen */
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
        z-index: 999; /* Higher on mobile when open */
    }
    
    /* Show sidebar when active */
    .sidebar.active {
        transform: translateX(0); /* Slide in */
    }
}

/* Main Content - Add padding-left for sidebar */
.main-content {
    margin-left: 250px;
    padding: 20px;
    min-height: calc(100vh - 60px);
    transition: margin-left 0.3s ease;
}

/* Mobile: Remove left margin */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0; /* Full width on mobile */
    }
}

/* Overlay untuk close sidebar di mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: rgba(0, 0, 0, 0.5);
    z-index: 998; /* Below sidebar but above content */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show overlay on mobile when sidebar active */
@media (max-width: 768px) {
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* Menu Toggle Button */
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Nav Items - Auto close on mobile */
@media (max-width: 768px) {
    .nav-item {
        position: relative;
    }
}

/* Prevent body scroll when sidebar open on mobile */
@media (max-width: 768px) {
    body.sidebar-open {
        overflow: hidden;
    }
}
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 36px 0 36px 0;
    flex-wrap: wrap;
}
.pagination-btn {
    background: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
    padding: 11px 22px;
    border-radius: 22px;
    box-shadow:0 2px 12px #0002;
    margin: 0 5px;
    display:flex;
    align-items:center;
    gap:8px;
    cursor:pointer;
    transition:background .2s, color .2s, filter .2s;
    text-decoration:none;
}
.pagination-btn:hover:not(.disabled), .pagination-btn:active:not(.disabled) {
    background: var(--primary-color);
    color: #fff;
    filter: brightness(1.12);
}
.pagination-btn.disabled {
    opacity: 0.45;
    cursor: default;
    background: #222;
    color: #888;
}
.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 3px;
}
.pagination-number {
    min-width: 38px;
    min-height: 38px;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    transition: all .2s;
    margin: 0 2px;
    text-decoration:none;
    padding: 0 6px;
}
.pagination-number:hover, .pagination-number.active {
    background: var(--primary-color);
    color: #fff;
}
.pagination-dots {
    min-width: 32px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 21px;
    letter-spacing:4px;
    font-weight:bold;
}
@media (max-width: 600px) {
    .pagination {
        flex-direction: column;
        gap:8px;
    }
    .pagination-btn, .pagination-number {
        min-width: 48px;
        font-size: 99%;
    }
}
