.portfolio {
  position: relative;
  width: 100%;
  min-height: 100%;
  padding-bottom: 83px;
}

.container_filtre {
  width: 1280px;
  height: 65px;
  padding-bottom: 16px;
  padding: 0 1rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: end;
  gap: 16px;
}

.form_filtre {
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn_reinitialiser {
  width: max-content;
  gap: 1rem;
  border: none;
  background-color: transparent;
  outline: none;
  margin-right: 5px;
  color: var(--color-btn);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.box_title i {
  font-size: 18px;
  margin-right: 8px;
}

.box_title p {
  font-size: 16px;
  font-weight: 500;
}

.select_filtre {
  width: 94px;
  height: 27px;
  border-radius: 4px;
  background-color: transparent;
  font-size: 12px;
  color: var(--color-btn);
  border: 1px solid var(--color-btn);
  transition: all 0.3s;
  margin-left: 5px;
}

@media only screen and (max-width: 1280px) {
  .container_filtre {
    width: 100%;
    margin: 1rem auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
}

@media only screen and (max-width: 950px) {
  .box_title i {
    font-size: 16px;
  }

  .box_title p {
    font-size: 14px;
  }

  .select_filtre {
    width: 80px;
    height: 23px;
    font-size: 12px;
  }
}

@media only screen and (max-width: 600px) {
  .btn_reinitialiser p {
    display: none;
  }
}


.container_portfolio {
  min-height: 100%;
  width: 1280px;
  margin: auto;
  text-align: center;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto;
  gap: 14px;
  padding-top: 10px;
}

.box_photo_portfolio {
  position: relative;
  grid-column: span var(--size, 1);
  height: 291px;
  overflow: hidden;
  cursor: default;
  transition: all 0.3s;
  z-index: 2;
  background-color: #f0f0f0;
}

.name_type_projet_portfolio {
  position: absolute;
  opacity: 0;
  bottom: 0%;
  width: 100%;
  height: max-content;
  padding: 10px;
  transition: all 0.3s;
}

.name_projet_hover,
.type_projet_hover {
  text-align: left;
  opacity: 1;
  color: #ffffff;
  font-family: "Roboto Slab", serif;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  transition: all 0.6s;
}

.name_projet_hover {
  font-size: 26px;
  font-weight: 500;
}

.type_projet_hover {
  font-size: 20px;
  font-weight: 400;
}

.box_photo_portfolio:hover .name_type_projet_portfolio {
  opacity: 1;
}

.box_photo_portfolio.clicked .name_type_projet_portfolio {
  opacity: 0;
}

.box_photo_portfolio_img:hover .img_projet_portfolio {
  transform: scale(1.05);
}

.box_photo_portfolio.clicked
  .box_photo_portfolio_img:hover
  .img_projet_portfolio {
  transform: scale(1);
}

.container_projet_carousel {
  height: 100%;
  width: 100%;
  position: relative;
}

.box_photo_portfolio.clicked .container_projet_carousel {
  width: 67%;
}

.box_photo_portfolio_img {
  width: 100%;
  height: 100%;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
  opacity: 1;
}

.img_projet_portfolio {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s;
}

.box_photo_portfolio:not(.clicked) .box_photo_portfolio_img {
  animation: fadeInOut 0.3s;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.box_photo_portfolio img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.box_photo_portfolio.tall {
  height: 355px;
}

.box_photo_portfolio.full-width {
  grid-column: span 4;
  height: 645px;
  width: 1280px;
  background-color: #f2f2f2;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8));
}

.box_photo_portfolio.hidden {
  display: none;
}

.box_photo_portfolio.full-width .box_photo_portfolio_img {
  width: 830px;
  height: 466px;
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translate(-50%, -5%);
}

.box_photo_portfolio.clicked .close_portfolio_img {
  display: block;
}

.close_portfolio_img {
  position: absolute;
  top: 2%;
  right: 1.5%;
  font-size: 36px;
  font-weight: 500;
  z-index: 10;
  color: var(--color-btn);
  border-radius: 5px;
  cursor: pointer;
  display: none;
}

.box_img_portfolio_other {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.box_img_portfolio_other img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

/* carousel portfolio */

.container_slider_portfolio {
  position: relative;
  top: 89%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 830px;
  height: 160px;
  display: none;
  z-index: 15;
  padding: 0 30px;
  transition: all 0.3s;
}

.box_photo_portfolio.clicked .container_slider_portfolio {
  display: block;
  cursor: default;
  transition: all 0.3s;
}

.container_slider_portfolio .slick-slide {
  position: relative;
  width: 240px;
  height: 140px;
  margin: 0 5px;
  transition: all 0.3s;
}

.box_slider_portfolio {
  width: 281rem;
  height: 160px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
}

.box_slider_portfolio img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.3s;
}

/* Styles pour les boutons de navigation */
/* Remove default arrow styles */
.slick-prev,
.slick-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background-color: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s;
  font-size: 0; /* Hide any text content */
}

.slick-prev {
  left: 0px;
}

.slick-next {
  right: 0px;
}

/* Hide default text and icons */
.slick-prev::before,
.slick-next::before {
  content: "" !important;
  display: none;
}

/* Create custom arrows */
.slick-prev::after,
.slick-next::after {
  content: "" !important;
  display: block;
  width: 20px;
  height: 20px;
  border-top: 4px solid #334960;
  border-left: 4px solid #334960;
}

.slick-prev::after {
  transform: rotate(-45deg);
  margin-left: 5px;
}

.slick-next::after {
  transform: rotate(135deg);
  margin-right: 5px;
}

/* Remove hover and active effects */
.slick-prev:hover,
.slick-next:hover,
.slick-prev:active,
.slick-next:active,
.slick-prev:focus,
.slick-next:focus {
  background-color: transparent;
  outline: none;
  box-shadow: none;
}

/* partie description projet */

.container_description_projet {
  width: 33%;
  height: 100%;
  overflow: visible;
  position: relative;
  display: block;
  gap: 16px;
  background-color: #f2f2f2;
  transition: all 0.3s;
}

.box_photo_portfolio.clicked .container_description_projet {
  display: block;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.info_telechargement_projet {
  position: relative;
  width: 100%;
  gap: 16px;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  padding: 0 50px;
}

.box_icon {
  width: 50%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.icon_projet_portfolio {
  width: 20px;
  height: 20px;
}

.info_icon_projet {
  font-size: 16px;
  font-weight: 600;
  color: #000000;
}

.description_projets_portfolio {
  font-size: 16px;
  font-weight: 400;
  color: #000000;
  text-align: center;
}

.btn_voir_projet {
  background-color: var(--color-btn);
  color: #fff;
  padding: 8px 20px;
  font-weight: 400;
  font-size: 16px;
  border-radius: 360px;
  border: none;
  cursor: pointer;
  display: none;
  transition: all 0.3s;
}

.box_photo_portfolio.clicked .btn_voir_projet {
  display: block;
}

/* Styles pour le drag & drop */
.sortable-ghost {
  opacity: 0.4;
  background-color: #f0f0f0;
}

.sortable-chosen {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  z-index: 3;
}

.sortable-drag {
  opacity: 0.8;
  transform: scale(1.05);
}

.box_photo_portfolio.dragging {
  cursor: grabbing;
  opacity: 0.8;
  transform: scale(1.05);
  z-index: 1000;
}
/* Responsive pour le portfolio - alternance 2 images / 1 image */
@media only screen and (max-width: 1280px) {
  .container_portfolio {
    width: 100%;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: 10px;
  }

  /* Première ligne : 2 images côte à côte */
  .box_photo_portfolio:nth-child(3n+1) {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    height: 33vh;
    border-radius: 4px;
    overflow: hidden;
  }

  .box_photo_portfolio:nth-child(3n+2) {
    grid-column: 2;
    grid-row: auto;
    width: 100%;
    height: 33vh;
    border-radius: 4px;
    overflow: hidden;
  }

  /* Si la dernière image d'une ligne de 2 est seule, elle prend toute la largeur */
  .box_photo_portfolio:nth-child(3n+1):last-child {
    grid-column: 1 / -1;
  }

  /* Deuxième ligne : 1 image pleine largeur */
  .box_photo_portfolio:nth-child(3n+3) {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
    height: 33vh;
    overflow: hidden;
  }

  /* Ajuster les classes existantes */
  .box_photo_portfolio.full-width {
    grid-column: 1 / -1;
    width: 100%;
    height: 33vh;
    overflow: hidden;
  }

  .box_photo_portfolio.tall {
    height: 33vh;
    overflow: hidden;
  }

  /* Assurer que les images couvrent bien leur conteneur */
  .box_photo_portfolio img,
  .img_projet_portfolio {
    object-fit: cover;
  }

  /* Réduire la taille du texte au survole */
  .name_projet_hover {
    font-size: 18px;
  }

  .type_projet_hover {
    font-size: 14px;
  }
}

/* Pour les écrans encore plus petits */
@media only screen and (max-width: 480px) {
  .container_portfolio {
    padding: 0 0.5rem;
    gap: 8px;
  }

  /* Réduire les hauteurs */
  .box_photo_portfolio:nth-child(3n+1),
  .box_photo_portfolio:nth-child(3n+2) {
    height: 25vh;
    border-radius: 4px;
    overflow: hidden;
  }

  .box_photo_portfolio:nth-child(3n+3) {
    height: 25vh;
    overflow: hidden;
  }

  .box_photo_portfolio.full-width {
    height: 25vh;
    overflow: hidden;
  }

  .box_photo_portfolio.tall {
    height: 25vh;
    overflow: hidden;
  }

  /* Assurer que les images couvrent bien leur conteneur */
  .box_photo_portfolio img,
  .img_projet_portfolio {
    object-fit: cover;
  }

  /* Réduire encore plus la taille du texte au survole */
  .name_projet_hover {
    font-size: 16px;
  }

  .type_projet_hover {
    font-size: 12px;
  }
}

/* Styles pour la modal responsive */
.responsive-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Empêcher le scroll du body quand la modal est ouverte */
.responsive-modal-open {
    overflow: hidden;
}

/* Masquer la barre de scroll du portfolio quand la modal est ouverte */
.responsive-modal-open .portfolio {
    overflow: hidden;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f2f2f2;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.modal-content {
    background-color: #f2f2f2;
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 20%;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20%;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #333;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.modal-image-container {
    width: 100%;
    height: 300px;
    position: relative;
    border-radius: 4px;
    flex-shrink: 0;
}

.modal-main-image {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
}


.modal-carousel-container {
    width: 100%;
    padding: 0 20px;
}

.modal-carousel {
    width: 100%;
}

.modal-carousel-item {
    padding: 0 5px;
}

.modal-carousel-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}


.modal-text-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 10px;
}

.modal-title {
    font-size: 32px;
    font-weight: bold;
    color: #101010;
    margin: 0;
    text-align: center;
}

.modal-description {
  font-size: 16px;
  font-weight: 400;
  color: #000000;
  text-align: center;
}

.modal-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 10px 0;
}

.modal-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.modal-stat svg {
    width: 20px;
    height: 20px;
}

.modal-btn-voir-projet {
    background-color: var(--color-btn);
    color: white;
    padding: 12px 24px;
    font-weight: 500;
    font-size: 16px;
    border-radius: 360px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    display: inline-block;
    transition: all 0.3s;
    margin: 0 auto;
    max-width: 200px;
}

.modal-btn-voir-projet:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Styles pour les flèches du carousel dans la modal */
.modal-carousel .slick-prev,
.modal-carousel .slick-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
}

.modal-carousel .slick-prev {
    left: -25px;
}

.modal-carousel .slick-next {
    right: -25px;
}

.modal-carousel .slick-prev::before,
.modal-carousel .slick-next::before {
    content: "" !important;
    display: none;
}

.modal-carousel .slick-prev::after,
.modal-carousel .slick-next::after {
    content: "" !important;
    display: block;
    width: 20px;
    height: 20px;
    border-top: 5px solid #334960;
    border-left: 5px solid #334960;
}

.modal-carousel .slick-prev::after {
    transform: rotate(-45deg);
    margin-left: 3px;
}

.modal-carousel .slick-next::after {
    transform: rotate(135deg);
    margin-right: 3px;
}

/* Responsive pour la modal */
@media only screen and (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        padding: 15px;
        gap: 15px;
        overflow-y: auto;
    }
    .modal-close {
      right: 0%;
  }
    .modal-image-container {
        height: 250px;
    }

    .modal-stats {
        gap: 20px;
    }

    .modal-stat {
        font-size: 14px;
    }

    .modal-carousel-image {
        height: 100px;
    }

    .modal-carousel .slick-prev,
    .modal-carousel .slick-next {
        width: 25px;
        height: 25px;
    }


}

@media only screen and (max-width: 480px) {
    .modal-content {
        padding: 10px;
        gap: 12px;
        overflow-y: auto;
    }



    .modal-image-container {
        height: 200px;
    }

    .modal-stats {
        gap: 15px;
    }

    .modal-stat {
        font-size: 13px;
    }

    .modal-carousel-image {
        height: 80px;
    }

    .modal-btn-voir-projet {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Masquer la scrollbar dans la modale responsive */
@media only screen and (max-width: 1280px) {
  .modal-content {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
  }
  .modal-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }
}
