*, *::after, *::before{
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #131b2e;
    --bg-head: #010203;
    --bg-head-2: #01020333;
    /* --bg-edit: #77CBDA;
    --bg-check: #80EF80;
    --bg-delete: #FF746C;
    --bg-save: #B3EBF2;
    --bg-task-end: #80EF80de; */
    --text-logo: #E50914;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #06b6d4;
    --border: #2B2B2B;
    /* --border-check: #218838;
    --border-edit: #003693;
    --border-delete: #c82333; */

    /* Z-INDEX - VALUES*/
    --z-10: 10;
    --z-20: 20;
    --z-30: 30;
}

body{
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: 'Bebas neue';
}

/* =============== HEADER SECTION =============== */

.header{
    height: 6dvh;
    width: 100%;
    background: linear-gradient(var(--bg-head) 78%, transparent);
    color: var(--text-logo);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    padding: 0 10px;
    z-index: var(--z-10);
}

.header__menu__button, .nav__close-button{
    background-color: transparent;
    color: var(--text-main);
    border: none;
    border-radius: 4px;
}

.nav__close-button{
    position: absolute;
    z-index: var(--z-30);
    top: 12px;
    left: 12px;
}

.header__menu__button:active, .nav__close-button:active{
    background-color: var(--text-logo);
    color: var(--bg-head);
}

.header__menu__button:hover, .nav__close-button:hover, .list__item:hover{
    cursor: pointer;
}

.menu-icon, .close-icon{
    padding-top: 3px;
}

/* ========== HEADER TITLE ========== */

.header__title{
    display: flex;
    align-items: center;
    font-size: clamp(1em, 1.15em + 2.3dvw, 2.6em);
    letter-spacing: 5px;
    text-align: center;
    overflow-wrap: anywhere;
    text-wrap: balance;
    text-shadow: 0px 4px 8px var(--bg-head);
}

/* ===== NAV BAR SECTION ===== */

.header__nav{
    height: 100%;
    width: 65%;
    position: fixed;
    background-color: var(--bg-head);
    top: 0;
    left: 0;
    z-index: var(--z-20);
    border-radius: 0px 14px 14px 0px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateX(-100%);
    transition: transform .3s ease-in-out;
}

.header__nav.activo {
    transform: translateX(0);
}

.nav__list{
    width: 100%;
    display: flex;
    flex-direction: column;
}

.list__item{
    list-style-type: none;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: inherit;
}

.list__item:last-child{
    border-bottom: 1px solid var(--border);
}

.item__link, .item__link:link, .item__link:visited{
    color: var(--text-main);
}

.item__link:active{
    color: var(--bg-head);
    background-color: var(--text-logo);
    border-radius: 0px 42px 42px 0px;
}

.list__item:active::before, .list__item:active::after{
    content: '';
    display: inline-block;
    width: 22px;
    height: 22px;
    position: absolute;
    z-index: var(--z-30);
    background-color: transparent;
    left: 0;
}

.list__item:active:before{
    top: -22px;
    border-bottom-left-radius: 22px;
    box-shadow: -4px 4px 0px 4px var(--text-logo);
}

.list__item:active:after{
    bottom: -22px;
    border-top-left-radius: 22px;
    box-shadow: -4px -4px 0px 4px var(--text-logo);
}

.item__link{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 14px;
    height: 100%;
    text-decoration: none;
    overflow-wrap: anywhere;
    text-wrap: balance;
    border-radius: 0px 42px 42px 0px;
    transition: color .1s, background-color .1s;
}

.item__title{
    display: flex;
    align-items: center;
    text-align: center;
    font-size: clamp(.85em, 1.22em + 1.4dvw, 2em);
}

/* =============== MAIN SECTION =============== */

.main{
    margin-top: 3dvh;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---- SECTION MAIN MOVIE - CARRUSEL ---- */

.section__main-movie{
    width: 100%;
    max-width: 1280px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%);
}

.carrusel-track{
    display: flex;
    transition: transform .5s ease-in-out;
}

