* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: 'PingFang MO', sans-serif;
    max-width: 100%;
}

/* Prevent horizontal scrolling */
html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

:root {
    --background-image: linear-gradient(to right, rgba(24, 24, 24), rgba(0, 0, 0));
    --text-color: white;
    --main-color: #00ff41;            /* Vert matrix */
    --secondary-color: rgb(220, 220, 220);
    --tertiary-color: #00d4ff;        /* Bleu néon */
    --other-color: #1bd64a;           /* Rose électrique */
    --header-bg: rgb(0, 0, 1);
    --section-bg: linear-gradient(to right, rgba(24, 24, 24), rgba(4, 4, 4));
    --card-bg: var(--main-color);
    --timeline-bg: var(--background-image);
    --input-bg: linear-gradient(to right, rgba(24, 24, 24), rgba(4, 4, 4));
    --footer-bg: linear-gradient(to right, rgba(20, 20, 20), rgba(4, 4, 4));
    --button-text-color: black;
}

/* Light theme variables */
:root.light-theme {
    --background-image: linear-gradient(to right, rgba(245, 245, 245), rgba(255, 255, 255));
    --text-color: #333333;
    --main-color: #007acc;            /* Bleu professionnel */
    --secondary-color: rgb(100, 100, 100);
    --tertiary-color: #0066cc;        /* Bleu clair */
    --other-color: #0099ff;           /* Bleu électrique */
    --header-bg: rgba(255, 255, 255, 0.95);
    --section-bg: linear-gradient(to right, rgba(250, 250, 250), rgba(240, 240, 240));
    --card-bg: var(--main-color);
    --timeline-bg: var(--background-image);
    --input-bg: linear-gradient(to right, rgba(250, 250, 250), rgba(240, 240, 240));
    --footer-bg: linear-gradient(to right, rgba(230, 230, 230), rgba(240, 240, 240));
    --button-text-color: black;
}

html{
    font-size: 60%;
    overflow-x: hidden;
}

body{
    background: var(--background-image);
    color: var(--text-color);
}

.header{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 3rem 12% 3rem;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
    transition: background 0.3s ease;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
}

#language-toggle {
    font-size: 2.5rem;
    color: var(--main-color);
    cursor: pointer;
    transition: 0.3s ease;
    border: 2px solid transparent;
    border-radius: 50%;
    padding: 0.5rem;
    background: transparent;
}

#language-toggle:hover {
    color: var(--other-color);
    border-color: var(--main-color);
    transform: scale(1.1);
    background: rgba(0, 255, 65, 0.1);
}

#theme-toggle {
    font-size: 2.5rem;
    color: var(--main-color);
    cursor: pointer;
    transition: 0.3s ease;
    border: 2px solid transparent;
    border-radius: 50%;
    padding: 0.5rem;
    background: transparent;
}

#theme-toggle:hover {
    color: var(--other-color);
    border-color: var(--main-color);
    transform: scale(1.1);
    background: rgba(0, 255, 65, 0.1);
}

/* Light theme hover effect for theme toggle */
:root.light-theme #theme-toggle:hover {
    background: rgba(0, 122, 204, 0.1);
}

/* Light theme hover effect for language toggle */
:root.light-theme #language-toggle:hover {
    background: rgba(0, 122, 204, 0.1);
}

/* Light theme adjustments */
:root.light-theme .portfolio {
    background: var(--background-image);
}

:root.light-theme .portfolio h2 {
    color: var(--text-color);
}

:root.light-theme .contact h2 {
    color: var(--text-color);
}

:root.light-theme .timeline-content:hover {
    color: white;
}

/* Light theme portfolio adjustments */
:root.light-theme .project-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

:root.light-theme .project-card:hover {
    box-shadow: 0 20px 50px rgba(0, 122, 204, 0.15);
    border-color: var(--main-color);
}

:root.light-theme .project-overlay {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(0.4px);
}

:root.light-theme .project-card:hover .project-overlay {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
}

:root.light-theme .project-meta h3 {
    color: var(--text-color);
    text-shadow: 2px 2px 8px rgba(255, 255, 255, 0.3);
}

:root.light-theme .project-content p {
    color: var(--secondary-color);
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

:root.light-theme .project-meta .role {
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

:root.light-theme .project-meta .role span {
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.9);
}

:root.light-theme .tag {
    background: rgba(0, 122, 204, 0.1);
    color: var(--main-color);
    border-color: rgba(0, 122, 204, 0.3);
}

:root.light-theme .tag:hover {
    background: var(--main-color);
    color: white;
}

:root.light-theme .project-link {
    background: var(--main-color);
    color: white;
    border-color: var(--main-color);
    box-shadow: 0 5px 15px rgba(0, 122, 204, 0.3);
}

:root.light-theme .project-link:hover {
    background: transparent;
    color: var(--main-color);
    box-shadow: 0 8px 25px rgba(0, 122, 204, 0.4);
}

:root.light-theme .timeline-line {
    background: linear-gradient(180deg, var(--main-color), var(--tertiary-color));
    box-shadow: 0 0 10px rgba(0, 122, 204, 0.3);
}

:root.light-theme .project-card::before {
    background: var(--main-color);
    box-shadow: 0 0 15px rgba(0, 122, 204, 0.5);
}

:root.light-theme .project-icon {
    background: linear-gradient(135deg, var(--main-color), var(--tertiary-color));
    color: white;
    box-shadow: 0 8px 25px rgba(0, 122, 204, 0.3);
}

:root.light-theme .project-card:hover .project-icon {
    box-shadow: 0 12px 35px rgba(0, 122, 204, 0.5);
}

/* Light theme button text adjustments */
:root.light-theme .btn {
    color: var(--button-text-color) !important;
}

:root.light-theme .btn:hover {
    color: var(--button-text-color) !important;
}

/* Old github-link light theme styles removed - now using .project-link */

/* Light theme skills bar background */
:root.light-theme .skill-left .skill-bar .bar {
    background-color: rgba(200, 200, 200, 0.3);
}

/* Light theme navbar adjustments */
:root.light-theme .navbar a {
    color: var(--text-color);
}

:root.light-theme .navbar a:hover,
:root.light-theme .navbar a.active {
    color: var(--main-color);
}

:root.light-theme .carousel-item.center .carousel-card {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7),
                0 0 50px rgba(0, 187, 255, 0.5);
}

