* {
    margin: 0;
    padding: 0
}

html, body {
    height: 100%;
}

:root {
    --white: #F0F8FF;
    --coral: #FF6B6B;
    --gray: #333333;
    --pink: #F77CC9;
}

body {
    background: hsla(173, 89%, 70%, 1);
background: linear-gradient(90deg, hsla(173, 89%, 70%, 1) 0%, hsla(196, 68%, 38%, 1) 100%);
background: -moz-linear-gradient(90deg, hsla(173, 89%, 70%, 1) 0%, hsla(196, 68%, 38%, 1) 100%);
background: -webkit-linear-gradient(90deg, hsla(173, 89%, 70%, 1) 0%, hsla(196, 68%, 38%, 1) 100%);
filter: progid: DXImageTransform.Microsoft.gradient( startColorstr="#6FF7E8", endColorstr="#1F7EA1", GradientType=1 );
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;
}

header {
    display: flex;
    align-items: center;
    margin: 1rem 0rem 3rem 1rem;
}

.header-logo {
    display: flex;
    height: 100px;
}

.heading-section {
    display: block;
}

.heading-div {
    display: flex;
    justify-content: center;
    flex-direction: row;
    color: var(--white);
}

.heading {
    font-family: Oswald, sans-serif;
    font-weight: 600;
    font-size: 26px;
    padding: 0 1em;
    text-align: center;
    position: absolute;
    /*Position absolute used for elements beneath heading*/
}

span {
    color: var(--pink);

}


/*Search bar*/
.search-section {
    display: flex;
    justify-content: center;
    margin-top: 8rem;
    gap: 2vw
}

.search-box {
    border-radius: 10px;
    height: 45px;
    width: 350px;
    background-color: var(--gray);
    padding-left: 5px;
    box-shadow: 0 0 5px,
    0 0 5px black;
    letter-spacing: 0.3px;
    color: var(--pink)
}

.search-box:focus {
    caret-color: var(--white);
    outline: 2px solid var(--pink);
    font-size: 14px;
    font-family: Rubik, sans-serif;
    font-weight: 450;
}

.search-box::placeholder {
    text-align: center;
    color: var(--pink);
    font-size: 14px;
    font-family: Rubik, sans-serif;
    font-weight: 450;
}

.search-button {
    width: 150px;
    height: 45px;
    border-radius: 5px;
    background-color: var(--gray);
    color: var(--pink);
    font-family: Rubik, sans-serif;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 0 5px,
    0 0 5px black;
}

.search-button:hover {
    cursor: pointer;
    font-size: 15px;
    transition: font-size 0.1s ease-in;
}

/*Image Carousel*/

.carousel-container {
            aspect-ratio: 16 / 9;
            max-width: 800px;
            position: relative;
            margin: 10px auto;
        }
    
        .carousel-item {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0; 
            visibility: hidden;
            transition: opacity 2s ease-in-out;
        }

        .carousel-item.visible {
            opacity: 1;
            visibility: visible;
        }
        .carousel-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        


/*API on search*/
#results-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    grid-template-rows: 3fr 3fr;
    place-items: center;
    gap: 20px;
    padding: 20px;
    margin-top: 20px;
}

.movie-card {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-align: center;
    font-family: 'Rubik', sans-serif;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.movie-card img {
    width: 100%;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.movie-card h3 {
    font-size: 16px;
    padding: 10px 5px;
    min-height: 25px; 
}

.movie-card p {
    font-size: 14px;
    color: var(--gray);
}


.overview {
    font-size: 12px;
    text-align: center;
}

.overview-div {
    display: none;
    padding-top: 10px;
    line-height: 22px;
}

.overview-div.visible {
    display: block
}

.description-div {
    color: var(--pink);
    text-decoration: underline;
    padding-top: 10px;
    cursor: pointer;
    font-size: 18px;
    font-family: Rubik, sans-serif;
    font-weight: 300;
}

.user-score {
    color: var(--pink);
}

/*Trailer Player*/

.player-container {
   display: none;
   position: fixed;
   width: 100%;
   height: 100%;
   background-color: rgba(0, 0, 0, 0.6);
   top: 0;
   left: 0;
   z-index: 1000
}

.trailer {
    position: relative;
    width: 90%;
    max-width: 880px;
    margin: 5% auto;
}

.trailer-player-container {
    position: relative;
    height: 0;
    padding-bottom: 56.25%;
    background-color: black;
}

.trailer-player-container iframe {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.trailer-button {  
    font-size: 1.7em;
    border-radius: 5px;
    background-color: var(--gray);
    color: var(--pink);
    font-family: Rubik, sans-serif;
    font-weight: 500;
    cursor: pointer;
    box-shadow: inset 0 0 5px,
    0 0 5px black;
}

.play-trailer-button {
    height: 50px;
    width: 50%;
    border-radius: 5px;
    background-color: var(--gray);
    color: var(--pink);
    font-family: Rubik, sans-serif;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 0 5px,
    0 0 5px var(--coral);
}

.play-trailer-button:hover {
    font-size: 15px;
    transition: font-size 0.1s ease-in;
}

/*attribution*/ 
.attribution-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 220px;
}

.tmdb-logo {
    height: 100px;
    width: 100px;
}

h2 {
    margin-top: 25px;
    font-size: 13px;
}


/*Media Queries*/

@media only screen and (max-width: 768px) {
    header {
        justify-content: center;
        flex-direction: column;
    }
    .search-section {
        padding-top: 50px;
    }
}