.carrusel-track .track__container {
    position: relative;
    max-width: 100%;
    flex-shrink: 0;
    height: auto;
}

.carrusel-track img, .img__premier-movie, .img__sample-movie {
    max-width: 100%;
    flex-shrink: 0;
    height: auto;
    object-fit: cover;
}

.track__title{
    width: 100%;
    color: var(--text-main);
    position: absolute;
    z-index: var(--z-10);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: clamp(1.45em, 1.1em + 3dvw, 4.4em);
    user-select: none;
    overflow-wrap: anywhere;
    text-wrap: balance;
    text-shadow: 0px 0px 28px var(--bg-primary);
}

/* ========== GRID MOVIES - 1020 PX ========== */
.grid__movies{
    margin: 9dvh 24px;
    margin-bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(230px, 1fr));
    grid-template-rows: repeat(3, minmax(120px, 1fr));
    gap: 10px;
}

/* ========== SECTION MOVIES ========== */

.section__movies, .section__series{
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0px 24px 24px 24px;
    gap: 18px;
}

.movies__title{
    font-size: clamp(1.5em, 3.2dvw, 2.75em);
    color: var(--text-main);
}

.movies__title::selection{
    background-color: var(--text-logo);
}

.movies{
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
}

.movies__track, .movies__track__main{
    display: flex;
    overflow-x: auto;
    gap: 8px;
    scrollbar-width: none;
}

.movies__track::-webkit-scrollbar, .movies__track__main::-webkit-scrollbar {
    display: none;
}

.poster__container{
    width: 100px;
    flex-shrink: 0;
    user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.poster__link, .track__link{
    display: inline-block;
    max-width: 100%;
    height: auto;
}

.poster__link{
    height: 100%;
}

.poster__img{
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    user-select: none;
    transition: scale .35s;
}

.poster__img[alt="Imagen no disponible"] {
    object-fit: contain;
    padding: 20px;
    background-color: #1a1a2e;
}

.poster__img:hover{
    scale: 1.03;
    cursor: pointer;
}

.poster__title{
    font-size: clamp(.9em, 1.3dvw, 1.18em);
    overflow-wrap: anywhere;
    text-wrap: balance;
    text-align: center;
    display: block;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}


/* ---- SPINNER DE CARGA ---- */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    width: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--text-main);
    border-top: 4px solid var(--text-logo);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

svg{
    width: 30px;
    height: 30px;
}

/* ======== MEDIA QUERIES ========= */
@media screen and (max-width: 375px){
    .nav__close-button{
        top: 12px;
        left: 10px;
    }
    .item__title{
        font-size: clamp(.65em, 1em + 1.1dvw, 1.2em);
    }
    svg{
        width: 24px;
        height: 24px;
    }
}

@media screen and (min-width: 420px){
    .header{
        background: linear-gradient(var(--bg-head) 2%, transparent);
    }
    .main{
        margin-top: 0;
    }
}

@media screen and (min-width: 530px) {
    .item__link{
        gap: 20px;
    }
    .poster__container{
        width: 125px;
    }
    .poster__title{
        font-size: clamp(1.2em, 1.8dvw, 1.24em);
    }
    svg{
        width: 36px;
        height: 36px;
    }
}