/* CRITICAL NAVBAR HEIGHT FIX - NUCLEAR OPTION */
@media(max-width: 795px) {
    .navbar,
    nav.navbar,
    .navbar.active,
    body .navbar,
    html .navbar,
    header .navbar,
    .header .navbar {
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        max-height: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        z-index: 9999 !important;
        transform: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        outline: none !important;
        box-sizing: border-box !important;
    }
    
    /* Force active state - ABSOLUTE OVERRIDE */
    .navbar.active {
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        max-height: none !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Additional safety override */
    body.menu-open .navbar,
    html.menu-open .navbar {
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
    }
}

/* Light theme mobile menu */
@media(max-width: 795px) {
    :root.light-theme .navbar {
        background: rgba(255, 255, 255, 0.8) !important;
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
    }
    
    :root.light-theme .navbar a {
        color: var(--text-color) !important;
    }
    
    :root.light-theme .navbar a:hover {
        color: var(--main-color) !important;
        border-color: var(--main-color) !important;
        background: rgba(0, 122, 204, 0.1) !important;
    }
    
    :root.light-theme .navbar a.active {
        color: var(--main-color) !important;
        background: rgba(0, 122, 204, 0.2) !important;
        border-color: var(--main-color) !important;
    }
}

/* Light theme footer adjustments */
:root.light-theme .footer ul li a {
    color: var(--text-color);
}

:root.light-theme .footer .copyright {
    color: var(--text-color);
}

/* Light theme Professional Skills percentages */
:root.light-theme .box .text big span {
    color: var(--text-color);
}

:root.light-theme .box .text big sup {
    color: var(--text-color);
}

:root.light-theme .text-animation span::after{
    background-color:  rgb(250, 250, 250);  
    border-left: 3px solid rgb(240, 240, 240);
}

.logo{
    font-size: 3rem;
    color: var(--text-color);
    font-weight: 800;
    cursor: pointer;
    transition: .3s ease;
}

.logo:hover{
    transform: scale(1.1);
}

.logo span{
    text-shadow: 0 0 12px var(--main-color);
}

.navbar a{
    font-size: 1.8rem;
    color: var(--text-color);
    margin-left: 4rem;
    font-weight: normal;
    transition: .3s ease;
    border-bottom: 3px solid transparent;
}

.navbar a:hover,
.navbar a:active{
    color: var(--main-color);
    border-bottom: 3px solid var(--main-color);
}

#menu-icon{
    font-size: 3.6rem;
    color: var(--main-color);
    display: none;
    cursor: pointer;
    transition: 0.3s ease;
    z-index: 1001;
}

#menu-icon:hover {
    color: var(--other-color);
    transform: scale(1.1);
}

#menu-icon.bx-x {
    transform: rotate(180deg);
    color: var(--other-color);
}

section{
    min-height: 90vh;
    padding: 10rem 12% 10rem;
}

.home{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15rem;
}
.home-content{
    display: flex;
    flex-direction: column;
    align-items: baseline;
    text-align: left;
    justify-content: center;
    margin: 3rem;
}

span{
    color: var(--main-color);

}

.log span{
    color: var(--main-color);
    text-shadow: 0 0 30px var(--main-color);
}

.home-content h3{
    margin-bottom: 4rem;
    margin-top: 1rem;
    font-size: 2.5rem;
}

.home-content h1{
    font-size: 7rem;
    font-weight: bold;
    margin-top: 1.5rem;
    line-height: 1;
}

.home-img{
    border-radius: 50%;
}
.home-img img{
    position: relative;
    top: 2rem;
    width: 32vw;
    height: 24vw;
    border-radius: 50%;
    box-shadow: 0 0 25px var(--main-color);
    cursor: pointer;
    transition: 0.4s ease-in-out;
    max-width: 400px;
    max-height: 300px;
}

.home-img img:hover{
    box-shadow: 0 0 25px var(--main-color),
                0 0 25px var(--main-color),
                0 0 100px var(--main-color);
}

.home-content p{
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 2;
    max-width: 1000px;
}

.social-icons a{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4.5rem;
    height: 4.5rem;
    background: transparent;
    border: 2px solid var(--main-color);
    font-size: 2.5rem;
    border-radius: 50%;
    color: var(--main-color);
    margin: 3rem 1.8rem 3rem 0;
    transition: .3s ease-in-out;
}

.social-icons a:hover{
    color: black;
    transform: scale(1.3) translateY(-2rem);
    box-shadow: 0 0 25px var(--main-color);
    background: var(--other-color);
    border-color: var(--other-color);
}

.btn{
    display: inline-block;
    padding: 1rem 2.8rem;
    background: var(--main-color);
    box-shadow: 0 0 23px var(--main-color);
    border-radius: 4rem;
    font-size: 1.6rem;
    color: var(--button-text-color);
    border: 2px solid transparent;
    letter-spacing: 0.1rem;
    font-weight: 700;
    transition: .3s ease-in-out;
    cursor: pointer;
}

.btn span{
    color: var(--button-text-color);
}

.btn:hover{
    color: var(--button-text-color);
    transform: scale(1.05);
    box-shadow: 0 0 50px var(--main-color);
    background: var(--other-color);
}

