/*******************************************
    GLOBAL
*******************************************/
:root {
    --bg-color: linear-gradient(135deg, #e0ecf8, #ffffff);
    --bg-nav-color: white;
    --nav-text-color: black;
    --text-color: #343a40;
    --h-color: #495057;
    --networks-text-color: white;
}

[data-theme="dark"] {
    --bg-color: #1e1e1e;
    --bg-nav-color: black;
    --nav-text-color: white;
    --text-color: #f0f0f0;
    --h-color: #f0f0f0;
    --networks-text-color: white;
}

html, body {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-color);
    min-height: 100vh;
    color: var(--text-color);
    padding: 50px 20px 0 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

.text-justify {
    text-align: justify;
}

h1 {
    text-align: center;
    font-size: 1.5rem;
    color: var(--h-color);
}

h2 {
    font-size: 1rem;
    color: var(--h-color);
}

.container {
    padding-top: 70px; /* Ajustez pour la hauteur de la navbar */
    margin-top: -50px; /* Compense la hauteur de la navbar */
}

/*******************************************
    MENU
*******************************************/
nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1020;
    width: 100%;
    list-style: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: var(--bg-nav-color);
}

.menu_container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 30px;
}

.menu_container div:first-of-type {
    display: flex;
    align-items: center;
}

.menu_container div:first-of-type a {
    font-size: 1.3rem;
}

.theme-toggle {
    margin-left: 30px;
    color: var(--nav-text-color);
    cursor: pointer;
}

.menu_container div {
    width: 100%;
}

.nav-links {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease;
}

.nav-links.active {
    display: block;
    max-height: 500px;
}

.nav-links ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    list-style: none;
    gap: 15px;
    padding: 0;
}

.nav-item a {
    letter-spacing: 0.1rem;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
    color: var(--nav-text-color);
    font-size: 1.1rem;
}

.nav-item a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    /*background: linear-gradient(to right, #2c3e50, #34495e);*/
    background: var(--h-color);
    left: 0;
    bottom: -5px;
    transition: width 0.3s ease;
}

div a:hover::after, li a:hover::after {
    width: 100%; /* Soulignement plein sur le hover //////////////// */
}

.burger {
    display: block;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    /*position: fixed;*/
    /*right: 200px;*/
    color: var(--nav-text-color);
}

/*******************************************
    HOME
*******************************************/
#home section {
    text-align: center;
}

/*******************************************
    TYPED TEXT ANIMATION
*******************************************/
.typewriter p {
    display: inline-block;
    position: relative;
    margin-top: 10px;
    font-size: 1.4rem;
    font-family: 'Courier New', Courier, monospace;
    border-right: 2px solid var(--nav-text-color); /* Le curseur de la machine à écrire */
    padding-right: 5px;
    overflow: hidden;
    min-height: 1.2em;
}

/*******************************************
    ABOUT
*******************************************/
#about section:first-of-type {
    text-align: justify;
}

#logo_container {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
}

#slider_track {
    display: flex;
    width: max-content;
    gap: 20px;
    animation: slide 60s linear infinite;
    text-align: center;
    font-size: 1rem;
    margin: 15px;
}

#slider_track div img {
    height: 70px;
    margin: 10px;
}

#slider_track div p {
    margin: 0;
}

@keyframes slide {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/*******************************************
    CARDS
*******************************************/
.projects-grid {
    display: grid;
    gap: 1.3rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.custom-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /*background-color: #fff;*/
    background-color: var(--bg-nav-color);
    transition: transform 0.2s ease;
}

.custom-card:hover {
    transform: translateY(-10px);
}

.card-img {
    width: 100%;
    height: 270px;
    display: block;
}

.card-body {
    margin: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: justify;
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--h-color);
}

.card-tech {
    font-size: 0.95rem;
    color: var(--h-color);
    margin: 10px 0 0 0;
}

.card-text {
    font-size: 0.95rem;
    color: var(--text-color);
    flex-grow: 1;
    margin: 15px 0 0 0;
}

.card-btn {
    width: 90%;
    text-align: center;
    /*background-color: #17a2b8;*/
    background: linear-gradient(135deg, #17a2b8, #0d6efd);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s ease, filter 0.3s ease;
    margin-top: 1rem;
}

.card-btn:hover {
    /*background-color: #138496;*/
    filter: brightness(1.2);
}

/*******************************************
    CONTACT FORM
*******************************************/
.center-form {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    padding: 0 20px 0 20px;
}

.contact-form {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    max-width: 650px;
    width: 100%;
    padding: 20px;
    border-radius: 30px;
    text-align: center;
    background-color: var(--bg-nav-color);
}

.contact-form label {
    font-weight: bold;
    display: block;
    margin: 10px 0 6px 4px;
    text-align: start;
}

.contact-form input, .contact-form textarea {
    all: unset;
    box-sizing: border-box;
    width: 100%;
    padding: 8px 20px;
    border: 1px solid #ccc;
    border-radius: 20px;
    text-align: start;
}

.contact-form textarea {
    min-height: 130px;
    resize: vertical;
}

.contact-form button {
    border: none;
    cursor: pointer;
    font-size: 15px;
    width: 150px;
    text-align: center;
    /*background-color: #17a2b8;*/
    background: linear-gradient(135deg, #17a2b8, #0d6efd);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s ease, filter 0.3s ease;
    margin-top: 1rem;
}

.contact-form button:hover {
    /*background-color: #138496;*/
    filter: brightness(1.2);
}

/*******************************************
    CONTACT FORM POPUP
*******************************************/
#popup {
    z-index: 1100;
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    animation: fadeInBackground 0.3s ease forwards;
}

#popup.show {
    display: flex;
}

