/*affichage des videos*/
.modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    padding: 1.5rem 1rem 1rem 1rem;
    border-radius: 12px;
    position: relative;
    min-width: 320px;
    max-width: 96vw;
    box-shadow: 0 8px 40px #0006;
    animation: popup 0.25s cubic-bezier(.68, -0.55, .27, 1.55);
}

@keyframes popup {
    0% {
        transform: scale(0.7);
    }

    100% {
        transform: scale(1);
    }
}

.close-modal {
    position: absolute;
    top: 8px;
    right: 16px;
    font-size: 2rem;
    color: #333;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #f00;
}

#modal-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
}


/*styles de la section projet*/
.projects {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto 2rem auto;
    /* padding: 10px 10%; */
    background: transparent;
    display: flex;
    flex-direction: column;
}

.projects-title {
    font-size: 2rem;
    margin: 1em 0;
    font-weight: 500;
    color: var(--text-color2);
    text-transform: uppercase;
    text-align: center;
}

.projects-slide {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 40px 10px;
    margin-top: 10px;
    gap: 30px;
    border-radius: var(--radius);
    border: 2px solid black;
    background: var(--bg-color3);
}

.projects-card {
    width: 350px;
    display: flex;
    flex-direction: column;
    background-color: rgb(255, 255, 255);
    border: 2px solid var(--bg-color3);
    box-shadow: 8px 8px 0px var(--accent-red);
    border-radius: var(--radius);
    transition: all 0.3s ease-in-out;
    box-sizing: border-box;
    padding: 20px;
    gap: 16px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.projects-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 12px 12px 0px var(--accent-red);
    border-color: var(--accent-red);
}

/* Image section */
.projects-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border: 2px solid var(--accent-red);
    /* box-shadow: 4px 4px 0px rgb(255, 0, 0); */
    transition: all 0.3s ease-in-out;
}

.projects-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease-in-out;
}

.projects-img:hover img {
    transform: scale(1.05);
}

/* Description section */
.projects-description {
    display: flex;
    flex-direction: row;
    gap: 16px;
    margin-top: 1em;
    width: 100%;
}

.projects-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-color: var(--bg-color4);
    color: rgb(255, 255, 255);
    /* padding-top: 3px; */
    width: 25%;
    flex-shrink: 0;
    /* border: 2px solid var(--accent-red); */
    transition: all 0.3s ease-in-out;
}

.projects-stack p {
    font-size: 0.65rem;
    font-style: italic;
    font-weight: 600;
    font-family: var(--fontMono);
    padding: 4px 2px;
    text-align: center;
    text-transform: uppercase;
    transition: 0.3s ease-in-out;
    /* margin: 2px 0; */
    border-bottom: 1px solid rgb(255, 255, 255);
    width: 100%;
}

.projects-stack p:last-child {
    border-bottom: none;
}

.projects-stack p:hover {
    color: var(--accent-red);
}

.projects-text {
    flex: 1;
    width: 75%;
}

.projects-text p {
    font-family: var(--fontTerminal);
    color: var(--text-color2);
    font-size: 0.95rem;
    text-align: justify;
    margin: 0;
    line-height: 1.5;
    font-weight: 400;
}

/* Links section */
.projects-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 0 auto;
    flex-shrink: 0;
    order: -1;
}

.projects-links button {
    border: 2px solid var(--bg-color3);
    background-color: rgb(255, 255, 255);
    box-shadow: 4px 4px 0px var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.projects-links button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--accent-red);
}

.projects-links button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--bg-color3);
    transition: left 0.3s ease-in-out;
    z-index: 1;
}

.projects-links button:hover::before {
    left: 0;
}

.projects-links button a {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.projects-links button i {
    color: var(--text-color2);
    font-size: 1.2rem;
    transition: color 0.3s ease-in-out;
}

.projects-links button:hover i {
    color: rgb(255, 255, 255);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 30px 0 20px 0;
}

.pagination-cube {
    width: 12px;
    height: 12px;
    background-color: rgb(255, 255, 255);
    border: 2px solid var(--bg-color3);
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 2px 2px 0px var(--accent-red);
}

.pagination-cube:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px var(--accent-red);
}

.pagination-cube.active {
    background-color: var(--accent-red);
    box-shadow: 2px 2px 0px var(--bg-color3);
}

.pagination-cube.active:hover {
    box-shadow: 3px 3px 0px var(--bg-color3);
}