.btn-group{
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-group a:nth-of-type(2){
    color: var(--button-text-color);
    background: var(--main-color);
    border: 2px solid var(--main-color);
    box-shadow: 0 0 23px var(--main-color);
}

.btn-group a:nth-of-type(2):hover{
    box-shadow: 0 0 50px var(--main-color);
    background: var(--other-color);
    border-color: var(--other-color);
    color: var(--button-text-color);
    transform: scale(1.05);
}

.text-animation {
    font-size: 34px;
    font-weight: 600;
    min-width: 280px;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.text-animation span{
    position: relative;
    /* display: block;
    margin-top: 0.5rem; */
}

.text-animation span::before{
    content: " Software Engineer";
    color: var(--main-color) ;

    animation:  words 20s infinite;
}

.text-animation span::after{
    content: " ";
    background-color:  rgba(17, 17, 17);
    position: absolute;
    width: calc(100% + 8px);
    height: 100%;
    border-left: 3px solid rgba(17, 17, 17);
    right: -8px;
    animation: cursor 0.6s infinite, typing 20s steps(14) infinite;
}

@keyframes words {
    0%,
    20%{
        content: " Software Architect";
    }
    21%,
    40%{
        content: " Software Engineer";
    }
    41%,
    60%{
        content: " Project Management";
    }
    61%,
    80%{
        content: " UX / UI Designer";
    }
    81%,
    100%{
        content: " Program Management";
    }
    101%,
    120%{
        content: " Project Management";
    }
    121%,
    140%{
        content: " Technical Lead";
    }
    141%,
    160%{
        content: " Program Management";
    }
}

@keyframes cursor {
    to{
        border-left: 2px solid var(--main-color);
    }
}
/* Curseur clignotant pour l'animation JavaScript */
#cursor {
    display: inline-block;
    color: var(--main-color);
    font-weight: bold;
    font-size: 1em;
    animation: blink 0.7s steps(1) infinite;
}


@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes typing {
    10%,
    15%,
    30%,
    35%,
    50%,
    55%,
    70%,
    75%,
    90%,
    95%{
        width: 0;
    }
    5%,
    20%,
    25%,
    40%,
    45%,
    60%,
    65%,
    80%,
    85%{
        width: calc(100% + 8px);
    }
}

/* Style pour le texte tapé */
#typed-text {
    color: var(--main-color);
}

.heading{
    font-size: 8rem;
    text-align: center;
    margin: 5rem 0;
}

.education{
    padding: 100px 15px;
    background-image: var(--section-bg);
    transition: background 0.3s ease;
}

.education h2{
    margin-bottom: 5rem;
}

.timeline-items{
    max-width: 1200px;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.timeline-items::before{
    content: "";
    position: absolute;
    width: 5px;
    height: 100%;
    background-color: var(--main-color);
    left: calc(50%);
}

.timeline-item{
    margin-bottom: 40px;
    width: 100%;
    position: relative;
}

.timeline-items:last-child{
    margin-bottom: 0;
}

.timeline-item:nth-child(odd){
    padding-right: calc( 50% + 30px);
    text-align: right;
}

.timeline-item:nth-child(even){
    padding-left: calc( 50% + 30px);
}

.timeline-dot{
    height: 21px;
    width: 21px;
    background-color: var(--main-color);
    box-shadow: 0 0 25px var(--main-color),
                0 0 50px var(--main-color);
    position: absolute;
    left: calc(50% - 8px);
    border-radius: 50%;
    top: 10px;
}

.timeline-date{
    font-size: 20px;
    font-weight: 800;
    color: var(--main-color);
    margin: 6px 0 15px;
}

.timeline-content{
    background-image: var(--timeline-bg);
    border: 3px solid var(--main-color);
    padding: 30px 50px;
    border-radius: 4rem;
    box-shadow: 0 0 10px var(--main-color);
    cursor: pointer;
    transition: 0.3s ease-in-out;
}

.timeline-content:hover{
    transform: scale(1.05);
    box-shadow: 0 0 25px var(--main-color);
    color: black;
    background: var(--other-color);
}

.timeline-content h3{
    font-size: 20px;
    margin: 0 0 10px;
    font-weight: 500;
}

.timeline-content p{
    font-size: 16px;
    font-weight: 300;
    line-height: 22px;
}

.portfolio{
    background-image: var(--section-bg);
    transition: background 0.3s ease;
    padding: 8rem 12% 5rem;
    position: relative;
}

.portfolio h2{
    margin-bottom: 6rem;
    color: var(--text-color);
    text-align: center;
}

/* 3D Carousel Container */
.carousel-3d-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 0 8rem;
    perspective: 2000px;
}

.carousel-3d {
    position: relative;
    width: 100%;
    height: 600px;
    transform-style: preserve-3d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-item {
    position: absolute;
    width: 600px;
    height: 500px;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-style: preserve-3d;
    cursor: pointer;
}

/* 7 Position States */
.carousel-item.center {
    z-index: 100;
    transform: translateX(0) translateZ(0) rotateY(0deg) scale(1.08);
    opacity: 1;
    filter: blur(0px) brightness(1.2);
}

.carousel-item.left {
    z-index: 50;
    transform: translateX(-400px) translateZ(-300px) rotateY(35deg) scale(0.85);
    opacity: 0.7;
    filter: blur(1px) brightness(0.8);
}

.carousel-item.right {
    z-index: 50;
    transform: translateX(400px) translateZ(-300px) rotateY(-35deg) scale(0.85);
    opacity: 0.7;
    filter: blur(1px) brightness(0.8);
}

.carousel-item.far-left {
    z-index: 25;
    transform: translateX(-650px) translateZ(-500px) rotateY(45deg) scale(0.6);
    opacity: 0.4;
    filter: blur(3px) brightness(0.6);
}

.carousel-item.far-right {
    z-index: 25;
    transform: translateX(650px) translateZ(-500px) rotateY(-45deg) scale(0.6);
    opacity: 0.4;
    filter: blur(3px) brightness(0.6);
}

.carousel-item.hidden-left {
    z-index: 10;
    transform: translateX(-850px) translateZ(-700px) rotateY(50deg) scale(0.4);
    opacity: 0;
    filter: blur(5px) brightness(0.4);
    pointer-events: none;
}

.carousel-item.hidden-right {
    z-index: 10;
    transform: translateX(850px) translateZ(-700px) rotateY(-50deg) scale(0.4);
    opacity: 0;
    filter: blur(5px) brightness(0.4);
    pointer-events: none;
}

/* Carousel Card */
.carousel-card {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(0, 255, 65, 0.2);
    border: 2px solid rgba(0, 255, 65, 0.3);
    transition: all 0.4s ease;
    transform-style: preserve-3d;
}

.carousel-item.center .carousel-card {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7),
                0 0 50px rgba(0, 255, 65, 0.5),
                inset 0 0 30px rgba(0, 255, 65, 0.1);
    border: 3px solid var(--main-color);
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(1px);
    transition: all 0.4s ease;
}

.carousel-item.center .carousel-overlay {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(2px);
}

/* Carousel Content */
.carousel-content {
    position: relative;
    z-index: 2;
    padding: 3rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s ease;
}

