/* Reset Básico e Estilos Globais */
body {
    background-color: #121212; /* Fundo cinza escuro para o site todo */
    color: #f9fafb;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

/* --- Cabeçalho --- */
.header {
    background-color: #1a1a1a;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #333;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.menu-icon {
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.logo-link {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 8rem;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
    flex-grow: 1;
    max-width: 500px;
}

.search-input {
    width: 100%;
    background-color: #fff;
    color: #333;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    outline: none;
    padding-right: 3rem;
}

.search-button {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: #374151;
    border: none;
    color: #fff;
    padding: 0 1rem;
    cursor: pointer;
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

.search-button:hover {
    background: #4b5563;
}

.header-right {
    width: 150px;
    height: 40px;
}

/* --- Títulos de Seção --- */
.section-title {
    font-size: 1rem;
    font-weight: normal;
    margin: 1.5rem 0 1rem 0;
    border-bottom: 1px solid #fff;
    padding-bottom: 0.5rem;
    text-transform: uppercase;
    display: inline-block;
}

/* --- Carrossel --- */
.carousel {
    margin-bottom: 3rem;
}

.carousel-container {
    position: relative;
    border: 1px solid #444;
    padding: 1.5rem;
}

.carousel-track {
    display: flex;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: #1a1a1a;
    color: white;
    border: 1px solid #444;
    border-radius: 0;
    padding: 2rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.5rem;
    line-height: 1;
}

.carousel-button.prev {
    left: -1px;
}

.carousel-button.next {
    right: -1px;
}

.carousel .media-card {
    flex-shrink: 0;
    width: 13rem;
    margin: 0 0.5rem;
    cursor: pointer;
}

.carousel .media-card .media-card-poster-container {
    border: 1px solid #444;
}

.carousel .media-card .media-card-poster {
     height: 19rem;
}

/* --- Layout de Colunas para Listas --- */
.lists-container {
    display: grid;
    grid-template-columns: 3fr 1fr; 
    gap: 2rem;
    align-items: flex-start;
}

.list-column-main .grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 1.5rem;
}

.list-column-side .grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* --- Card de Mídia (Geral) --- */
.media-card-poster-container {
    position: relative;
    overflow: hidden;
    border-radius: 0;
}

.media-card-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-card-title {
    font-weight: 400;
    font-size: 0.9rem;
    white-space: normal;
    line-height: 1.3;
    color: #fff;
    margin: 0;
}

.grid-item-card,
.side-list-item-card {
    cursor: pointer;
}

.grid-item-card .media-card-poster-container,
.side-list-item-card .media-card-poster-container {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    border: 1px solid #444;
}

.list-item-details {
    margin-top: 0.75rem;
}

.list-item-meta {
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.meta-line {
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.4;
}

.new-tag {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #1e8e3e;
    color: white;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* --- Botão de Play (Overlay) --- */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.media-card:hover .play-overlay,
.grid-item-card:hover .play-overlay,
.side-list-item-card:hover .play-overlay {
    opacity: 1;
}

.play-button-img {
    width: 2.5rem;
    height: 2.5rem;
}

/* --- Rodapé --- */
.footer {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #374151;
}

.footer p {
    margin: 0;
    color: #6b7280;
}

.footer .tmdb-notice {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    color: #4b5563;
}

/* --- Classes Utilitárias --- */
.hidden {
    display: none;
}

/* --- PÁGINA DE RESULTADOS DA BUSCA --- */
.search-page-container {
    background-color: #1a1a1a;
    border: 1px solid #444;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1280px;
    box-sizing: border-box;
}

.search-page-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: normal;
    color: #ccc;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.search-query-input {
    background-color: #fff;
    color: #1a1a1a;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 1px solid #555;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    margin-bottom: 1rem;
}

.search-results-list {
    min-height: 100px;
}

.search-result-item {
    padding: 0;
    border-bottom: none;
    line-height: 1.2;
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-title {
    color: #ccc;
    font-size: 0.9rem;
    margin-right: 0.1rem;
}

.watch-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.watch-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.no-results {
    color: #ccc;
    padding: 1rem 0;
}

/* --- Página de Grade Genérica (para categorias) --- */
.page-main-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #555;
    padding-bottom: 0.5rem;
}

.grid-page-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

/* --- Menu Lateral (Sidebar) --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100%;
    background-color: #1f2937;
    border-right: 1px solid #4b5563;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.visible {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    z-index: 999;
}

.sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-section {
    margin-bottom: 1rem;
    border-bottom: 1px solid #4b5563;
    padding-bottom: 1rem;
}
.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section-title {
    padding: 0 1.5rem 0.5rem 1.5rem;
    font-size: 0.8rem;
    color: #9ca3af;
    text-transform: uppercase;
    font-weight: bold;
}

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.sidebar a:hover {
    background-color: #374151;
}

.submenu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.submenu-toggle i {
    transition: transform 0.3s;
}

.has-submenu.open > .submenu-toggle i {
    transform: rotate(90deg);
}

.submenu {
    display: none;
    background-color: #111827;
}

.submenu a {
    padding-left: 2.5rem;
}

.has-submenu.open > .submenu {
    display: block;
}

/* --- PÁGINA DE EXIBIÇÃO (WATCH.HTML) --- */
.watch-page-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100vh;
}

#watch-main-content {
    flex-grow: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
}

.watch-container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 2rem auto;
    aspect-ratio: 16 / 9;
    background-color: #000;
}

.player-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.error-message {
    color: #ff4d4d;
    text-align: center;
    width: 100%;
}

.bottom-content-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.recommendations-section {
    flex: 2;
}

.comments-section {
    flex: 1;
    min-width: 300px;
}

#recommendations-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

/* --- NOVO DESIGN PÁGINA DE DETALHES (BASEADO NA IMAGEM) --- */

.series-details-page {
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* Estilo para a imagem de capa no topo - Ajustado para ser maior */
.series-backdrop-banner {
    width: 100%;
    max-width: 450px; /* AUMENTADO: O tamanho intermediário que você pediu */
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    margin: 0 0 2rem 0; /* Alinha à esquerda e adiciona margem inferior */
    border: 1px solid #444;
}

/* Container da lista de episódios */
.episodes-container {
    padding: 0 1rem;
}

/* Bloco de cada temporada */
.season-block-new {
    margin-bottom: 1.5rem;
}

/* Título da temporada (ex: 1ª Temporada) */
.season-title-new {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

/* Estilo para cada episódio */
.episode-item-new {
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    color: #e5e5e5;
    line-height: 1.5;
}

/* Estilo para o link "Assistir" */
.watch-link-new {
    color: #3b82f6;
    text-decoration: none;
    font-weight: normal;
}

.watch-link-new:hover {
    text-decoration: underline;
}