/* ========== CONFIGURAÇÕES GLOBAIS E VARIÁVEIS DE COR ========== */
:root {
    --background-dark: #040D12;
    --text-primary-dark: #F3F3F3;
    --accent-color: #C63C51;
    --card-background-dark: #101a20;
    --text-secondary-dark: #a0a0a0;
    --background-light: #F3F3F3;
    --text-primary-light: #040D12;
    --card-background-light: #ffffff;
    --text-secondary-light: #555555;
    --main-font: 'Poppins', sans-serif;
}

body {
    font-family: var(--main-font);
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-theme {
    background-color: var(--background-dark);
    color: var(--text-primary-dark);
}

body.light-theme {
    background-color: var(--background-light);
    color: var(--text-primary-light);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========== CABEÇALHO E NAVEGAÇÃO ========== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: rgba(0, 0, 0, 0.6);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s;
}

.navbar:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-primary-dark);
    text-decoration: none;
    font-weight: 300;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

#theme-toggler {
    padding: 0.5rem 1rem;
    background-color: var(--accent-color);
    color: var(--text-primary-dark);
    border: none;
    cursor: pointer;
    font-weight: 700;
    border-radius: 5px;
}

/* ========== BANNER PRINCIPAL (HOME) ========== */
.banner {
    height: 80vh;
    background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1574375927938-d5a98e8ffe85?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #FFF;
}

.banner-content {
    max-width: 600px;
}

.banner h1 {
    font-size: 3.5rem;
    font-weight: 700;
}

.banner p {
    font-size: 1.5rem;
    font-weight: 300;
    margin-top: 1rem;
}

/* ========== SEÇÕES DE CONTEÚDO (FILMES/SÉRIES) ========== */
.content-section {
    padding: 4rem 5%;
}

.content-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    border-left: 5px solid var(--accent-color);
    padding-left: 1rem;
}

.media-scroller {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(200px, 1fr);
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1.5rem;
}

.media-scroller::-webkit-scrollbar {
    height: 8px;
}
.media-scroller::-webkit-scrollbar-track {
    background: #222;
}
.media-scroller::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

.media-card {
    background-size: cover;
    background-position: center;
    min-height: 350px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.media-card:hover {
    transform: scale(1.05);
}

.media-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-card:hover .media-card-info {
    opacity: 1;
}

.media-card-info h3 {
    color: #FFF;
    font-size: 1rem;
    font-weight: 700;
}

/* ========== PLAYER SOBREPOSTO (MODAL) ========== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background-color: var(--card-background-dark);
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    position: relative;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: #FFF;
    cursor: pointer;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin: 1rem 0;
}

.video-container .video-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#player-description {
    margin-top: 1rem;
    font-weight: 300;
    color: var(--text-secondary-dark);
}

/* ========== PÁGINA DE LOGIN E ADMIN ========== */
.login-page, .admin-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--background-dark);
    color: var(--text-primary-dark);
}

.login-container, .admin-container {
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.input-group {
    position: relative;
    margin-bottom: 2rem;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #fff;
    color: #fff;
    font-size: 1rem;
}

.input-group label {
    position: absolute;
    top: 10px;
    left: 0;
    color: #aaa;
    pointer-events: none;
    transition: 0.3s;
}

.input-group input:focus ~ label,
.input-group input:valid ~ label {
    top: -15px;
    left: 0;
    color: var(--accent-color);
    font-size: 0.8rem;
}

.btn-primary {
    padding: 1rem;
    background-color: var(--accent-color);
    color: #FFF;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 5px;
    transition: opacity 0.3s;
}
.btn-primary:hover {
    opacity: 0.8;
}

/* ========== ESTILOS DO DASHBOARD ADMIN ========== */
.admin-container.dashboard {
    width: 90%;
    max-width: 800px;
    text-align: left;
}
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #444;
    padding-bottom: 1rem;
}
.btn-secondary {
    padding: 0.5rem 1rem;
    background-color: #555;
    color: #FFF;
    border: none;
    cursor: pointer;
    font-weight: 700;
    border-radius: 5px;
    transition: background-color 0.3s;
}
.btn-secondary:hover {
    background-color: #777;
}
#searchTmdbForm {
    margin-bottom: 2rem;
}
hr {
    border: none;
    border-top: 1px solid #444;
    margin: 2rem 0;
}
#addMediaContainer h4 {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}
.season-block {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #1a1a1a;
    border-radius: 5px;
}
.season-block h5 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}
.episode-input {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.episode-input label {
    flex-basis: 40%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
.episode-input input {
    flex-grow: 1;
    width: 100%;
    padding: 8px;
    background: #333;
    border: 1px solid #555;
    color: #fff;
    border-radius: 4px;
}
.message.success {
    color: #28a745;
}
.message.error {
    color: var(--accent-color);
}

/* ========== SELETOR DE SÉRIES NO PLAYER ========== */
#series-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}
#series-selector.hidden {
    display: none;
}
#series-selector select {
    padding: 0.5rem;
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 5px;
}