@media screen and (min-width: 760px){
    .header{
        height: 8dvh;
        padding: 0 12px;
    }
    .header__menu__button{
        display: none;
    }
    .header__title{
        height: 100%;
    }
    .header__nav{
        height: 100%;
        width: auto;
        position: static;
        background-color: transparent;
        z-index: inherit;
        border-radius: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        transform: none;
        transition: none;
    }
    .nav__close-button, .header__nav svg{
        display: none;
    }
    .nav__list{
        width: auto;
        height: 100%;
        flex-direction: row;
        gap: 12px;
    }

    .list__item{
        border: none;
        position: static;
        display: flex;
        align-items: center;
    }

    .list__item:last-child{
        border-bottom: none;
    }

    .item__link:active{
        color: var(--bg-head);
        background-color: var(--text-logo);
        border-radius: 12px;
    }

    .list__item:active::before, .list__item:active::after{
        content: '';
        display: none;
        width: 0;
        height: 0;
        position: static;
        z-index: inherit;
    }
    .item__link{
        display: flex;
        align-items: center;
        gap: 0;
        height: auto;
        padding: 3px 6px 0px 6px;
        text-decoration: none;
        overflow-wrap: anywhere;
        text-wrap: balance;
        transition: color .1s, background-color .1s;
        border-radius: 12px;
    }

    .item__title{
        display: flex;
        align-items: center;
        text-align: center;
        line-height: 1.6;
        font-size: clamp(.83em, 1.15em + 1dvw, 2.6em);
        text-shadow: 0px 4px 8px var(--bg-head);
    }
}

@media screen and (min-width: 1020px) {
    .header{
        padding: 0 16px;
        padding-top: 10px;
    }
    .nav__list{
        gap: 18px;
    }
    .section__main-movie{
        grid-column: 1 / span 2;
        grid-row: 1 / span 2;
        mask-image: none;
    }
    .premier__movie{
        grid-column: 3 / span 2;
        grid-row: 1 / span 2;
        position: relative;
    }
    .sample__movie{
        position: relative;
    }
    .title__premier-movie, .title__sample-movie{
        position: absolute;
        z-index: var(--z-10);
        color: var(--text-main);
        text-decoration: none;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        font-size: clamp(1.45em, 1.1em + 3dvw, 4.4em);
        user-select: none;
        overflow-wrap: anywhere;
        text-wrap: balance;
        text-shadow: 0px 0px 28px var(--bg-primary);
        opacity: 0; 
        transition: opacity .35s;
    }
    .title__sample-movie{
        font-size: clamp(1.1em, 1em + 2dvw, 1.35em);
    }
    .poster__container{
        width: 140px;
    }
    .carrusel-track, .track__link, .carrusel-track img, .img__premier-movie, .img__sample-movie {
        height: 100%;
    }

    .section__main-movie, .img__premier-movie, .img__sample-movie{
        border-radius: 8px;
        transition: scale .35s, opacity .35s;
    }

    .section__main-movie:hover, .img__premier-movie:hover, .img__sample-movie:hover, .img__premier-movie:has(+.title__premier-movie:hover), .img__sample-movie:has(+.title__sample-movie:hover){
        cursor: pointer;
        scale: 1.02;
        opacity: .7;
    }

    .title__premier-movie:hover, .title__sample-movie:hover{
        opacity: .85;
        cursor: pointer;
    }

    .img__premier-movie:hover+.title__premier-movie, .img__sample-movie:hover+.title__sample-movie{
        opacity: .85;
    }
}

@media screen and (min-width: 1400px){
    .header{
        padding: 0 20px;
        padding-top: 14px;
    }
    .header__title{
        font-size: clamp(1.25em, 1.45em + 3dvw, 3.5em);
        letter-spacing: 7px;
    }
    .nav__list{
        gap: 24px;
    }
    .grid__movies{
        margin: 10dvh auto;
        margin-bottom: 0;
        max-width: 1280px;
    }
    .title__sample-movie{
        font-size: clamp(1.25em, 1em + 2.2dvw, 1.8em);
    }
    .poster__container{
        width: 175px;
    }
    .item__link{
        padding: 3px 9px 0px 9px;
    }
    .item__title{
        line-height: normal;
        font-size: clamp(1em, 1.15em + 1.45dvw, 2.5em);
    }
    .section__movies, .section__series{
        padding: 3.75dvw;
        padding-top: 0;
    }
}

@media screen and (min-width: 1580px){
    .header{
        padding: 0 26px;
        padding-top: 18px;
    }
    .nav__list{
        gap: 26px;
    }
    .poster__container{
        width: 230px;
    }
}

