:root {
    --soviet-red: #CC0000;
    --soviet-red-dark: #8a0000;
    --gold: #FFD700;
    --gold-dim: #b39700;
    --concrete: #333333;
    --concrete-light: #444444;
    --bg-black: #141414;
    --text-white: #e5e5e5;
    --text-gray: #b3b3b3;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-black);
    color: var(--text-white);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Utilities --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4%;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.btn-primary {
    background-color: var(--soviet-red);
    color: var(--text-white);
}

.btn-primary:hover {
    background-color: var(--soviet-red-dark);
}

.btn-secondary {
    background-color: var(--concrete-light);
    color: var(--text-white);
}

.logo {
    color: var(--soviet-red);
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -2px;
    text-shadow: 2px 2px 0px var(--gold);
}

/* --- Login / Index --- */
.hero-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.9) 100%),
        url('sovietberlin.jpg');
    background-size: cover;
    background-position: center;
    text-align: center;
}

.login-box {
    background: rgba(0, 0, 0, 0.85);
    padding: 60px 68px 40px;
    border-radius: 4px;
    min-width: 450px;
    border: 1px solid var(--soviet-red);
}

.login-box h1 {
    margin-bottom: 28px;
    color: var(--gold);
    text-transform: uppercase;
}

.input-group {
    margin-bottom: 24px;
}

.form-control {
    width: 100%;
    height: 50px;
    line-height: 50px;
    padding: 0 20px;
    background: #333;
    border-radius: 4px;
    border: none;
    color: white;
    font-size: 16px;
}

.form-control:focus {
    background: #444;
    outline: 2px solid var(--gold);
}

/* --- Dashboard / Streaming --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 4%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    transition: background-color 0.4s;
}

.navbar.scrolled {
    background-color: var(--bg-black);
}

.billboard {
    height: 80vh;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
}

.billboard::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, var(--bg-black) 0%, transparent 50%);
}

.billboard-content {
    z-index: 10;
    padding-left: 4%;
    width: 40%;
}

.billboard-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--gold);
    text-shadow: 2px 2px 4px black;
}

.billboard-desc {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px black;
}

.row {
    padding: 2vw 4%;
    margin-bottom: 3vw;
}

.row-title {
    font-size: 1.4vw;
    font-weight: 500;
    color: var(--text-gray);
    margin-bottom: 0.5em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.row-posters {
    display: flex;
    overflow-y: hidden;
    overflow-x: scroll;
    padding: 20px 0;
}

.row-posters::-webkit-scrollbar {
    display: none;
}

.poster {
    max-height: 150px;
    margin-right: 10px;
    transition: transform 450ms;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
}

.poster:hover {
    transform: scale(1.08);
    opacity: 1;
    border-color: var(--soviet-red);
}

/* --- Watch Page --- */
.player-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #000;
}

.back-btn {
    position: absolute;
    top: 2rem;
    left: 2rem;
    color: white;
    font-size: 1.2rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-placeholder {
    width: 80%;
    height: 60%;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--soviet-red);
    color: var(--gold);
    font-size: 2rem;
    text-transform: uppercase;
    flex-direction: column;
    gap: 1rem;
}

.pulsate {
    animation: pulsate 2s infinite;
}

@keyframes pulsate {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

.movie-meta {
    margin-top: 2rem;
    text-align: center;
    max-width: 800px;
}

/* Append to style.css */

/* --- Loader --- */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #141414;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid transparent;
    border-top-color: #CC0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* --- Search Grid & Movie Cards --- */
.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.search-grid.visible {
    opacity: 1;
    transform: translateY(0);
}

.movie-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 4px;
    overflow: hidden;
}

.movie-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.movie-card img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.movie-info {
    padding: 10px;
    background: #333;
    color: white;
    font-size: 0.9rem;
    text-align: center;
}

/* --- Modal Styles --- */
.modal-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* When flex is set by JS, we also need to handle opacity for transition */
.modal-overlay[style*="display: flex"] {
    opacity: 1;
}

.modal-content {
    background: #181818;
    width: 100%;
    max-width: 850px;
    border-radius: 6px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay[style*="display: flex"] .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-banner {
    height: 480px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.modal-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, #181818, transparent);
}

.modal-info {
    padding: 20px 40px 40px;
    margin-top: -20px;
    position: relative;
    z-index: 10;
}

.modal-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* --- Modal Extras --- */
.modal-section {
    padding: 0 40px 20px;
    color: var(--text-white);
}

.modal-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-gray);
    border-bottom: 1px solid #404040;
    padding-bottom: 0.5rem;
}

.episode-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.episode-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #2f2f2f;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.episode-item:hover {
    background: #404040;
}

.episode-num {
    font-size: 1.5rem;
    color: var(--text-gray);
    font-weight: bold;
    min-width: 40px;
}

.episode-details h4 {
    margin-bottom: 0.5rem;
    color: var(--text-white);
}

.episode-details p {
    color: var(--text-gray);
    font-size: 0.9rem;
    line-height: 1.4;
}

.more-like-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.more-like-card {
    background: #2f2f2f;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.more-like-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.more-like-info {
    padding: 0.5rem;
    font-size: 0.9rem;
    text-align: center;
}