:root {
    /* Variáveis CSS para cores principais do tema Netflix */
    --netflix-red: #E50914;
    --dark-bg: #141414;
    --text-color: #ffffff;
}

* {
    /* Reset de margens e paddings para todos os elementos */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* Estilos globais do corpo da página */
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    overflow-x: hidden;
}

a {
    /* Estilos padrão para links */
    text-decoration: none;
    color: #e5e5e5;
    transition: color 0.3s;
}

a:hover {
    /* Efeito hover para links */
    color: #b3b3b3;
}

/* Navbar */
.navbar {
    /* Barra de navegação fixa no topo */
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4%;
    height: 70px;
    z-index: 1000;
    background-color: var(--dark-bg);
}

.navbar-left,
.navbar-right {
    /* Contêineres para elementos da navbar */
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    /* Logo da Netflix */
    width: 92px;
    margin-right: 25px;
    cursor: pointer;
}

.nav-links {
    /* Lista de links de navegação */
    list-style: none;
    display: flex;
    gap: 20px;
    font-size: 13px;
}

.nav-links .active {
    /* Link ativo destacado */
    font-weight: bold;
    color: white;
}

.icon {
    /* Ícones da navbar */
    font-size: 20px;
    cursor: pointer;
}

.kids-link {
    /* Link para perfil infantil */
    font-size: 14px;
}

.nav-notification {
    /* Contêiner de notificações */
    position: relative;
    cursor: pointer;
}

