* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #0b0c10;
    color: #ffffff;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: rgba(11, 12, 16, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-weight: 800;
    font-size: 24px;
    letter-spacing: 2px;
}

.logo span {
    color: #e50914; 
}

.nav-links span {
    margin-left: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #a0a0a0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-links span:hover, .nav-links span.active {
    color: #ffffff;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: radial-gradient(circle at top, rgba(229, 9, 20, 0.15), transparent 60%);
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 15px;
}

.hero h1 span {
    color: #e50914;
}

.hero p {
    font-size: 16px;
    color: #b0b0b0;
    max-width: 600px;
    margin: 0 auto;
}

/* Movie Grid */
.container {
    padding-bottom: 60px;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 40px 30px;
    padding: 0 50px;
}

.movie-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.movie-item:hover .movie-card {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 15px 30px rgba(229, 9, 20, 0.4);
}

.movie-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    background: #1a1a1d;
}

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

.badge-year {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff0000;
    color: #fff;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 3px;
    z-index: 5;
}

.badge-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff9800;
    color: #fff;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 3px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 2px;
}

.badge-type {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #6cc116;
    color: #fff;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 3px;
    z-index: 5;
}

.movie-title-bottom {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    width: 100%;
    color: #fff;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    width: 60px;
    height: 60px;
    background: rgba(229, 9, 20, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.play-btn::after {
    content: '';
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 15px solid white;
    margin-left: 5px;
}

.movie-item:hover .play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}


/* SERVER SELECTION MODAL */
.server-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 5000;
    display: none; /* hidden by default */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.server-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.server-modal {
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    position: relative;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.server-modal-overlay.active .server-modal {
    transform: translateY(0);
}

.server-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    font-size: 18px;
    color: #888;
    transition: color 0.3s;
}
.server-modal-close:hover { color: #fff; }

.server-modal h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 5px;
}

.server-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.server-btn {
    background: #1f1f1f;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    color: white;
    text-align: left;
    transition: all 0.2s ease;
}

.server-btn:hover {
    background: #e50914;
    border-color: #e50914;
    transform: scale(1.02);
}

.server-icon {
    font-size: 20px;
    color: #fff;
    opacity: 0.8;
}

.server-info {
    display: flex;
    flex-direction: column;
}

.server-info strong {
    font-size: 16px;
    margin-bottom: 3px;
}

.server-info span {
    font-size: 12px;
    color: #aaa;
}
.server-btn:hover .server-info span {
    color: #fca5a5;
}

/* NEW REALISTIC VIDEO PLAYER OVERLAY */
.player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.player-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* TOP BAR */
.player-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    z-index: 10;
}

.back-btn {
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: color 0.3s;
}
.back-btn:hover { color: #e50914; }

.player-title {
    font-size: 18px;
    font-weight: 700;
}
.flag {
    border: 1px solid white;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 3px;
}

/* VIDEO SCREEN CENTER */
.video-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    background-color: #000;
}

/* MPAA Cinematic Green Screen */
.mpaa-screen {
    width: 100%;
    height: 100%;
    background-color: #1a6428; /* Classic MPAA Green */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.mpaa-box {
    border: 4px solid white;
    padding: 40px;
    max-width: 800px;
}
.mpaa-box h3 {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    margin: 10px 0;
}
.mpaa-box h1 {
    font-size: 50px;
    font-weight: 800;
    margin: 20px 0;
    letter-spacing: 5px;
}

/* Buffering/Loading Screen */
.buffer-screen {
    background-color: rgba(0,0,0,0.7);
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.spinner {
    width: 70px;
    height: 70px;
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-top-color: #e50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* CPA Locker Modal placed inside player */
.cpa-modal {
    background: rgba(20, 20, 20, 0.95);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    text-align: center;
    max-width: 600px;
    width: 90%;
    z-index: 20;
}
.cpa-modal h2 {
    font-size: 24px;
    margin-bottom: 15px;
}
.cpa-modal p {
    color: #ccc;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.verify-btn {
    background: #e50914;
    color: white;
    font-size: 18px;
    font-weight: 800;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.4);
}

.verify-btn:hover {
    background: #f40612;
    transform: scale(1.05);
}

/* BOTTOM PLAYER BAR */
.player-bottom-bar {
    display: flex;
    align-items: center;
    padding: 20px 40px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    z-index: 10;
    gap: 15px;
    margin-top: auto;
}

.play-pause {
    font-size: 20px;
    cursor: pointer;
    font-weight: bold;
}
.time-current, .time-total {
    font-size: 14px;
    font-family: monospace;
    color: #ddd;
}
.player-timeline {
    flex-grow: 1;
    height: 5px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    position: relative;
    cursor: pointer;
}
.player-timeline-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: #e50914;
    border-radius: 5px;
    transition: width 0.1s linear;
}
.control-icons span {
    font-size: 20px;
    margin-left: 15px;
    cursor: pointer;
}

/* responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .movie-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 0 20px; gap: 15px;}
    .movie-card img { height: 220px; }
    .hero h1 { font-size: 32px; }
    
    .player-top-bar, .player-bottom-bar { padding: 10px 20px; }
    .mpaa-box { transform: scale(0.6); }
}
