:root {
    --primary-color: #e50914;
    --bg-color: #0d0d0d;
    --text-color: #ffffff;
    --text-muted: #b3b3b3;
    --nav-bg: rgba(0, 0, 0, 0.9);
    --card-bg: #1f1f1f;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-color);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--nav-bg);
    padding: 1rem 0;
    backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-muted);
}

.nav-links a:hover {
    color: white;
}

.search-form {
    display: flex;
    align-items: center;
    background: #333;
    border-radius: 20px;
    padding: 0.3rem 1rem;
    border: 1px solid transparent;
}

.search-form:focus-within {
    border-color: var(--text-muted);
    background: black;
}

.search-form input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    font-family: inherit;
}

.search-form button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

main {
    padding-top: 80px;
    /* Navbar height */
    min-height: 80vh;
}

/* Home Slider (Basic) */
.hero {
    height: 60vh;
    background: linear-gradient(to top, var(--bg-color), transparent), url('https://image.tmdb.org/t/p/original/uDgy6hyPd82kOHh6I95FLtLnj6p.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding-bottom: 4rem;
}

.hero-content {
    max-width: 600px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.btn-primary {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-weight: 600;
}

.btn-primary:hover {
    background: #bd050e;
    color: white;
}

/* Section */
.section-title {
    margin: 3rem 0 1.5rem;
    font-size: 1.5rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

/* Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2rem;
}

.movie-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
    position: relative;
}

.movie-card:hover {
    transform: translateY(-5px);
    z-index: 10;
}

.poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: #333;
}

.card-info {
    padding: 1rem;
}

.card-info h3 {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
}

.meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.rating {
    color: #ffd700;
}

/* Footer */
.footer {
    margin-top: 4rem;
    padding: 2rem 0;
    background: #111;
    text-align: center;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Mobile menu implementation needed later */
    }

    .hero h1 {
        font-size: 2rem;
    }

    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
}

/* === Watch Page Styles === */
.watch-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

/* Video Section */
.video-section {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.player-controls {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #111;
    overflow-x: auto;
}

.server-btn {
    background: #222;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
    border-radius: 4px;
    transition: 0.2s;
}

.server-btn:hover,
.server-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Watch Meta */
.watch-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.watch-meta span {
    margin-right: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-quality {
    background: #333;
    color: white;
    border: 1px solid #555;
}

.badge-rating {
    color: #ebdb00;
}

.genre-tags {
    margin: 10px 0;
}

.genre-tag {
    display: inline-block;
    background: #222;
    color: #ccc;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 5px;
}

/* Tabs */
.watch-tabs {
    display: flex;
    border-bottom: 2px solid #333;
    margin-top: 2rem;
}

.tab-link {
    background: none;
    border: none;
    color: #888;
    padding: 1rem 2rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 2px solid transparent;
}

.tab-link:hover {
    color: white;
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    padding: 1.5rem 0;
}

.tab-content.active {
    display: block;
}

/* Download Table */
.download-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.download-table th,
.download-table td {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid #222;
}

.download-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

.download-btn {
    background: #d32f2f;
    color: white;
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    display: inline-block;
}

/* Sidebar */
.related-card {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    background: #1a1a1a;
    padding: 10px;
    border-radius: 8px;
    transition: 0.2s;
}

.related-card:hover {
    background: #252525;
}

.related-card img {
    width: 70px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.related-info h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.related-info span {
    font-size: 0.8rem;
    color: #888;
}

/* Cast Grid */
.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.cast-item {
    text-align: center;
    background: #1a1a1a;
    padding: 1rem;
    border-radius: 8px;
}

.cast-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.cast-name {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
}

.cast-role {
    font-size: 0.8rem;
    color: #888;
}

/* Mobile Response for Watch */
@media (max-width: 1000px) {
    .watch-container {
        grid-template-columns: 1fr;
    }

    /* Keep nav-actions visible but adjust size if needed */
    .search-form input {
        width: 100px;
    }
}

/* Nav Actions (Search + Profile) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-buttons a {
    color: var(--text-muted);
    font-weight: 500;
}

.auth-buttons a:hover {
    color: white;
}

/* Profile Dropdown */
.profile-menu {
    position: relative;
    cursor: pointer;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 50px;
    background-color: #1a1a1a;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    z-index: 1000;
    border: 1px solid #333;
}

.dropdown-content a {
    color: #eee;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: 0.2s;
}

.dropdown-content a:hover {
    background-color: #333;
    color: var(--primary-color);
}

.profile-menu.active .dropdown-content {
    display: block;
}