/* Extra Small devices (phones, 320px and up) */
@media (max-width: 480px) {
    /* Navigation */
    nav {
        width: 90vw;
        top: 20px;
        height: auto;
        min-height: 50px;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    nav.menu-open {
        background-color: var(--background-color) !important;
        backdrop-filter: none !important;
        height: auto;
    }
    
    .navList {
        padding: 8px 15px;
        gap: 0;
        position: relative;
        flex-direction: column;
    }
    
    .navList > li:first-child {
        font-size: 18px;
        margin-right: 0;
        margin-bottom: 0;
        align-self: flex-start;
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .burger-menu {
        display: flex !important;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    nav li {
        font-size: 14px;
    }
    
    .navLinks {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        border-radius: 0 0 30px 30px;
        flex-direction: column;
        gap: 30px;
        padding: 15px 0;
        margin: 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
        z-index: 999;
    }

    .navLinks.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        background: var(--background-color);
    }

    .navLinks li {
        text-align: center;
        font-size: 16px;
    }

    .navLinks.active > li:last-child {
        display: unset;
    }
    
    .navList > li:last-child {
        display: none;
    }

    nav.menu-open.gradientBorder::after {
        display: none !important;
    }

    /* Hero Section */
    .mainTexts h1 {
        font-size: 50px;
        letter-spacing: -3px;
        text-align: center;
    }
    
    .mainTexts h2 {
        font-size: 16px;
        text-align: center;
    }

    /* About Section */
    #about {
        flex-direction: column-reverse;
        height: auto;
        min-height: 70vh;
        padding: 20px;
        gap: 30px;
    }
    
    .aboutText {
        max-width: 100%;
        width: 100%;
        height: auto;
        min-height: 300px;
        padding: 30px 20px;
    }
    
    .aboutImgWrapper {
        width: 75%;
        height: 75%;
        border-radius: 100%;
    }
    
    .aboutImgWrapper::after {
        border-radius: 100%;
    }
    
    .aboutImg {
        height: 100%;
        width: 99%;
        border-radius: 100%;
    }

    /* Skills Section */
    #skills {
        height: auto;
        min-height: 40vh;
        padding: 20px;
    }
    
    .sectionTitle {
        font-size: 24px;
        text-align: center;
    }
    
    .infiniteCarousel {
        max-width: 90%;
    }
    
    .carouselContainer {
        gap: 32px;
    }
    
    .carouselLabel {
        font-size: 16px;
    }

    /* Projects Section */
    #projects {
        height: auto;
        min-height: 100vh;
        padding: 20px;
        margin-bottom: 10vh;
    }
    
    .projectsCtn {
        flex-direction: column;
        gap: 30px;
        align-items: center;
    }
    
    .projectCard {
        width: 100%;
        max-width: 350px;
        height: auto;
        padding-bottom: 15px;
    }
    
    .projectImg {
        height: 180px;
    }

    /* Contact Section */
    #contact {
        flex-direction: column;
        height: auto;
        min-height: 30vh;
        gap: 30px;
        padding: 20px;
    }

    .contact-link {
        display: none;
    }
    
    .contact-mail {
        font-size: 24px;
        text-align: center;
        word-break: break-all;
    }
    
    .contact-main h3 {
        text-align: center;
    }
    
    .contact-main p {
        text-align: center;
        font-size: 14px;
    }

    /* Background adjustments */
    #headerBlobCtn {
        transform: translate(-30%, -50%);
    }
    
    #aboutBlobCtn {
        height: 40vh;
    }
    
    #aboutBlob {
        width: 90vw;
    }

    #projects {
        margin-bottom: 10vh;
    }

    #contact {
        min-height: 20vh;
    }

    .contact-link {
        display: none;
    }
}