.carousel-item.center .carousel-content {
    opacity: 1;
    transform: translateY(0);
}

.carousel-icon {
    width: 7rem;
    height: 7rem;
    background: linear-gradient(135deg, var(--main-color), var(--tertiary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: black;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 255, 65, 0.4);
    transition: all 0.3s ease;
}

.carousel-item.center .carousel-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 40px rgba(0, 255, 65, 0.6);
}

.carousel-content h3 {
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.9);
}

.carousel-role {
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.carousel-role span {
    color: var(--main-color);
    font-weight: 700;
}

.carousel-description {
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.carousel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.carousel-tag {
    background: rgba(0, 255, 65, 0.15);
    color: var(--main-color);
    padding: 0.8rem 1.5rem;
    border-radius: 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    border: 1px solid rgba(0, 255, 65, 0.4);
    transition: all 0.3s ease;
}

.carousel-item.center .carousel-tag:hover {
    background: var(--main-color);
    color: black;
    transform: translateY(-3px);
}

.carousel-link {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: var(--main-color);
    color: black;
    padding: 1.2rem 2.5rem;
    border-radius: 3rem;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid var(--main-color);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.3);
    width: fit-content;
}

.carousel-link:hover {
    background: transparent;
    color: var(--main-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 255, 65, 0.5);
}

.carousel-link i {
    font-size: 1.8rem;
}

/* Navigation Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 4rem;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid var(--main-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background: rgba(0, 255, 65, 0.5);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--main-color);
    box-shadow: 0 0 15px var(--main-color);
    transform: scale(1.3);
}

/* Light Theme Adjustments */
:root.light-theme .carousel-overlay {
    background: rgba(255, 255, 255, 0.4);
}

:root.light-theme .carousel-item.center .carousel-overlay {
    background: rgba(255, 255, 255, 0.8);
}

:root.light-theme .carousel-tag {
    background: rgba(0, 122, 204, 0.1);
    border-color: rgba(0, 122, 204, 0.3);
}

:root.light-theme .carousel-item.center .carousel-tag:hover {
    background: var(--main-color);
    color: white;
}

:root.light-theme .carousel-dot {
    background: rgba(0, 0, 0, 0.2);
    border-color: var(--main-color);
}

:root.light-theme .carousel-dot.active {
    background: var(--main-color);
}

.portfolio-timeline{
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.timeline-line{
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--main-color), var(--tertiary-color));
    transform: translateX(-50%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.timeline-project{
    position: relative;
    margin-bottom: 6rem;
    width: calc(50% - 4rem);
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.timeline-project.left{
    left: 0;
    text-align: right;
    animation-delay: 0.2s;
}

.timeline-project.right{
    left: calc(50% + 4rem);
    text-align: left;
    animation-delay: 0.4s;
}

.timeline-project:nth-child(odd) { animation-delay: 0.3s; }
.timeline-project:nth-child(even) { animation-delay: 0.6s; }

.project-card{
    background: var(--section-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 2rem;
    padding: 3rem;
    position: relative;
    transition: all 0.4s ease;
    border: 2px solid transparent;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.project-overlay{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(0.4px);
    transition: all 0.4s ease;
    z-index: 1;
}

.project-card::before{
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background: var(--main-color);
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.timeline-project.left .project-card::before{
    right: -4.2rem;
}

.timeline-project.right .project-card::before{
    left: -4.2rem;
}

.project-card:hover{
    transform: translateY(-10px);
    border-color: var(--main-color);
    box-shadow: 0 20px 50px rgba(0, 255, 65, 0.15);
}

.project-card:hover .project-overlay{
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(2px);
}

.project-card:hover .project-content{
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover .project-meta .role{
    opacity: 1;
    transform: translateY(0);
}

.project-header{
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.timeline-project.right .project-header{
    flex-direction: row;
}

.timeline-project.left .project-header{
    flex-direction: row-reverse;
}

.project-icon{
    width: 6rem;
    height: 6rem;
    background: linear-gradient(135deg, var(--main-color), var(--tertiary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: black;
    box-shadow: 0 8px 25px rgba(0, 255, 65, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
}

.project-card:hover .project-icon{
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 12px 35px rgba(0, 255, 65, 0.5);
}

.project-meta h3{
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
    transition: all 0.4s ease;
}

.project-meta .role{
    font-size: 1.4rem;
    color: var(--secondary-color);
    font-weight: 500;
    transition: all 0.4s ease;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transform: translateY(10px);
}

.project-meta .role span{
    color: var(--main-color);
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.project-content{
    position: relative;
    z-index: 2;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
}

.project-content p{
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.project-tags{
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.timeline-project.left .project-tags{
    justify-content: flex-end;
}

.timeline-project.right .project-tags{
    justify-content: flex-start;
}

.tag{
    background: rgba(0, 255, 65, 0.1);
    color: var(--main-color);
    padding: 0.8rem 1.5rem;
    border-radius: 2rem;
    font-size: 1.3rem;
    font-weight: 600;
    border: 1px solid rgba(0, 255, 65, 0.3);
    transition: all 0.3s ease;
}

.tag:hover{
    background: var(--main-color);
    color: black;
    transform: translateY(-2px);
}

.project-link{
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: var(--main-color);
    color: black;
    padding: 1.2rem 2.5rem;
    border-radius: 3rem;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid var(--main-color);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.3);
}

.project-link:hover{
    background: transparent;
    color: var(--main-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 255, 65, 0.4);
}

.project-link i{
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

.project-link:hover i{
    transform: scale(1.2);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Old github-link styles removed - now using .project-link */

.competence{
    background-image: var(--section-bg);
    transition: background 0.3s ease;
}

.competence .main-text span{
    text-align: center;
    font-size: 3.5rem;
}
.skill-main{
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2,1fr);
    grid-row-gap: 30px;
    grid-column-gap: 50px;
}

.skill-bar{
    margin-bottom: 2.3rem;
}

.skill-main h3{
    font-size: 4.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.skill-left .skill-bar .info{
    font-size: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5rem 0 2rem;
    max-width: 100%;
    box-sizing: border-box;
}

.skill-left .skill-bar i{
    font-size: 2.5rem;
    color: var(--main-color);
    transition: 0.3s ease-in-out;
    box-shadow: 0 0 12px var(--main-color);
}

.skill-left .skill-bar i:hover{
    transform: scale(1.2);
    color: var(--other-color);
    box-shadow: 0 0 10px var(--other-color);
}

.skill-left .skill-bar .bar{
    width: 300px;
    height: 10px;
    background-color: rgb(4, 4, 4);
    border-radius: 25px;
    margin-top: 10px;
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
}

.skill-bar .bar span{
    width: 50%;
    height: 100%;
    position: absolute;
    left: 0;
    background: var(--main-color);
    border-radius: 25px;
    box-shadow: var(--main-color);
}

.skill-bar .bar span {
    animation-duration: 3.6s;
    animation-fill-mode: forwards;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    animation-delay: 0s; /* Start immediately */
}

/* Define a total animation cycle of 8.6s (3.6s animation + 5s delay) */
@keyframes c {
    0% { width: 0; }
    41.86% { width: 50%; } /* Animation finishes at 3.6s */
    100% { width: 50%; } /* Remains at 87% for the next 5s (delay) */
}

@keyframes c-sharp {
    0% { width: 0; }
    41.86% { width: 35%; }
    100% { width: 35%; }
}

@keyframes cpp {
    0% { width: 0; }
    41.86% { width: 40%; }
    100% { width: 40%; }
}

@keyframes unity {
    0% { width: 0; }
    41.86% { width: 57%; }
    100% { width: 57%; }
}

@keyframes figma {
    0% { width: 0; }
    41.86% { width: 65%; }
    100% { width: 65%; }
}

@keyframes dart {
    0% { width: 0; }
    41.86% { width: 60%; }
    100% { width: 60%; }
}

@keyframes python {
    0% { width: 0; }
    41.86% { width: 60%; }
    100% { width: 60%; }
}

/* Apply animation to all bars */
.skill-bar .bar .c {
    animation: c 8.6s ease-in-out infinite;
}

.skill-bar .bar .c-sharp {
    animation: c-sharp 8.6s ease-in-out infinite;
}

.skill-bar .bar .cpp {
    animation: cpp 8.6s ease-in-out infinite;
}

.skill-bar .bar .unity {
    animation: unity 8.6s ease-in-out infinite;
}

.skill-bar .bar .figma {
    animation: figma 8.6s ease-in-out infinite;
}

.skill-bar .bar .dart {
    animation: dart 8.6s ease-in-out infinite;
}

.skill-bar .bar .python {
    animation: python 8.6s ease-in-out infinite;
}


/* Pause for 5 seconds after animation completes */
@keyframes full-cycle {
    0% { opacity: 1; }
    41.86% { opacity: 1; } /* 3.6s out of 8.6s cycle */
    100% { opacity: 1; }
}

/* Total cycle: 3.6s animation + 5s delay (8.6s) */
.skill-bar .bar span {
    animation-duration: 8.6s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

.professional{
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.box{
    position: relative;
    margin: 10px 0 ;
    flex: 1 1 15rem;
}

.box .text{
    text-align: center;
    font-size: 1.4rem;
}

.box .text big{
    font-weight: 400;
    letter-spacing: 1px;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%,-50%);
}

.box .text small{
    margin-top: 5px;
    display: block;
    font-weight: 600;
}

.box .circle{
    width: 100%;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;

}

.box .text .block {
    position: absolute;
    width: 1px;
    height: 15px;
    top: 0;
    left: 50%;
    transform-origin: 70% 60px;
    opacity: 0;
    animation: glow 7s linear infinite;
}

@keyframes glow {
    0% {
        opacity: 0;
    }
    22.22% { /* 2s out of 9s */
        opacity: 1;
    }
    44.44% { /* 4s out of 9s */
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.box .text .block:nth-child(-n+104){
    background-color: var(--main-color);
    box-shadow: 0 0 15px var(--main-color), 0 0 30px var(--main-color);
}

.box .text big span{
    color: white;
    font-size: 2em;
    font-weight: 600;
}

.box .text big sup{
    color: white;
    font-size: 1em;
    font-weight: 600;
}

.contact{
    background-image: var(--section-bg);
    transition: background 0.3s ease;
}

.contact h2{
    margin-bottom: 3rem;
    color: white;
}

.contact form{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin: 5rem auto;
    text-align: center;
}

.contact form .input-box{
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.contact form .input-box input,
.contact form textarea{
    width: 100%;
    padding: 2.5rem;
    font-size: 1.8rem;
    color: var(--text-color);
    background-image: var(--input-bg);
    border-radius: 2rem;
    border: 2px solid var(--main-color);
    margin: 1.5rem 0;
    resize: none;
    transition: background 0.3s ease;
}

.btn{
    margin-top: 2rem;
}

.footer{
    position: relative;
    bottom: 0;
    width: 100%;
    padding: 40px 0;
    background-image: var(--footer-bg);
    transition: background 0.3s ease;
}

.footer .social{
    text-align: center;
    padding-bottom: 25px;
    color: var(--main-color);
}

.footer .social a{
    font-size: 25px;
    color: var(--main-color);
    border: 2px solid var(--main-color);
    width: 42px;
    height: 42px;
    line-height: 42px;
    display: inline-block;
    text-align: center;
    border-radius: 50%;
    margin: 0 10px;
    transition: 0.3s ease-in-out;
}

.footer .social a:hover{
    transform: scale(1.2)translateY(-10px);
    background-color: var(--other-color);
    color: black;
    border-color: var(--other-color);
    box-shadow: 0 0 25px var(--main-color);
}

.footer ul{
    margin-top: 0;
    padding: 0;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 0;
    text-align: center;
}

.footer ul li a{
    color: white;
    border-bottom: 3px solid transparent;
    transition: 0.3s ease-in-out;
}

.footer ul li a:hover{
    border-bottom: 3px solid var(--main-color);
}

.footer ul li{
    display: inline-block;
    padding: 0 15px;
}

.footer .copyright{
    text-align: center;
    margin-top: 5rem;
}

/* Position spécifique pour le premier portfolio box (LOCINDOOR) */
.portfolio-box:nth-child(1)::before {
    background-position: center center;
}

/* Position spécifique pour le deuxième portfolio box (GREEN CITY) */
.portfolio-box:nth-child(2)::before {
    background-position: center top;
}

/* Position spécifique pour le troisième portfolio box (FLB CONSULTANT) */
.portfolio-box:nth-child(3)::before {
    background-position: center top;
}


@media(max-width: 1285px){
    html{
        font-size: 55%;
    }
    
    .carousel-3d-container {
        padding: 3rem 0 6rem;
    }
    
    .carousel-3d {
        height: 550px;
    }
    
    .carousel-item {
        width: 550px;
        height: 450px;
    }
    
    .carousel-item.left {
        transform: translateX(-350px) translateZ(-250px) rotateY(35deg) scale(0.8);
    }
    
    .carousel-item.right {
        transform: translateX(350px) translateZ(-250px) rotateY(-35deg) scale(0.8);
    }
    
    .carousel-item.far-left {
        transform: translateX(-550px) translateZ(-450px) rotateY(45deg) scale(0.55);
    }
    
    .carousel-item.far-right {
        transform: translateX(550px) translateZ(-450px) rotateY(-45deg) scale(0.55);
    }
    
    .portfolio-timeline{
        max-width: 1000px;
        padding: 0 2rem;
    }
    
    .timeline-project{
        width: calc(50% - 3rem);
    }
    
    .project-card{
        padding: 2.5rem;
    }
    
    .project-icon{
        width: 5rem;
        height: 5rem;
        font-size: 2.2rem;
    }
    
    .project-meta h3{
        font-size: 2.4rem;
    }
}

@media (max-width: 991px) {
    header{
        padding: 2rem 5%;
    }
    section{
        padding: 10rem 5% 2rem;
    }
    
    .carousel-3d-container {
        padding: 2rem 0 5rem;
    }
    
    .carousel-3d {
        height: 500px;
    }
    
    .carousel-item {
        width: 500px;
        height: 400px;
    }
    
    .carousel-item.left {
        transform: translateX(-300px) translateZ(-200px) rotateY(35deg) scale(0.75);
    }
    
    .carousel-item.right {
        transform: translateX(300px) translateZ(-200px) rotateY(-35deg) scale(0.75);
    }
    
    .carousel-item.far-left {
        transform: translateX(-500px) translateZ(-400px) rotateY(45deg) scale(0.5);
    }
    
    .carousel-item.far-right {
        transform: translateX(500px) translateZ(-400px) rotateY(-45deg) scale(0.5);
    }
    
    .timeline-items::before{
        left: 7px;
    }
    .timeline-item:nth-child(odd){
        padding-right: 0;
        text-align: left;
    }
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even){
        padding-left: 37px;
    }
    .timeline-dot{
        left: 0;
    }
    .portfolio{
        padding: 6rem 5% 4rem;
    }
    
    .portfolio-timeline{
        max-width: 900px;
    }
    
    .timeline-project{
        width: calc(50% - 2.5rem);
    }
    
    .project-card{
        padding: 2rem;
    }
    .testimonial .wrapper{
        grid-template-columns: repeat(1,1fr);
    }
    .contact form{
        flex-direction: column;
    }
    .footer{
        padding: 2rem 5%;
    }
}
@media(max-width: 795px){
    #menu-icon{
        display: block;
    }
    
    .header-controls {
        gap: 1.5rem;
    }
    
    #language-toggle {
        font-size: 2.2rem;
        padding: 0.3rem;
    }
    
    #theme-toggle {
        font-size: 2.2rem;
        padding: 0.3rem;
    }

    /* Carousel Mobile Adjustments */
    .carousel-3d-container {
        padding: 2rem 0 4rem;
    }
    
    .carousel-3d {
        height: 450px;
    }
    
    .carousel-item {
        width: 400px;
        height: 350px;
    }
    
    .carousel-item.left {
        transform: translateX(-250px) translateZ(-150px) rotateY(40deg) scale(0.7);
        opacity: 0.5;
    }
    
    .carousel-item.right {
        transform: translateX(250px) translateZ(-150px) rotateY(-40deg) scale(0.7);
        opacity: 0.5;
    }
    
    .carousel-item.far-left,
    .carousel-item.far-right,
    .carousel-item.hidden-left,
    .carousel-item.hidden-right {
        opacity: 0;
        pointer-events: none;
    }
    
    .carousel-content {
        padding: 2rem;
    }
    
    .carousel-icon {
        width: 5rem;
        height: 5rem;
        font-size: 2.5rem;
    }
    
    .carousel-content h3 {
        font-size: 2.5rem;
    }
    
    .carousel-description {
        font-size: 1.3rem;
    }

    /* Fix problematic widths for mobile */
    .home-img img{
        width: 90vw !important;
        height: 45vw !important;
        max-width: 250px !important;
        max-height: 250px !important;
    }

    .timeline-items{
        max-width: 95% !important;
        margin: 0 auto !important;
    }

    .skill-left .skill-bar .bar{
        width: 100% !important;
        max-width: 250px !important;
    }

    .text-animation {
        min-width: auto !important;
        max-width: 100% !important;
        font-size: 2.8rem !important;
    }
    
    .text-animation span {
        display: block !important;
        margin-top: 1rem !important;
    }
    
    /* COMPLETE MOBILE MENU RESET - NUCLEAR APPROACH */
    .navbar{
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        max-height: none !important;
        background: rgba(0, 0, 0, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        display: none !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 9999 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: opacity 0.3s ease !important;
        transform: none !important;
        overflow: visible !important;
    }

    .navbar.active{
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        justify-content: center !important;
        align-items: center !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        max-height: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        z-index: 9999 !important;
        background: rgba(0, 0, 0, 0.8) !important;
        backdrop-filter: blur(20px) !important;
        transform: none !important;
        overflow: visible !important;
        flex-direction: column !important;
    }
    
    .navbar a{
        display: block !important;
        font-size: 3rem !important;
        margin: 1.5rem 0 !important;
        color: white !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 2px !important;
        transition: all 0.3s ease !important;
        padding: 1rem 2rem !important;
        border-radius: 1rem !important;
        text-decoration: none !important;
        border: 2px solid transparent !important;
        background: transparent !important;
        text-align: center !important;
    }
    
    .navbar a:hover {
        color: var(--main-color) !important;
        border-color: var(--main-color) !important;
        background: rgba(0, 255, 65, 0.1) !important;
        transform: scale(1.05) !important;
    }
    
    .navbar a.active {
        color: var(--main-color) !important;
        background: rgba(0, 255, 65, 0.2) !important;
        border-color: var(--main-color) !important;
    }
    .home{
        flex-direction: column-reverse;
        margin: 5rem 2rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .home-content{
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .home-content h3{
        font-size: 2.6rem;
        word-wrap: break-word;
    }
    .home-content h1{
        font-size: 6rem;
        margin-top: 3rem;
        word-wrap: break-word;
    }
    .home-content p{
        max-width: 100%;
        margin: 0 auto;
        word-wrap: break-word;
    }
    .home-img img{
        width: 56vw;
        height: 56vw;
        max-width: 300px;
        max-height: 300px;
    }
    .portfolio h2{
        margin-bottom: 3rem;
    }
    .portfolio-container{
        grid-template-columns: repeat(1,1fr);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 600px) {
    /* Ensure full height navbar on smaller phones */
    
    .navbar,
    .navbar.active {
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        height: 100dvh !important; /* Dynamic viewport height for mobile browsers */
    }
    
    /* Additional enforcement */
    .navbar.active {
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
    }
    
    /* Carousel Mobile Adjustments */
    .carousel-3d-container {
        padding: 1rem 0 3rem;
        perspective: 1500px;
    }
    
    .carousel-3d {
        height: 400px;
    }
    
    .carousel-item {
        width: 320px;
        height: 320px;
    }
    
    .carousel-item.center {
        transform: translateX(0) translateZ(0) rotateY(0deg) scale(1.05);
    }
    
    .carousel-item.left {
        transform: translateX(-180px) translateZ(-100px) rotateY(45deg) scale(0.65);
        opacity: 0.4;
    }
    
    .carousel-item.right {
        transform: translateX(180px) translateZ(-100px) rotateY(-45deg) scale(0.65);
        opacity: 0.4;
    }
    
    .carousel-item.far-left,
    .carousel-item.far-right,
    .carousel-item.hidden-left,
    .carousel-item.hidden-right {
        opacity: 0;
        pointer-events: none;
    }
    
    .carousel-content {
        padding: 1.5rem;
    }
    
    .carousel-icon {
        width: 4rem;
        height: 4rem;
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .carousel-content h3 {
        font-size: 2rem;
    }
    
    .carousel-role {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .carousel-description {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
    }
    
    .carousel-tag {
        font-size: 1rem;
        padding: 0.6rem 1rem;
    }
    
    .carousel-link {
        font-size: 1.2rem;
        padding: 1rem 2rem;
    }
    
    .carousel-dots {
        gap: 1rem;
        margin-top: 3rem;
    }
    
    .carousel-dot {
        width: 10px;
        height: 10px;
    }

     /* Force everything to stay within viewport */
     * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    html {
        font-size: 50%;
        overflow-x: hidden !important;
    }
    
    body {
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }

    /* Responsive heading sizes for mobile */
    .heading {
        font-size: 6.5rem !important;
        margin: 3rem 0rem !important;
    }

    .home {
        flex-direction: column-reverse;
        margin: 2rem 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .home-content {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .home-content h3 {
        font-size: 2rem;
        word-wrap: break-word;
    }

    .home-content h1 {
        font-size: 4rem;
        margin-top: 1rem;
        word-wrap: break-word;
    }

    .home-content p {
        max-width: 100%;
        margin: 0 auto;
        word-wrap: break-word;
    }
    
    .text-animation span {
        display: block !important;
        margin-top: 1rem !important;
    }

    .home-img {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .home-img img {
        width: 80vw;
        height: auto;
        max-width: 250px;
        max-height: 250px;
    }

    /* Portfolio Timeline Mobile Styles */
    .portfolio {
        padding: 4rem 5% 3rem;
    }
    
    .portfolio h2{
        margin-bottom: 4rem;
    }
    
    .portfolio-timeline {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .timeline-line {
        left: 2rem;
        transform: none;
    }
    
    .timeline-project {
        width: calc(100% - 4rem);
        left: 4rem !important;
        text-align: left !important;
        margin-bottom: 4rem;
    }
    
    .timeline-project.left,
    .timeline-project.right {
        left: 4rem !important;
        text-align: left !important;
    }
    
    .timeline-project.left .project-header,
    .timeline-project.right .project-header {
        flex-direction: row !important;
    }
    
    .timeline-project.left .project-tags,
    .timeline-project.right .project-tags {
        justify-content: flex-start !important;
    }
    
    .project-card {
        padding: 2rem;
        margin-left: 1rem;
    }
    
    .project-card::before {
        left: -3.2rem !important;
        right: auto !important;
    }
    
    .project-icon {
        width: 5rem;
        height: 5rem;
        font-size: 2.2rem;
    }
    
    .project-meta h3 {
        font-size: 2.2rem;
        word-wrap: break-word;
    }
    
    .project-meta .role {
        font-size: 1.2rem;
    }
    
    .project-content p {
        font-size: 1.4rem;
        line-height: 1.5;
        word-wrap: break-word;
    }
    
    .project-content {
        opacity: 0;
        transform: translateY(20px);
    }
    
    .project-card:hover .project-content {
        opacity: 1;
        transform: translateY(0);
    }
    
    .project-meta .role {
        opacity: 0;
        transform: translateY(10px);
    }
    
    .project-card:hover .project-meta .role {
        opacity: 1;
        transform: translateY(0);
    }
    
    .tag {
        font-size: 1.1rem;
        padding: 0.6rem 1.2rem;
    }
    
    .project-link {
        font-size: 1.2rem;
        padding: 1rem 2rem;
    }

    .skill-main {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .skill-main h3{
        font-size: 3.6rem;
    }

    .skill-left .skill-bar .info{
        padding: 0 2rem 0 1rem;
        font-size: 1.8rem;
    }

    .skill-left .skill-bar .bar{
        width: 100%;
        max-width: 250px;
    }

    .professional {
        display: grid;
        grid-row-gap: 1fr;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Ensure all major containers stay within viewport */
    .home, .education, .portfolio, .competence, .contact, .footer,
    .portfolio-container, .timeline-items, .skill-main {
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .contact form {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .contact form .input-box {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .contact form .input-box input,
    .contact form textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 300px) {
    /* CRITICAL: Force full height navbar on very small phones */
    .navbar,
    .navbar.active {
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        position: fixed !important;
        width: 100vw !important;
        z-index: 1000 !important;
        display: none !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        background: rgba(0, 0, 0, 0.98) !important;
        backdrop-filter: blur(20px) !important;
    }
    
    .navbar.active {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Force everything to stay within viewport */
    * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    html {
        font-size: 50%;
        overflow-x: hidden !important;
    }
    
    body {
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }

    .header {
        padding: 2rem 5%;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .header-controls {
        gap: 1rem;
    }
    
    #language-toggle {
        font-size: 2rem;
        padding: 0.2rem;
    }
    
    #theme-toggle {
        font-size: 2rem;
        padding: 0.2rem;
    }

    .home {
        flex-direction: column-reverse;
        margin: 2rem 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .home-content {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .home-content h3 {
        font-size: 2rem;
        word-wrap: break-word;
    }

    .home-content h1 {
        font-size: 4rem;
        margin-top: 1rem;
        word-wrap: break-word;
    }

    .home-content p {
        max-width: 100%;
        margin: 0 auto;
        word-wrap: break-word;
    }

    .home-img {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .home-img img {
        width: 80vw;
        height: auto;
        max-width: 250px;
        max-height: 250px;
    }

    section {
        padding: 8rem 5% 2rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Portfolio Timeline Tablet Styles */
    .portfolio {
        padding: 5rem 5% 3rem;
    }
    
    .portfolio h2{
        margin-bottom: 4rem;
    }
    
    .portfolio-timeline {
        max-width: 100%;
        padding: 0 1.5rem;
    }
    
    .timeline-project {
        width: calc(50% - 3rem);
        margin-bottom: 5rem;
    }
    
    .project-card {
        padding: 2.5rem;
    }
    
    .project-icon {
        width: 5.5rem;
        height: 5.5rem;
        font-size: 2.4rem;
    }
    
    .project-meta h3 {
        font-size: 2.6rem;
        word-wrap: break-word;
    }
    
    .project-meta .role {
        font-size: 1.3rem;
    }
    
         .project-content p {
         font-size: 1.5rem;
         line-height: 1.5;
         word-wrap: break-word;
     }
     
     .project-content {
         opacity: 0;
         transform: translateY(20px);
     }
     
     .project-card:hover .project-content {
         opacity: 1;
         transform: translateY(0);
     }
     
     .project-meta .role {
         opacity: 0;
         transform: translateY(10px);
     }
     
     .project-card:hover .project-meta .role {
         opacity: 1;
         transform: translateY(0);
     }

    .project-link {
        font-size: 1.2rem;
        padding: 1rem 2rem;
    }

    .skill-main {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .skill-left .skill-bar .info{
        padding: 0 2rem 0 1rem;
        font-size: 1.8rem;
    }

    .skill-left .skill-bar .bar{
        width: 100%;
        max-width: 250px;
    }

    .professional {
        display: grid;
        grid-row-gap: 1fr;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .contact form {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .contact form .input-box {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .contact form .input-box input,
    .contact form textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .footer {
        padding: 2rem 5%;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Ensure all text elements break properly */
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Prevent any transform effects from causing overflow */
    .social-icons a:hover,
    .btn:hover,
    .portfolio-box:hover {
        transform: none !important;
    }

    .text-animation {
        font-size: 2.2rem !important;
        min-width: auto !important;
        max-width: 95% !important;
    }
    
    /* Ensure animated text also breaks line on the smallest screens */
    .text-animation span {
        display: block !important;
        margin-top: 1rem !important;
    }

    /* Fix problematic widths for smallest screens */
    .home-img img{
        width: 70vw !important;
        height: 70vw !important;
        max-width: 200px !important;
        max-height: 200px !important;
    }

    .timeline-items{
        max-width: 90% !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }

    .skill-left .skill-bar .bar{
        width: 90% !important;
        max-width: 200px !important;
    }

    .skill-left .skill-bar .info{
        padding: 0 1rem 0 0.5rem !important;
        font-size: 1.6rem !important;
    }

    /* Force all sections to stay within viewport */
    section {
        padding: 8rem 3% 2rem !important;
        margin: 0 !important;
        overflow-x: hidden !important;
    }

    /* Ensure all major containers stay within viewport */
    .home, .education, .portfolio, .competence, .contact, .footer,
    .portfolio-container, .timeline-items, .skill-main {
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Fix home content width */
    .home-content {
        width: 100% !important;
        max-width: 95% !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }

    /* Ensure headers don't overflow */
    .header {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Portfolio Timeline Very Small Screens */
    .portfolio {
        padding: 3rem 3% 2rem !important;
    }
    
    .portfolio-timeline {
        padding: 0 0.5rem !important;
    }
    
    .timeline-line {
        left: 1.5rem !important;
    }
    
    .timeline-project {
        width: calc(100% - 3rem) !important;
        left: 3rem !important;
        margin-bottom: 3rem !important;
    }
    
    .project-card {
        padding: 1.5rem !important;
        margin-left: 0.5rem !important;
    }
    
    .project-card::before {
        left: -2.7rem !important;
    }
    
    .project-icon {
        width: 4rem !important;
        height: 4rem !important;
        font-size: 1.8rem !important;
    }
    
    .project-meta h3 {
        font-size: 1.8rem !important;
    }
    
    .project-meta .role {
        font-size: 1rem !important;
    }
    
    .project-content p {
        font-size: 1.2rem !important;
    }
    
    .project-content {
        opacity: 0 !important;
        transform: translateY(20px) !important;
    }
    
    .project-card:hover .project-content {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    
    .project-meta .role {
        opacity: 0 !important;
        transform: translateY(10px) !important;
    }
    
    .project-card:hover .project-meta .role {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    
    .tag {
        font-size: 1rem !important;
        padding: 0.5rem 1rem !important;
    }
    
    .project-link {
        font-size: 1.1rem !important;
        padding: 0.8rem 1.5rem !important;
    }
}