/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: url('https://image.tmdb.org/t/p/original/9yBVqNruk6Ykrwc32qrK2TIE5xw.jpg') no-repeat center/cover;
    color: white;
    font-family: Arial, sans-serif;
    padding-top: 80px;
}

body::before {
    content: "";
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: -1;
}

/* HEADER */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: #111;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    z-index: 999;
}

.logo {
    font-family: 'Bebas Neue';
    font-size: 30px;
    color: red;
    cursor: pointer;
    transition: 0.3s;
}

.logo:hover {
    transform: scale(1.1);
}

nav button {
    background: transparent;;
    padding: 10px;
    font-size: 20px;
    border: none;
    color: white;
    cursor: pointer;
    margin: 0 10px;
    transition: 0.3s;
}

nav button:hover {
    color: red;
    transform: scale(1.1);
}

.spacer {
    height: 70px;
}

/* BUSCA */
.search-box {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
}

.search-box input {
    width: 60%;
    padding: 10px;
    border-radius: 6px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    transition: 0.3s;
}

.search-box input:focus {
    background: rgba(0,0,0,0.6);
    outline: none;
}

.search-box button {
    background: red;
    border: none;
    padding: 10px 15px;
    color: white;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.3s;
}

.search-box button:hover {
    transform: scale(1.1);
}

/* TITULOS */
.secao {
    margin: 20px;
    color: red;
}

/* CARROSSEL */
.carrossel-container {
    position: relative;
}

.carrossel {
    display: flex;
    overflow: hidden;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding: 10px 20px;
    scroll-behavior: smooth;
}

.carrossel::-webkit-scrollbar {
    display: none;
}

.carrossel img {
    width: 150px;
    scroll-snap-align: start;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.carrossel img:hover {
    transform: scale(1.1);
}

/* SETAS */
.seta {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    border: none;
    color: white;
    font-size: 25px;
    cursor: pointer;
    padding: 10px;
    opacity: 0;
    transition: 0.3s;
}

.carrossel-container:hover .seta {
    opacity: 1;
}

.esquerda { left: 0; }
.direita { right: 0; }

/* GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
    gap: 15px;
    padding: 20px;
}

.filme {
    position: relative;
}

.filme img {
    width: 100%;
    border-radius: 8px;
}

.favorito {
    position: absolute;
    top: 8px;
    right: 8px;
    cursor: pointer;
}

.favorito i {
    color: white;
}


/* FADE RESULTADOS */
.grid {
    animation: fade 0.5s;
}

@keyframes fade {
    from {opacity:0}
    to {opacity:1}
}

/* FAVORITO ANIMAÇÃO */
.favorito i {
    transition: 0.3s;
}

.favorito.ativo i {
    color: red;
    animation: pulse 0.4s;
}

@keyframes pulse {
    0% {transform: scale(1);}
    50% {transform: scale(1.4);}
    100% {transform: scale(1);}
}

/* MOVIE PAGE */
.movies {
    display: flex;
    gap: 20px;
    padding: 40px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.movies h2 {
    display: flex;
    justify-content: center;
}



.movies img {
    width: 250px;
}

#trailer {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 20px;
}

#trailer iframe {
    width: 100%;
    height: 450px;
    border-radius: 10px;
    max-width: 900px;
}

footer {
    text-align: center;
    padding: 20px;
    background: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* RESPONSIVO */
@media (max-width:768px){
    .movies {
        flex-direction: column;
        text-align: center;
    }
    .search-box input {
        width: 80%;
    }
    .carrossel img {
        width: 120px;
    }

    #trailer iframe {
        width: 95%;
        height: 250px;
    }
}

/* HEADER RESPONSIVO */
@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav button {
        font-size: 16px;
        margin: 5px;
    }
}

@media (max-width: 600px) {
    .search-box {
        flex-direction: column;
        align-items: center;
    }

    .search-box input {
        width: 100%;
    }

    .search-box button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (max-width: 768px) {
    .seta {
        display: none;
    }
}

@media (max-width: 600px) {
    .movies img {
        width: 180px;
    }
    @media (max-width: 600px) {
    .spacer {
        height: 140px;
    }
}
    }


@media (max-width: 600px) {
    .secao {
        text-align: center;
        margin: 15px 0;
    }

    footer {
        flex-direction: column;
        font-size: 14px;
    }
}

/* FIX PAGINA MOVIE MOBILE */
@media (max-width: 768px) {
    .movies {
        width: 100%;
        padding: 20px;
        justify-content: flex-start; /* 👈 muda isso */
    }

    .movies > * {
        width: 100%;
        max-width: 100%;
    }
}

/* FIX PAGINA MOVIE MOBILE */
@media (max-width: 768px) {
    .movies {
        width: 100%;
        padding: 20px;
        justify-content: flex-start; /* 👈 muda isso */
    }

    .movies > * {
        width: 100%;
        max-width: 100%;
    }
}