#popup > div {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-20px);
    opacity: 0;
    animation: slideDownFadeIn 0.35s ease forwards;
}

#popup.show > div {
    animation: slideDownFadeIn 0.35s ease forwards;
}

#popup p {
    color: #343a40;
}

#closePopup {
    background: linear-gradient(135deg, #17a2b8, #0d6efd);
    border: none;
    color: white;
    padding: 10px 22px;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, filter 0.5s ease;
    font-weight: 600;
}

#closePopup:hover {
    /*background-color: #138496;*/
    filter: brightness(1.2);
}

@keyframes fadeInBackground {
    from { background: rgba(0,0,0,0); }
    to { background: rgba(0,0,0,0.5); }
}

@keyframes slideDownFadeIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/*******************************************
    CONTACT FORM POPUP SVG ANIMATION
*******************************************/
.checkmark-container {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.checkmark {
    width: 60px;
    height: 60px;
    stroke: #28a745;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    animation: pop 0.3s ease-out forwards;
}

.checkmark-circle {
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    animation: draw 0.6s ease-out forwards;
}

.checkmark-check {
    stroke-dasharray: 36;
    stroke-dashoffset: 36;
    animation: draw-check 0.4s ease-out 0.6s forwards;
}

/* Cercles + V s'animent */
@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes draw-check {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/*******************************************
    NETWORKS
*******************************************/
.networks_container {
    display: flex;
    justify-content: flex-end;
    /*margin-top: 40px;*/
    /*margin-bottom: 20px;*/
    margin: 40px 10px 40px 10px;
}

.networks {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: linear-gradient(135deg, #17a2b8, #0d6efd);
    padding: 10px 0 10px 0;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.networks span {
    display: flex;
    align-items: center;
}

.networks a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--networks-text-color);
    padding: 3px 12px;
    border-radius: 28px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.networks a:hover {
    /*background-color: rgba(23, 162, 184, 0.3);*/
    background-color: rgba(255, 255, 255, 0.2);
    transition: color 0.3s ease, filter 0.3s ease;
}

.networks img {
    margin-right: 10px;
    height: 50px;
    width: 50px;
}

.networks img:first-child {
    /*height: 50px;*/
    /*width: 50px;*/
}

.networks img.email-copy {
    height: 30px;
    width: 30px;
    /*margin-left: 10px;*/
    cursor: pointer;
    padding: 8px;
    border-radius: 50px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.networks img.email-copy:hover {
    /*background-color: rgba(23, 162, 184, 0.3);*/
    background-color: rgba(255, 255, 255, 0.2);
    transition: color 0.3s ease, filter 0.3s ease;
}

.email-copy.copied {
    filter: invert(33%) sepia(94%) saturate(698%) hue-rotate(73deg) brightness(87%) contrast(89%);
}

/*******************************************
    Responsive
*******************************************/
@media (min-width: 768px) {
    body {
        font-size: 1rem;
    }

    h1 {
        font-size: 2rem
    }

    h2 {
        font-size: 1.3rem;
    }

    /*******************************************
        TYPED TEXT ANIMATION
    *******************************************/
    .typewriter p {
        font-size: 2rem;
    }

    /*******************************************
        MENU
    *******************************************/
    .menu_container {
        flex-direction: row;
        margin: 0 100px 0 100px;
    }

    .menu_container div:first-of-type {
        justify-content: flex-start;
    }

    .nav-links {
        display: block;
        overflow: visible;
        max-height: none;
    }

    .nav-links ul {
        flex-direction: row;
        gap: 20px;
        justify-content: flex-end;
    }

    .burger {
        display: none;
    }
}

@media (min-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }

    /*******************************************
        CONTACT FORM
    *******************************************/
    .center-form {
        flex-direction: row;
    }

    .networks_container {
        margin-left: 40px;
    }

    .networks {
        padding: 20px 25px;
    }
}

@media (min-width: 1100px) {
    body {
        margin: 0 200px 280px 200px;
    }

    .menu_container {
        margin: 0 200px 0 200px;
    }

    #slider_track {
        font-size: 1.3rem;
        margin: 20px;
    }

    #slider_track div img {
        height: 115px;
        margin: 15px;
    }

    .networks img:first-child {
        height: 60px;
    }
}

@media (min-width: 1300px) {
    body {
        margin: 0 250px 280px 250px;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    }
}

@media (min-width: 1400px) {
    body {
        margin: 0 300px 280px 300px;
    }
}

@media (min-width: 1550px) {
    .networks_container {
        margin: 0;
    }
}