@media screen and (min-width: 1980px){
    .header{
        height: 10dvh;
        padding: 0 30px;
        padding-top: 22px;
    }
    .header__title{
        font-size: clamp(1.35em, 1.6em + 3.8dvw, 4.8em);
        letter-spacing: 7px;
    }
    .nav__list{
        gap: 30px;
    }
    .title__sample-movie{
        font-size: clamp(1.45em, 1.15em + 2.8dvw, 2.4em);
    }
    .grid__movies{
        margin: 11dvh auto;
        margin-bottom: 0;
        max-width: 1780px;
    }
    .poster__container{
        width: 260px;
    }
    .item__link{
        padding: 3px 12px 0px 12px;
    }
    .item__title{
        line-height: normal;
        font-size: clamp(1.2em, 1.45em + 2dvw, 3.75em);
    }
}

/* ======== ANIMATIONS ========= */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* ======== MOVIEINFO STYLES ========= */
.main__movieInfo{
    margin-top: 3dvh;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.movie__data__section, .description__and__trailer__section{
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.description__and__trailer__section{
    width: 90%;
    margin: auto;
}

.img__section{
    width: 100%;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%);
}

.img__back__container{
    width: 100%;
    position: relative;
}

.img__back{
    max-width: 100%;
    height: auto;
}

.title__back{
    width: 100%;
    position: absolute;
    z-index: var(--z-10);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: clamp(1.45em, 1.1em + 3dvw, 4.4em);
    user-select: none;
    overflow-wrap: anywhere;
    text-wrap: balance;
    text-shadow: 0px 0px 28px var(--bg-primary);
}

.description__section{
    width: 100%;
}

.description{
    font-weight: 100;
    text-align: justify;
    font-size: clamp(.75em, .88em + 1.28dvw, 1.4em);
}

/* ==== CALIFICATION AND TRAILER SECTION ====*/

.trailer__section{
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calification{
    font-size: clamp(1.15em, 1.25em + 1.5dvw, 2.2em);
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.button__trailer:link, .button__trailer:visited{
    color: var(--text-main);
}

.button__trailer{
    text-decoration: none;
    text-align: center;
    color: var(--text-main);
    background-color: var(--text-logo);
    display: flex;
    align-items: center;
    padding: 4px 8px;
    font-size: clamp(1em, 1em + 1.25dvw, 1.35em);
    border-radius: 6px;
    transition: color .3s;
    user-select: none;
}

.button__trailer:hover{
    color: var(--bg-head);
}

/* ==== CAST AND CREW SECTION ====*/

.cast__section, .crew__section{
    width: 90%;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.title__cast__section, .title__crew__section{
    font-size: clamp(1.5em, 3.2dvw, 2.75em);
    color: var(--text-main);
}

.cast__track, .crew__track{
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.profile__container{
    width: 100px;
    flex-shrink: 0;
    user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.img__profile{
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    user-select: none;
}

.text__container{
    font-size: clamp(.78em, .88em + .9dvw, 1.05em);
    overflow-wrap: anywhere;
    text-wrap: balance;
    text-align: center;
    display: block;
    height: 100%;
}

.name__profile__real{
    font-size: clamp(.68em, .82em + .75dvw, .95em);
}

.text__not__found{
    font-size: clamp(.9em, 1em + 1dvw, 1.15em);
    overflow-wrap: anywhere;
    text-wrap: balance;
    text-align: center;
    color: var(--text-logo);
}

/* ==== MEDIA QUERIES ==== */
@media screen and (min-width: 420px){
    .main__movieInfo{
        margin-top: 0;
    }
    .button__trailer{
        font-size: clamp(1.15em, 1.15em + 1.4dvw, 1.75em);
    }
}

@media screen and (min-width: 620px){
    .description{
        font-size: clamp(.88em, .9em + 1.3dvw, 1.5em);
    }
    .button__trailer{
        padding: 4px 10px;
        font-size: clamp(1.25em, 1.25em + 1.45dvw, 1.9em);
    }
    .profile__container{
        width: 120px;
        gap: 6px;
    }
    .text__container{
        font-size: clamp(1em, 1.1em + 1.25dvw, 1.5em);
    }

    .name__profile__real{
        font-size: clamp(.7em, .7em + .85dvw, 1.15em);
    }

    .text__not__found{
        font-size: clamp(1em, 1.1em + 1.2dvw, 1.35em);
    }
}

@media screen and (min-width: 1020px) {
    .main__movieInfo{
        margin-top: 10dvh;
    }
    .movie__data__section{
        flex-direction: row;
        align-items: center;
        gap: 22px;
        width: 90%;
        margin: auto;
    }
    .img__section{
        max-width: 1280px;
        mask-image: none;
    }
    .img__back{
        border-radius: 8px;
    }
    .description__and__trailer__section{
        margin: 0;
        justify-content: space-evenly;
    }
    .description{
        font-size: clamp(1em, 1em + 1dvw, 1.85em);
    }
    .title__cast__section, .title__crew__section{
        font-size: clamp(1.65em, 1.65em + 1.35dvw, 3.25em);
    }
}

@media screen and (min-width: 1400px){
    .description__and__trailer__section{
        width: 70%;
    }
    .description{
        font-size: clamp(1.25em, 1.3em + 1.28dvw, 2em);
    }
    .calification{
        font-size: clamp(1.28em, 1.35em + 1.45dvw, 2.9em);
    }
    .button__trailer{
        padding: 6px 18px;
        font-size: clamp(1.35em, 1.38em + 1.5dvw, 2.9em);
    }
}

@media screen and (min-width: 1720px){
    .movie__data__section{
        justify-content: space-between;
    }
    .img__section{
        max-width: 840px;
    }
    .description__and__trailer__section{
        width: 45%;
    }
    .description{
        font-size: clamp(1.4em, 1.45em + 1.4dvw, 2.5em);
    }
    .calification{
        font-size: clamp(1.35em, 1.4em + 1.65dvw, 3.3em);
    }
    .button__trailer{
        padding: 8px 22px;
        font-size: clamp(1.5em, 1.45em + 1.75dvw, 3.6em);
    }
    .profile__container{
        width: 160px;
        gap: 8px;
    }
}

@media screen and (min-width: 1960px){
    .main__movieInfo{
        margin-top: 13dvh;
    }
    .img__section{
        max-width: 1024px;
    }
    .description{
        font-size: clamp(1.5em, 1.55em + 1.75dvw, 3em);
    }
    .calification{
        font-size: clamp(1.65em, 1.7em + 2.2dvw, 3.65em);
    }
    .button__trailer{
        padding: 10px 24px;
        font-size: clamp(1.65em, 1.75em + 2.3dvw, 3.9em);
    }
    .profile__container{
        width: 170px;
        gap: 10px;
    }
}

@media screen and (min-width: 2280px){
    .img__section{
        max-width: 1120px;
    }
    .profile__container{
        width: 180px;
        gap: 12px;
    }
}


/* ======= MOVIES PAGE ======= */
.main-movies-page{
    margin-top: 7dvh;
}

.title__main-movies-page{
    padding: 0 24px;
    font-size: clamp(2em, 2em + 1.25dvw, 3em);
}

.movies-page{
    display: none;
}

/* ======== MEDIA QUERIES MOVIES PAGE ======= */

@media screen and (min-width: 1400px){
    .main-movies-page{
        margin-top: 9dvh;
    }
}

@media screen and (min-width: 1980px){
    .main-movies-page{
        margin-top: 12dvh;
    }
}


/* ======= NEWS SECTION ======= */
.movies-news{
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    flex-direction: column;
    gap: 8px;
}

/* ======= MEDIA QUERIES ======= */

@media screen and (min-width: 530px){
    .movies-news{
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }
}

@media screen and (min-width: 1020px){
    .movies-news{
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
    }
}

@media screen and (min-width: 1400px){
    .movies-news{
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media screen and (min-width: 1980px){
    .movies-news{
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}