@import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap");

:root {
    font-family: "Roboto", sans-serif;
    font-weight: 400;
    font-style: normal;
}

body {
    background-color: #121212; /* Couleur de fond sombre */
    color: #fff; /* Couleur du texte */
    margin: 0;
    padding: 0;
}

body::-webkit-scrollbar {
    width: 0;
}

header {
    text-align: center;
    padding: 0 0 20px 0;
    width: 100%;
}

#navig {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-around;
}

#divRequestMovie {
    /* width: 50%; */
    padding: 1.2em 0;
    margin-left: 5%;
    background-color: #222;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    top: 0;
    font-size: x-large;
}

#divRequestMovie span {
    font-size: x-small;
}

#divRequestMovie:hover {
    background-color: #333;
    transform: scale(1.02);
    transition: all 0.5s;
    cursor: pointer;
}

#requestMovie {
    width: 20%;
    color: #ffffff;
    text-decoration: none;
}

#account-link {
    margin-top: 20px;
}

#account-link:hover {
    transform: scale(1.1);
    transition: all 0.5s;
}
#my-account {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
}
#my-account-img {
    width: 50px;
    border-radius: 50%;
}
#my-account-span {
    margin-left: 10px;
}

h1 {
    font-size: 36px;
}

.main {
    padding: 20px;
}

.movie-selection,
.recommand-selection {
    margin-top: 20px;
}

.movie-selection h2,
.recommand-selection h2 {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

.all-card {
    display: flex;
    flex-wrap: wrap; /* Pour empêcher le retour à la ligne */
    justify-content: center; /* Alignement à gauche */
    padding-bottom: 20px; /* Ajout d'un espace pour les flèches de défilement */
    padding-top: 20px;
    transition: transform 0.3s ease;
}

.all-card::-webkit-scrollbar {
    width: 0; /* Masquer la barre de défilement sur Chrome/Safari */
}

.movie-card {
    background-color: #1c1c1c; /* Couleur de fond des cartes de film */
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2); /* Effet de lumière */
    width: calc(25% - 20px); /* Pour quatre cartes par ligne avec espacement */
    margin-right: 30px;
    margin-left: 30px;
    flex: 0 0 calc(25% - 20px);
    height: auto;
    display: flex;
    align-items: center;
    scroll-snap-align: start;
    cursor: pointer;
}

.movie-card:hover {
    background-color: #2c2c2c;
}

.movie-card img {
    width: 50%; /* La moitié de la carte */
    height: auto;
    border-radius: 6px;
    margin-right: 1vw;
}

.info {
    width: 50%; /* La moitié de la carte */
    padding-left: 20px; /* Espacement pour les informations */
    box-sizing: border-box; /* Inclure le padding dans la largeur */
}

.movie-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #ff4d4d; /* Couleur du titre en rouge */
}

.types p {
    display: inline-block;
    background-color: #007bff; /* Couleur du fond des types en bleu */
    color: #fff;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 4px;
    margin-right: 5px;
}

.movie-card p {
    font-size: 16px;
    margin-bottom: 5px;
}

.description {
    display: none;
}

.id {
    display: none;
}

#popup-id {
    display: none;
}

/* Barre de recherche */
.search-container {
    margin-bottom: 20px;
    width: 100%;
    /* position: sticky; */
    top: 3.8vh;
}

#search-bar {
    margin-left: 50%;
    transform: translate(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    width: 80%;
}

#search-input {
    width: 50%;
    height: 60px;
    font-size: 16px;
    border: none;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    background-color: #333333;
    color: #fff;
    outline: none;
}

button[type="submit"] {
    cursor: pointer;
    outline: none;
    height: 62px;
    /* Pour que le bouton soit en bas du champ de saisie */
    line-height: 40px;
    text-align: center;
    font-size: 18px;
    color: #fff;
    background-color: #333333;
    border: none;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    transition: all 0.2s ease;
    width: 15%;
}

button[type="submit"]:hover {
    background-color: #444444;
}

/* search */
#a-search {
    color: white;
    text-decoration: none;
    background-color: black;
    font-size: 1.5vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

#a-search:hover {
    background-color: #555; /* Légère modification de la couleur au survol */
}

#a-search img {
    width: 2%;
    filter: invert(1);
    margin-right: 10px;
}

#popup-bg {
    display: none;
    position: fixed;
    background-color: rgba(0, 0, 0, 0.5);
    width: 100vw;
    height: 100vh;
    top: 0;
    justify-content: center;
    align-items: center;
}

#popup {
    width: 80vw;
    min-height: 80vh;
    background-color: #121212;
    border-radius: 20px;
    display: flex;
    align-items: center;
    position: relative;
}

#popup-img {
    width: 30%;
    margin-left: 2.5%;
}

#popup-infos {
    margin-left: 2.5%;
    margin-right: 2.5%;
    width: 62.5%;
    height: 85%;
}

#popup-croix-div {
    display: flex;
    align-items: center;
    justify-content: right;
    width: 100%;
    height: auto;
    position: absolute;
    z-index: 10;
    top: 5%;
    right: 2.5%;
}

#popup-croix {
    width: 2.5%;
    filter: invert(1);
    cursor: pointer;
}

#popup-title {
    margin-top: 2%;
    color: #ff4d4d;
    font-size: 3vw;
    margin-bottom: 0;
}

#popup-types {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.popup-type {
    background-color: #007bff;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    margin-right: 10px;
}

#popup-date {
    margin-top: 0;
    font-size: 1.5vw;
}

#popup-description {
    font-size: 1.25vw;
}

#popup-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 6.5vh;
    margin: 5% 0;
}