/* Small devices (landscape phones, 481px and up) */
@media (min-width: 481px) and (max-width: 768px) {
    /* Navigation */
    nav {
        width: 80vw;
        top: 30px;
        height: auto;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    nav.menu-open {
        background-color: var(--background-color) !important;
        backdrop-filter: none !important;
    }

    nav.menu-open .navList {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        position: relative;
    }

    nav.menu-open.gradientBorder::after {
        display: none !important;
    }
    
    .navList {
        gap: 0;
        flex-direction: column;
        position: relative;
        padding: 15px 20px;
    }
    
    .navList > li:first-child {
        font-size: 20px;
        margin-right: 0;
        margin-bottom: 0;
        align-self: flex-start;
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    .burger-menu {
        display: flex !important;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    .navLinks {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        border-radius: 0 0 30px 30px;
        flex-direction: column;
        gap: 20px;
        padding: 20px 0;
        margin: 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
        z-index: 999;
    }

    .navLinks.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        background: var(--background-color);
    }

    .navLinks li {
        text-align: center;
        font-size: 18px;
    }

    .navLinks li:last-child {
        display: unset;
    }

    .navList > li:last-child {
        display: none;
    }

    nav.menu-open {
        height: auto;
    }

    /* Hero Section */
    .mainTexts h1 {
        font-size: 70px;
        letter-spacing: -4px;
    }
    
    .mainTexts h2 {
        font-size: 20px;
    }

    /* About Section */
    #about {
        flex-direction: column-reverse;
        height: auto;
        min-height: 80vh;
        gap: 40px;
    }
    
    .aboutText {
        max-width: 90%;
        height: auto;
        min-height: 350px;
        padding: 40px 30px;
    }
    
    .aboutImgWrapper {
        width: 50%;
        height: 50%;
        border-radius: 100%;
    }
    
    .aboutImgWrapper::after {
        border-radius: 100%;
    }
    
    .aboutImg {
        height: 100%;
        width: 99%;
        border-radius: 100%;
    }

    /* Skills Section */
    .sectionTitle {
        font-size: 28px;
    }

    .infiniteCarousel {
        max-width: 90%;
    }

    /* Projects Section */
    #projects {
        height: auto;
        min-height: 120vh;
        margin-bottom: 10vh;
    }
    
    .projectsCtn {
        flex-direction: column;
        gap: 40px;
        align-items: center;
    }
    
    .projectCard {
        width: 90%;
        max-width: 400px;
    }

    /* Contact Section */
    #contact {
        flex-direction: column;
        height: auto;
        min-height: 25vh;
        gap: 40px;
    }

    .contact-link {
        display: none;
    }
    
    .contact-mail {
        font-size: 32px;
    }

    /* Modals */
    dialog[open] {
        width: 85vw;
        max-width: 500px;
    }
}

/* Medium devices (tablets, 769px and up) */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Navigation */
    nav {
        width: 80vw;
    }

    /* Hero Section */
    .mainTexts h1 {
        font-size: 85px;
        letter-spacing: -5px;
    }

    /* About Section */
    #about {
        gap: 40px;
    }
    
    .aboutText {
        max-width: 50vw;
        padding: 40px;
    }

    .aboutImgWrapper {
        max-width: 40vw;
    }

    /* Projects Section */
    #projects {
        height: auto;
        min-height: 120vh;
        padding: 20px;
        margin-bottom: 10vh;
    }
    
    .projectsCtn {
        flex-wrap: wrap;
       justify-content: center;
        align-items: center;
        gap: 30px;
    }
    
    .projectCard {
        width: 90%;
        max-width: 450px;
    }

    /* Contact Section */
    .contact-mail {
        font-size: 36px;
    }

    /* Modals */
    dialog[open] {
        width: 70vw;
        max-width: 600px;
    }
}

/* Large devices (desktops, 1025px and up) */
@media (min-width: 1025px) and (max-width: 1440px) {
   /* Navigation */
   nav {
       width: 60vw;
   }
   
   /* Projects Section */

   #projects {
       margin-bottom: 10vh;
   }

   .projectsCtn {
       flex-wrap: wrap;
       justify-content: center;
       gap: 30px;
       max-width: 1200px;
   }
   
   .projectCard {
       width: 400px;
       flex: 0 0 auto;
   }
   
   .projectCard:nth-child(3) {
       flex-basis: 100%;
       max-width: 400px;
       margin: 0 auto;
   }
}