/* "Voir tout" button */
.bouton-all-projects {
    text-align: center;
    padding: 16px 24px;
    color: var(--text-color2);
    background: rgb(255, 255, 255);
    border: 2px solid var(--bg-color3);
    box-shadow: 6px 6px 0px var(--accent-red);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease-in-out;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.bouton-all-projects::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--bg-color3);
    z-index: 1;
    transition: left 0.4s ease-in-out;
}

.bouton-all-projects:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0px var(--accent-red);
}

.bouton-all-projects:hover::before {
    left: 0;
}

.bouton-all-projects p {
    position: relative;
    z-index: 2;
    margin: 0;
    transition: color 0.3s ease-in-out;
}

.bouton-all-projects i {
    position: relative;
    z-index: 2;
    transition: color 0.3s ease-in-out;
}

.bouton-all-projects:hover p,
.bouton-all-projects:hover i {
    color: rgb(255, 255, 255);
}

/* Scrollbar styling */
.projects-slide {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-red) rgb(224, 224, 224);
}

.projects-slide::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.projects-slide::-webkit-scrollbar-track {
    background: rgb(224, 224, 224);
}

.projects-slide::-webkit-scrollbar-thumb {
    background-color: var(--accent-red);
    border: 1px solid var(--border-color2);
}

.projects-slide::-webkit-scrollbar-thumb:hover {
    background: rgb(200, 0, 0);
}


/* Responsive */
@media (max-width: 700px) {

  .projects-title {
    font-size: 1.12rem;
    margin: 0.6em 0 0.2em 0;
    letter-spacing: 0.05em;
    text-align: left;
    font-weight: bold;
    padding-left: 2vw;
  }

  .projects-slide {
    display: block;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    overflow: visible;
    scrollbar-width: none;
  }

  .projects-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    box-shadow: none;
    border: none;
    background: transparent;
    margin: 0 0 18px 0;
    padding: 10px 0;
    min-height: unset;
    position: relative;
    overflow: visible;
    border-bottom: 1px solid #eee;
    border-radius: 0 !important;
  }

  .projects-img {
    width: 56px;
    min-width: 56px;
    height: 56px;
    border: none;
    border-radius: 0 !important;
    margin: 0 10px 0 0;
    box-shadow: none;
    background: #f7f7f7;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .projects-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    background: #fff;
    display: block;
  }

  .projects-description {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin: 0;
  }

  .projects-stack {
    display: block;
    background: none;
    color: #888;
    padding: 0;
    width: auto;
    border: none;
    box-shadow: none;
    font-size: 0.65rem;
    font-family: var(--fontMono);
    margin-bottom: 2px;
  }
  .projects-stack p {
    display: inline;
    border: none;
    margin: 0 4px 0 0;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 600;
    color: #aaa;
    background: none;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }
  .projects-stack p:last-child { margin-right: 0; }

  .projects-text {
    width: 100%;
    font-size: 0.94rem;
    margin: 0 0 6px 0;
    color: #222;
    font-family: var(--font-family);
    line-height: 1.45;
    min-height: unset;
    max-height: 2.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    text-align: left;
  }
  .projects-text p {
    margin: 0;
    font-size: 0.94rem;
    color: #222;
    font-family: var(--font-family);
    line-height: 1.45;
    max-height: 2.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    text-align: left;
  }

  .projects-links {
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    margin: 0 0 0 auto;
    order: 3;
  }
  .projects-links button {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border: 1.5px solid #222;
    background: #fff;
    box-shadow: none;
    padding: 0;
    margin: 0 0 0 5px;
    border-radius: 0;
    transition: background .18s, color .18s, border .19s;
  }
  .projects-links button:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
  }
  .projects-links button i {
    font-size: 1.04em;
    color: #222;
    transition: color .16s;
  }
  .projects-links button:hover i {
    color: #fff;
  }

  .pagination { display: none !important; }

  .bouton-all-projects {
    box-shadow: none;
    border-radius: 0;
    font-size: 0.93rem;
    padding: 10px 0 12px 0;
    gap: 4px;
    margin: 12px auto 0 auto;
    width: 100%;
    background: #fff;
    border: 1.5px solid #222;
    color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background .18s, color .18s, border .19s;
  }
  .bouton-all-projects i {
    color: var(--accent-red);
  }
  .bouton-all-projects:hover,
  .bouton-all-projects:active {
    background: var(--accent-red);
    color: #fff;
    border-color: var(--accent-red);
  }
  .bouton-all-projects:hover i,
  .bouton-all-projects:active i {
    color: #fff;
  }
}