.notification-badge {
    /* Badge de notificação */
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--netflix-red);
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-menu {
    /* Menu de perfil */
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.profile-icon {
    /* Ícone do perfil */
    width: 32px;
    border-radius: 4px;
}

/* Sliders */
.sliders-container {
    /* Contêiner principal dos sliders/carrosséis */
    padding: 0 4%;
    padding-top: 100px;
    /* Space for navbar */
    position: relative;
    z-index: 3;
    padding-bottom: 100px;
}

.slider-section {
    /* Seção individual de slider */
    margin-bottom: 3.5vw;
}

.slider-header {
    /* Cabeçalho do slider com título e indicadores */
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 12px;
}

.slider-title {
    /* Título da categoria */
    font-size: 1.25vw;
    font-weight: bold;
    color: #e5e5e5;
    line-height: 1.25vw;
}

.slider-indicators {
    /* Indicadores de página do slider */
    display: flex;
    gap: 2px;
    margin-bottom: 4px;
}

.slider-indicators div {
    /* Barra individual do indicador */
    width: 12px;
    height: 2px;
    background-color: #4d4d4d;
}

.slider-indicators div.active {
    /* Indicador ativo */
    background-color: #aaa;
}

.movie-row {
    /* Linha de cartões de filme */
    display: flex;
    gap: 8px;
    /* Small gap between movie cards */
    overflow-x: visible;
    /* Let the expanded cards paint outside this box vertically */
    padding: 10px 4% 50px 4%;
    /* Added bottom padding to hold the expanding modal */
    margin: 0 -4%;
    /* Pull edges back out so we don't double up padding from container */
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.movie-row::-webkit-scrollbar {
    /* Esconde scrollbar no WebKit */
    display: none;
}

.movie-card {
    /* Cartão individual de filme */
    min-width: 250px;
    width: 250px;
    height: 140px;
    background-color: #222;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0s, border-radius 0.3s 0s, z-index 0s 0.3s, box-shadow 0.3s 0s;
    position: relative;
    z-index: 1;
    transform-origin: center center;
    /* Default origin */
}

/* Modifiers applied by JavaScript to prevent edge clipping */
.movie-card.origin-left {
    /* Origem de transformação para cartões na esquerda */
    transform-origin: left center;
}

.movie-card.origin-right {
    /* Origem de transformação para cartões na direita */
    transform-origin: right center;
}

.movie-card:hover {
    /* Efeito hover para cartões */
    transform: scale(1.6) translateY(-5%);
    /* Reduced vertical translation since container has more padding */
    z-index: 99;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s, border-radius 0.3s 0.6s, box-shadow 0.3s 0.6s, z-index 0s 0s;
}

.movie-card img {
    /* Imagem do cartã */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    transition: opacity 0.3s ease, border-radius 0.3s;
    z-index: 2;
}

.movie-card iframe {
    /* Iframe para vídeo do YouTube */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    border-radius: 4px;
    transition: opacity 0.3s ease, border-radius 0.3s;
    pointer-events: none;
    z-index: 1;
}

.movie-card iframe.playing {
    /* Iframe quando vídeo está tocando */
    opacity: 1;
    z-index: 3;
    border-radius: 6px 6px 0 0;
}

.movie-card:hover img {
    /* Imagem no hover */
    border-radius: 6px 6px 0 0;
    transition: border-radius 0s 0.6s;
}

.movie-card img.playing-video {
    /* Imagem quando vídeo está tocando */
    opacity: 0;
}

/* Card Details Modal */
.card-details {
    /* Modal de detalhes do cartão */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #181818;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    padding: 18px 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s 0s, visibility 0.3s 0s;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2;
    cursor: default;
}

.movie-card:hover .card-details {
    /* Modal visível no hover */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s 0.6s, visibility 0s 0.6s;
}

.details-buttons {
    /* Botões de ação nos detalhes */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.left-buttons,
.right-buttons {
    /* Grupos de botões */
    display: flex;
    gap: 8px;
}

.btn-icon {
    /* Botão com ícone */
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #2b2b2b;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s, background-color 0.2s;
}

.btn-icon:hover {
    /* Hover para botões */
    border-color: white;
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-play-icon {
    /* Botão de play especial */
    background-color: white;
    color: black;
    border: none;
}

.btn-play-icon:hover {
    /* Hover para botão de play */
    background-color: #e6e6e6;
}

.btn-play-icon i {
    /* Ícone do botão de play */
    margin-left: 2px;
}

.details-info {
    /* Informações do filme */
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: bold;
}

.match-score {
    /* Pontuação de compatibilidade */
    color: #46d369;
}

.age-badge {
    /* Badge de classificação etária */
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 1px 3px;
    border-radius: 2px;
    font-family: Arial, sans-serif;
}

.age-badge.red-accent {
    /* Badge vermelho para maiores restrições */
    background-color: #d32f2f;
    border: none;
    font-weight: bold;
}

.resolution {
    /* Badge de resolução */
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 1px 3px;
    border-radius: 2px;
    color: rgba(255, 255, 255, 0.9);
}

.duration {
    /* Duração do filme/série */
    color: rgba(255, 255, 255, 0.9);
}

.details-tags {
    /* Tags/categorias do filme */
    display: flex;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 4px;
}

.details-tags span:not(:last-child)::after {
    /* Separador entre tags */
    content: "•";
    color: #666;
    margin-left: 6px;
}

/* Badges */
.badge-top10 {
    /* Badge Top 10 */
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 28px;
    background-color: var(--netflix-red);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    z-index: 4;
    border-bottom-left-radius: 2px;
    box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.badge-top10 span.top {
    /* Texto "TOP" */
    font-size: 7px;
    letter-spacing: 0.5px;
    line-height: 8px;
}

.badge-top10 span.number {
    /* Número do ranking */
    font-size: 13px;
    line-height: 13px;
}

.badge-bottom {
    /* Badge inferior (novidade, etc.) */
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 4px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 2px;
    z-index: 4;
    white-space: nowrap;
    text-transform: uppercase;
}

.movie-card.has-progress .badge-bottom {
    /* Ajuste quando há barra de progresso */
    bottom: 12px;
}

.badge-bottom.red {
    /* Badge vermelho */
    background-color: var(--netflix-red);
    color: white;
}

.badge-bottom.white {
    /* Badge branco */
    background-color: white;
    color: black;
}

/* Progress bar */
.progress-bar-container {
    /* Contêiner da barra de progresso */
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(100, 100, 100, 0.7);
    z-index: 5;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.progress-value {
    /* Valor da barra de progresso */
    height: 100%;
    background-color: var(--netflix-red);
    border-bottom-left-radius: 4px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    /* Ajustes para dispositivos móveis */
    .nav-links {
        display: none;
    }

    .movie-card {
        min-width: 200px;
        width: 200px;
        height: 112px;
    }

    .slider-title {
        font-size: 4vw;
        line-height: 4.5vw;
    }
}

/* Footer */
footer {
    /* Estilos do rodapé */
    padding: 0 4%;
    color: #737373;
    font-size: 13px;
    margin-bottom: 20px;
}

.footer-content {
    /* Conteúdo do rodapé */
    max-width: 980px;
    margin: 0 auto;
}

.footer-content p {
    /* Parágrafo do rodapé */
    margin-bottom: 30px;
}

.footer-links {
    /* Links do rodapé */
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 15px;
}

.footer-links a {
    /* Links individuais */
    color: #737373;
}

.footer-links a:hover {
    /* Hover para links do rodapé */
    text-decoration: underline;
}

@media (max-width: 768px) {
    /* Ajustes móveis para rodapé */
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}