/* Extra Large devices (large desktops, 1441px and up) */
@media (min-width: 1441px) {
    /* Navigation */
    nav {
        width: 50vw;
        max-width: 800px;
    }
    
    /* Sections */
    #about {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    #projects {
        max-width: 1600px;
        margin: 0 auto;
    }
    
    .projectsCtn {
        max-width: 1400px;
    }
    
    #contact {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Height-specific adjustments for very short screens */
@media (max-height: 600px) and (min-width: 769px) {
    #hero {
        height: 100vh;
    }
    
    .mainTexts h1 {
        font-size: 60px;
    }
    
    .mainTexts h2 {
        font-size: 18px;
    }
    
    #about {
        height: auto;
        min-height: 60vh;
    }
    
    .aboutText {
        height: auto;
        min-height: 250px;
        padding: 30px;
    }

    .contact-instagram {
        display: none;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    nav {
        height: auto;
        min-height: 50px;
    }
    
    .navList {
        flex-direction: column;
        gap: 0;
        position: relative;
    }
    
    .navList > li:first-child {
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        margin-right: 0;
    }

    .burger-menu {
        display: flex !important;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
    }


    .navLinks {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(6, 6, 18, 0.95);
        border-radius: 0 0 30px 30px;
        flex-direction: column;
        gap: 15px;
        padding: 15px 0;
        margin: 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
        z-index: 999;
    }

    .navLinks.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .navLinks li {
        text-align: center;
        font-size: 16px;
    }

    .navList > li:last-child {
        display: none;
    }

    nav.menu-open .navList {
        min-height: 180px;
    }
    
    .mainTexts h1 {
        font-size: 50px;
    }
    
    .mainTexts h2 {
        font-size: 16px;
    }
    
    #about {
        flex-direction: row;
        height: auto;
        min-height: 60vh;
        gap: 30px;
    }
    
    .aboutText {
        max-width: 50%;
        height: auto;
        min-height: 300px;
        padding: 30px 20px;
    }
    
    .aboutImgWrapper {
        width: 250px;
        height: 250px;
    }
    
    .aboutImg {
        width: 248px;
        height: 248px;
    }
    
    .projectsCtn {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .projectCard {
        width: 300px;
        height: 350px;
    }
    
    .projectImg {
        height: 150px;
    }

    .contact-instagram {
        display: none;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .infiniteCarousel[data-animated="true"] .carouselContainer {
        animation: none;
    }

    .burger-line {
        transition: none !important;
    }
}

/* Print styles */
@media print {
    .background,
    nav,
    .loader {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    section {
        page-break-inside: avoid;
    }
    
    #hero {
        height: auto;
    }
}

/* Burger Menu Styles */
.burger-menu {
    display: none; /* Reste caché par défaut */
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
    width: 24px;
    height: 24px;
    position: absolute; /* Ajout pour le positionner correctement */
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.burger-menu span {
    display: block;
    position: absolute;
    height: 2px;
    width: 18px;
    background: #d1def5;
    border-radius: 1px;
    opacity: 1;
    left: 50%;
    transform: translateX(-50%);
    transition: .25s ease-in-out;
}

.burger-menu span {
    top: 11px;
}

.burger-menu span:before,
.burger-menu span:after {
    content: '';
    position: absolute;
    height: 2px;
    width: 18px;
    background: #d1def5;
    border-radius: 1px;
    transition: .25s ease-in-out;
}

.burger-menu span:before {
    top: -6px;
}

.burger-menu span:after {
    top: 6px;
}

.burger-menu.active span {
    transform: translateX(-50%) rotate(45deg);
}

.burger-menu.active span:before {
    top: 0;
    transform: rotate(90deg);
}

.burger-menu.active span:after {
    top: 0;
    transform: rotate(90deg);
}