#popup-play {
    outline: none;
    cursor: pointer;
    background-color: rgb(80, 192, 36);
    border: none;
    color: #fff;
    height: 100%;
    width: 35%;
    border-radius: 15px;
}

#popup-play:hover {
    background-color: rgb(60, 142, 28);
}

#popup-play-disabled {
    outline: none;
    cursor: pointer;
    border: none;
    color: #fff;
    height: 100%;
    width: 45%;
    border-radius: 15px;
    background-color: rgb(32, 82, 12);
}

#popup-add {
    outline: none;
    cursor: pointer;
    background-color: rgb(192, 135, 36);
    border: none;
    color: #fff;
    height: 100%;
    width: 35%;
    border-radius: 15px;
}

#popup-add:hover {
    background-color: rgb(126, 85, 15);
}

#popup-down {
    outline: none;
    cursor: pointer;
    background-color: rgb(36, 80, 192);
    border: none;
    color: #fff;
    height: 100%;
    width: 20%;
    border-radius: 15px;
}

#popup-down:hover {
    background-color: rgb(28, 80, 142);
}

#popup-down-disabled {
    outline: none;
    cursor: pointer;
    border: none;
    color: #fff;
    height: 100%;
    width: 45%;
    border-radius: 15px;
    background-color: rgb(28, 80, 142);
}

#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

#pagination a {
    text-decoration: none;
    color: #ffffff;
    background-color: #333333;
    padding: 10px 15px;
    margin: 0 5px;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-size: 16px;
}

#pagination a:hover {
    background-color: #555555;
    transform: scale(1.1);
}

#pagination a.active {
    background-color: #007bff;
    font-weight: bold;
    pointer-events: none;
    transform: scale(1.15);
}

/* Media Query pour les petits écrans */
@media only screen and (max-width: 768px) {
    #navig {
        flex-direction: column;
        margin: 0 0 15% 0;
    }
    #requestMovie {
        width: 80%;
        margin: 0 10%;
    }
    #divRequestMovie span {
        font-size: large;
    }
    .movie-card {
        width: calc(50% - 80px); /* Prendre 50% de la largeur avec espacement */
        margin-bottom: 20px;
        margin-left: 10px;
        margin-right: 10px;
        flex: 0 0 calc(50% - 80px); /* Empêcher le rétrécissement */
        flex-wrap: wrap;
    }
    .movie-card img {
        width: 100%; /* Adapter la taille de l'image à 100% de la carte */
        margin-right: 0; /* Supprimer la marge de droite pour l'image */
        margin-bottom: 10px; /* Espacement entre les images */
    }
    .movie-selection h2,
    .recommand-selection h2 {
        font-size: 5vw;
    }
    .info {
        width: 100%; /* Adapter la taille de l'info à 100% de la carte sur les petits écrans */
        padding-left: 5%; /* Supprimer le padding sur les petits écrans */
        display: flex; /* Utiliser flexbox */
        flex-direction: column; /* Disposer les éléments verticalement */
        align-items: flex-start; /* Aligner les éléments en haut */
    }
    .movie-card h3 {
        font-size: 3vw; /* Réduire la taille du titre sur les petits écrans */
        margin-bottom: 5px; /* Ajouter un espacement entre le titre et le texte */
    }
    .types p {
        font-size: 1.5vw; /* Réduire la taille du texte des types sur les petits écrans */
        margin-bottom: 5px; /* Ajouter un espacement entre les types */
    }
    .movie-card p {
        font-size: 2vw; /* Réduire la taille du texte sur les petits écrans */
        margin-bottom: 5px; /* Ajouter un espacement entre les paragraphes */
    }
    #search-bar {
        width: 95%;
    }
    #search-input {
        width: 85%; /* Rendre la largeur de l'input adaptable aux petits écrans */
        height: 40px; /* Fixer la hauteur de l'input */
    }
    button[type="submit"] {
        width: 50%; /* Centrer le bouton horizontalement sur les petits écrans */
        height: 42px;
        font-size: large;
    }
    #a-search {
        font-size: 4.5vw;
    }
    #a-search img {
        width: 5%;
    }
    #popup {
        flex-direction: column;
    }
    #popup-croix {
        display: none;
    }
    #popup-infos {
        width: 85%;
    }
    #popup-img {
        margin-top: 5%;
        width: 50%;
    }
    #popup-title {
        font-size: 6vw;
        text-align: center;
    }
    #popup-types {
        font-size: 4vw;
        flex-wrap: wrap;
        margin-top: 15px;
        align-items: center;
        justify-content: center;
    }
    .popup-type {
        margin-top: 0;
        margin-bottom: 10px;
    }
    #popup-date {
        font-size: 3.5vw;
        text-align: center;
    }
    #popup-description {
        font-size: 3vw;
        text-align: center;
    }
    #popup-buttons {
        flex-wrap: wrap;
        margin-bottom: 30%;
        height: 5vh;
        margin-top: 5%;
    }
    #popup-play {
        width: 45%;
    }
    #popup-play-disabled {
        width: 45%;
    }
    #popup-add {
        width: 45%;
    }
    #popup-down {
        width: 90%;
        margin-left: 5%;
        margin-top: 5%;
    }
    #popup-down-disabled {
        width: 90%;
        margin-left: 5%;
        margin-top: 5%;
    }
    #pagination {
        transform: scale(0.9);
    }
}

/* Pour les grands écrans */
@media only screen and (min-width: 768px) {
    .movie-card h3 {
        font-size: 24px; /* Taille du titre sur les grands écrans */
    }
    .types p {
        font-size: 14px; /* Taille du texte des types sur les grands écrans */
    }
    .movie-card p {
        font-size: 16px; /* Taille du texte sur les grands écrans */
    }
}
