/* --- Premium Cinematic Preloader System --- */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 999999;
    /* Boosted z-index */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f2ede6;
    /* Universal beige background */
}

#preloader.loaded {
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s 0.8s;
}

/* Hide theme toggle during preloader */
#preloader:not(.loaded)~#theme-toggle {
    display: none !important;
}

/* Diagonal Background Panels */
.pre-bg-slanted {
    position: absolute;
    inset: -10%;
    /* Negative inset to ensure total coverage */
    display: flex;
    z-index: 1;
}

.pre-bg-slanted .slanted-panel {
    position: absolute;
    width: 250%;
    /* Massive width for total coverage with skew */
    height: 120%;
    background: #f2ede6;
    /* Universal beige background */
    transition: transform 2.2s cubic-bezier(0.85, 0, 0.15, 1);
}

.pre-bg-slanted .slanted-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(134, 101, 59, 0.05) 0%, transparent 70%);
}

.pre-bg-slanted .slanted-panel:nth-child(1) {
    top: -10%;
    left: -70%;
    transform: skewX(-35deg);
}

.pre-bg-slanted .slanted-panel:nth-child(2) {
    bottom: -10%;
    right: -70%;
    transform: skewX(-35deg);
}

#preloader.loaded .slanted-panel:nth-child(1) {
    transform: translateX(-180%) skewX(-35deg);
}

#preloader.loaded .slanted-panel:nth-child(2) {
    transform: translateX(180%) skewX(-35deg);
}

/* Unified Theme Style - Always Light/Beige */
#preloader .pre-logo {
    color: #444;
    /* Dark grey for beige bg */
}

/* Giant Counter - Natural Integration */
.pre-counter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40vw;
    font-weight: 950;
    font-family: 'Outfit', sans-serif;
    /* Soft blending gradient for beige */
    background: linear-gradient(180deg, rgba(134, 101, 59, 0.12) 0%, rgba(134, 101, 59, 0.02) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    z-index: 5;
    user-select: none;
    pointer-events: none;
    transition: opacity 1s ease;
}

#preloader.loaded .pre-counter {
    opacity: 0;
}

/* Content & Logo */
.pre-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: #444;
    /* Dark grey for beige bg */
    width: 100%;
}

.pre-logo-container {
    margin-bottom: 70px;
}

.pre-logo {
    font-size: 3.5rem;
    font-weight: 200;
    letter-spacing: 25px;
    display: inline-block;
    color: inherit;
    text-transform: uppercase;
    animation: preLogoMaster 2.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes preLogoMaster {
    0% {
        transform: translateY(60px) scale(0.9);
        filter: blur(20px);
        letter-spacing: 50px;
        opacity: 0;
    }

    100% {
        transform: translateY(0) scale(1);
        filter: blur(0);
        letter-spacing: 25px;
        opacity: 1;
    }
}

.pre-logo span {
    color: var(--accent-color);
    font-weight: 800;
    animation: accentGlowPulse 4s infinite alternate ease-in-out;
}

@keyframes accentGlowPulse {
    from {
        text-shadow: 0 0 15px rgba(134, 101, 59, 0.15);
        transform: scale(1);
    }

    to {
        text-shadow: 0 0 45px var(--accent-color);
        transform: scale(1.02);
    }
}

/* Beefy Tech Bar */
.pre-loader-container {
    width: 400px;
    height: 12px;
    /* Even beefier */
    background: rgba(134, 101, 59, 0.08);
    margin: 0 auto;
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

#preloader.pre-dark-theme .pre-loader-container {
    background: rgba(0, 0, 0, 0.08);
}

.pre-loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #fff, var(--accent-color));
    background-size: 200% 100%;
    animation: barShimmer 3s infinite linear;
    transition: width 0.1s linear;
    box-shadow: 0 0 40px var(--accent-color);
}

@keyframes barShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

#preloader.loaded .pre-content {
    opacity: 0;
    transform: scale(1.1);
    filter: blur(30px);
    transition: all 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.no-translate {
    user-select: none;
    -webkit-user-select: none;
}

:root {
    /* Mode Claire (par défaut) */
    --bg-color: #ffffff;
    --text-color: #000000;
    --nav-bg: rgba(255, 255, 255, 0.98);
    --accent-color: rgb(134, 101, 59);
    --accent-glow: rgba(134, 101, 59, 0.2);
    --card-bg: rgb(226, 219, 209);
    --letstalk-bg: rgb(82, 62, 35);
    --letstalk-text: #ffffff;
    --lesttalk-hover-bg: rgb(163, 144, 119);
    --glass-border: rgba(134, 101, 59, 0.1);
    --shadow-premium: 0 10px 40px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    /* Mode Sombre */
    --bg-color: #000000;
    --text-color: #ffffff;
    --nav-bg: #000000;
    --accent-color: rgb(134, 101, 59);
    --accent-glow: rgba(134, 101, 59, 0.3);
    --card-bg: rgb(226, 219, 209);
    --letstalk-bg: #ffffff;
    --letstalk-text: rgb(82, 62, 35);
    --lesttalk-hover-bg: #ddd;
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-premium: 0 10px 40px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    margin: 0;
    padding-top: 5px;
    padding-bottom: 60px;
}

html {
    scroll-behavior: smooth;
}

/* --- Modern Tech Background --- */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        linear-gradient(var(--glass-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), black 0%, transparent 60%);
    -webkit-mask-image: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), black 0%, transparent 60%);
    opacity: 0.25;
    pointer-events: none;
    transition: mask-image 0.1s ease;
}

.bg-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: radial-gradient(var(--glass-border) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.15;
    pointer-events: none;
}

/* --- Interactive Cursor --- */
.cursor-blob {
    width: 300px;
    height: 300px;
    background: var(--accent-glow);
    border-radius: 50%;
    position: fixed;
    top: var(--mouse-y, 50%);
    left: var(--mouse-x, 50%);
    transform: translate(-50%, -50%);
    filter: blur(80px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
    transition: top 0.15s ease-out, left 0.15s ease-out;
}

/* --- Animation Classes --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-left.active,
.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Typing Cursor Style */
.typing-cursor::after {
    content: '|';
    animation: blink 1s infinite;
    color: var(--accent-color);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --- Improved Interactive Elements --- */
.glass-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 20px 40px var(--accent-glow);
}


/* Navbar Section */
.navbar {
    padding: 10px 0px;
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--bg-color);
    z-index: 1000;
}

.logoLink a {
    text-decoration: none;
    color: var(--text-color);
}

.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    padding: 5px 30px;
}

.logo {
    font-size: 32px;
    font-weight: bold;
    padding-left: 0px;
}

.logo span {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.35s;
    font-size: 20px;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--accent-color);
    text-decoration: underline;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--letstalk-bg);
    margin: 3px 0;
    transition: 0.3s;
}

/* Page1 Section */
.page1 {
    display: flex;
    margin: 40px auto;
    padding: 20px 80px;
    align-items: center;
    min-height: 400px;
}

.burreau {
    flex: 1;
}

.burreau img {
    width: 98%;
    max-width: 700px;
}

.details {
    flex: 1;
}

.hello {
    font-weight: bold;
    font-size: 24px;
    margin: 20px 0 5px 0;
    color: var(--accent-color);
}

.allName {
    font-weight: bold;
    font-size: 41px;
    margin: 0 0 17px 0;
}

.name {
    color: var(--accent-color);
}

.specialite {
    font-size: 23px;
    font-style: italic;
    margin: 0;
    color: rgb(120, 119, 119);
}

.description {
    line-height: 1.3;
    margin-bottom: 6%;
    font-size: 22px;
}

.letsTalk {
    background-color: var(--letstalk-bg);
    color: var(--letstalk-text);
    border: none;
    padding: 11px 32px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s;
    text-decoration: none;
}

.letsTalk:hover {
    background-color: var(--lesttalk-hover-bg);
    box-shadow: 0 2px 15px var(--letstalk-bg);
}

/* About Section */
.about {
    display: flex;
    padding: 20px 0px;
    gap: 30px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 100%;
}

.profil {
    flex: 30%;
    display: flex;
    justify-content: center;
}

.profil img {
    margin-top: -20px;
    margin-left: -80px;
    width: 100% auto;
    max-height: 520px;
}

.formulaire {
    flex: 70%;
    margin-right: -50px;
}

.TitreAbout {
    text-align: center;
    font-size: 36px;
    color: var(--accent-color);
    margin-bottom: 60px;
    text-shadow: 2px 2px 4px var(--accent-color);
    position: relative;
}

.TitreAbout::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 5px;
    background: linear-gradient(90deg, rgb(141, 111, 73), rgb(217, 208, 197), rgb(222, 204, 181));
    border-radius: 10px;
}

.desc {
    color: rgb(120, 119, 119);
    font-size: 20px;
    font-style: italic;
    margin-bottom: 15px;
}

.formInfos {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--letstalk-bg);
    border-radius: 10px;
    padding-left: 30px;
}

.info span:first-child {
    font-size: 21px;
    font-weight: 600;
    color: var(--text-color);
    min-width: 30%;
}

.info span:last-child {
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    color: var(--accent-color);
}

/* Skills Section */
.skills {
    padding: 60px 0;
    overflow: hidden;
}

.skills .TitreAbout {
    margin-bottom: 80px;
}

.skills-container-new {
    display: flex;
    justify-content: center;
    gap: 80px;
    flex-wrap: wrap;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.skills {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.skills::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(184, 142, 79, 0.4) 0%, rgba(217, 208, 197, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0.6;
    pointer-events: none;
    animation: pulseGlow 8s infinite alternate;
}

@keyframes pulseGlow {
    0% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.7;
    }
}

.skills-container-glass {
    display: flex;
    justify-content: center;
    gap: 40px;
    /* Increased gap */
    padding: 0 20px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    /* Slightly more opaque for better contrast */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 50px 30px;
    width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Gradient Border Effect on Hover */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--bg-color), var(--accent-color), var(--bg-color));
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

.glass-card:hover::before {
    transform: scaleX(1);
}

[data-theme="dark"] .glass-card {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 30px 60px rgba(134, 101, 59, 0.25);
    border-color: var(--accent-color);
}

/* Floating Icon Animation */
.card-icon {
    font-size: 50px;
    color: var(--accent-color);
    margin-bottom: 30px;
    background: linear-gradient(135deg, rgba(134, 101, 59, 0.1), rgba(134, 101, 59, 0.05));
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    /* Organic shape */
    transition: all 0.5s ease;
    animation: floatIcon 6s ease-in-out infinite;
    box-shadow: 0 10px 20px rgba(134, 101, 59, 0.1);
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }

    50% {
        transform: translateY(-10px) rotate(5deg);
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
    }
}

.glass-card:hover .card-icon {
    background: var(--accent-color);
    color: var(--bg-color);
    transform: scale(1.1) rotate(0deg) !important;
    /* Stop float on hover */
    animation: none;
    box-shadow: 0 0 30px rgba(134, 101, 59, 0.6);
}

.glass-card h3 {
    font-size: 28px;
    color: var(--text-color);
    margin-bottom: 30px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 15px;
}

.glass-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--accent-color);
    opacity: 0.5;
    border-radius: 2px;
}

.glass-skills-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.glass-skill-tag {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.5);
    /* Semi-transparent tag */
    border: 1px solid rgba(134, 101, 59, 0.3);
    color: var(--text-color);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
    display: flex;
    align-items: center;
    gap: 8px;
    /* Space between icon and text */
}

.glass-skill-tag i {
    font-size: 18px;
    /* Icon size */
}

[data-theme="dark"] .glass-skill-tag {
    background: rgba(255, 255, 255, 0.05);
}

/* Ensure github icon is visible in dark mode if it's black */
[data-theme="dark"] .glass-skill-tag .devicon-github-original {
    filter: invert(1);
    /* For FontAwesome GitHub icon if used as fallback */
    color: white;
}

/* Fallback for FontAwesome if class changes */
[data-theme="dark"] .glass-skill-tag .fa-github {
    color: white !important;
}

.glass-card:hover .glass-skill-tag {
    border-color: var(--accent-color);
    transform: scale(1);
}

.glass-skill-tag:hover {
    background: var(--skill-color, var(--accent-color));
    color: white !important;
    border-color: var(--skill-color, var(--accent-color));
    transform: translateY(-5px) scale(1.05) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.glass-skill-tag:hover i {
    color: white !important;
    transform: scale(1.2);
}

/* Responsive */
@media screen and (max-width: 996px) {
    .skills-container-glass {
        flex-direction: row;
        align-items: center;
        gap: 40px;
    }

    .glass-card {
        max-width: 450px;
        padding: 40px 25px;
    }

    .skills {
        padding: 60px 0;
    }
}

/* Projects Section */
.projetsPart {
    margin-top: 8%;
}

.projects {
    padding: 40px 0;
}

.projects .container {
    max-width: 100%;
    width: 100%;
    padding: 0;
    /* display: flex; */
    /* flex-direction: column; */
    align-items: center;
    margin-bottom: -2%;
}

.projects .TitreAbout {
    margin-top: -70px;
    margin-bottom: -85px;
}

.projects-carousel {
    position: relative;
    height: 600px;
    width: 100%;
    margin: 40px 0;
    margin-bottom: 0;
    overflow: visible;
}

.projects-slider {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 2000px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card {
    max-width: 28%;
    position: absolute;
    background-color: var(--card-bg);
    border-radius: 30px;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 5px 25px 40px rgba(141, 111, 73, 0.4);
}

.project-card:hover {
    box-shadow: 0 5px 25px var(--text-color);
}

/* 3D Carousel Positions - نسخة منقية */
.project-card[data-pos="0"] {
    transform: translateX(0) translateZ(0) scale(1.1);
    z-index: 10;
    opacity: 1;
}

.project-card[data-pos="1"] {
    transform: translateX(280px) translateZ(-200px) rotateY(-25deg) scale(0.85);
    z-index: 4;
    opacity: 0.8;
}

.project-card[data-pos="-1"] {
    transform: translateX(-280px) translateZ(-200px) rotateY(25deg) scale(0.85);
    z-index: 4;
    opacity: 0.8;
}

.project-card[data-pos="2"] {
    transform: translateX(480px) translateZ(-350px) rotateY(-35deg) scale(0.7);
    z-index: 3;
    opacity: 0.5;
}

.project-card[data-pos="-2"] {
    transform: translateX(-480px) translateZ(-350px) rotateY(35deg) scale(0.7);
    z-index: 3;
    opacity: 0.5;
}

.project-card[data-pos="hidden"] {
    transform: translateX(0) translateZ(-500px) scale(0.5);
    z-index: 1;
    opacity: 0;
    pointer-events: none;
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-info {
    padding: 10px;
    color: var(--bg-color);
    font-size: 16px;
}

.project-description {
    color: rgb(98, 98, 98);
    font-style: italic;
    font-size: 15px;
    margin-bottom: 15px;
}

.project-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tag {
    background-color: transparent;
    border: 2px solid rgb(141, 111, 73);
    color: rgb(89, 69, 44);
    padding: 4px 5px;
    border-radius: 20px;
    font-size: 13px;
}

.project-buttons {
    display: flex;
    gap: 15px;
}

.btn-website {
    padding: 5px 15px;
    text-align: center;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 15px;
    border: 2px solid rgb(141, 111, 73);
    color: rgb(89, 69, 44);
    background: transparent;
    display: inline-block;
    min-width: 15%;
}

.btn-website:hover {
    background: rgb(212, 198, 179);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(141, 111, 73, 0.4);
}

.prev-btn-projects,
.next-btn-projects {
    position: absolute;
    top: 49%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 101;
    background: rgb(217, 208, 197);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.prev-btn-projects {
    left: 3%;
}

.next-btn-projects {
    right: 3%;
}

.prev-btn-projects:hover,
.next-btn-projects:hover {
    box-shadow: 0 5px 15px rgb(141, 111, 73);
}

.prev-btn-projects svg,
.next-btn-projects svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-color);
}

.projects .carousel-indicators {
    margin-top: -70px;
}

/*Contacts Section */
.contact {
    margin-bottom: -30px;
    margin-top: 80px;
}

.contacts {
    width: 120%;
    margin-left: 0;
    align-items: center;
    border: solid 1px var(--text-color);
    border-radius: 30px;
    padding: 15px 25px;
    box-shadow: 5px 5px 25px var(--text-color);
}

.contactTout {
    margin-top: -2%;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 50px 0;
    padding-top: 0;
}

.photoContact {
    flex: 38%;
    margin-left: 80px;
    margin-right: -10px;
    display: flex;
    justify-content: flex-end;
    z-index: 2;
}

.photoContact img {
    width: 230px;
    height: auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
}

.contact-form input {
    border-radius: 15px;
    padding: 11px;
    border: none;
    padding-left: 18px;
    background-color: var(--card-bg);
    margin-bottom: -8px;
}

#Message {
    height: 60px;
    min-height: 50px;
    max-height: 100px;
}

#submit-btn {
    /* padding-left: 0; */
    background-color: var(--letstalk-bg);
    color: var(--letstalk-text);
    font-weight: bold;
    margin-bottom: 4%;
    transition: all 0.3s;
}

.contact-form input:hover {
    box-shadow: 0px 5px 15px var(--letstalk-bg);
}

#submit-btn:hover {
    background-color: var(--lesttalk-hover-bg);
    transition: translateY(-2px);
    box-shadow: 5px 2px 15px var(--letstalk-text);
}

.contact-info {
    margin-top: -15px;
    text-align: center;
    display: flex;
    justify-content: center;
    margin-bottom: -8px;
    line-height: 1.4;
    gap: 60px;
}

.infos {
    margin-bottom: 20px;
    line-height: 1.4;
}

.infos img {
    width: 55px;
    border: 2px solid var(--text-color);
    border-radius: 50%;
    box-shadow: 1px 2px 20px var(--text-color);
    background-color: var(--card-bg);
}

.info1 {
    font-weight: bold;
    color: var(--accent-color);
    font-size: 20px;
}

.info2 {
    font-style: normal;
    color: var(--text-color);
    font-size: 17px;
}

.info2:hover {
    color: var(--lesttalk-hover-bg);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links img {
    align-items: center;
    width: 40px;
    border: 1px solid var(--text-color);
    border-radius: 50%;
    padding: 5px;
    background-color: var(--card-bg);
}

.social-links img:hover {
    box-shadow: 1px 2px 20px var(--text-color);
}

/* Theme Toggle Section */
#theme-toggle {
    background: var(--text-color);
    color: var(--bg-color);
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100000;
    /* Higher than preloader when it is loaded */
    border: 1px solid var(--accent-color);
    font-size: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto !important;
}

#theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 0 20px var(--accent-glow);
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 1px 0;
    color: var(--text-color);
    font-size: 16px;
    z-index: 1000;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
    transform: translateY(100%);
    transition: transform 0s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.footer.visible {
    transform: translateY(0);
}


/* --- Certificates Folder Section --- */
.certificates {
    padding: 60px 0;
    background: transparent;
}

/* --- Certificates & Documents Layout --- */
.certificates-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 40px;
    max-width: 1400px;
    margin: 40px auto 0px auto;
    padding: 0 50px;
    min-height: 400px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.folders-sidebar {
    display: flex;
    flex-direction: row;
    gap: 100px;
    padding: 20px 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    justify-content: center;
    width: 100%;
}

/* When a folder is open, switch to sidebar + card layout */
.certificates-container.is-open {
    align-items: flex-start;
    gap: 100px;
    /* More space between folders and card */
}

.certificates-container.is-open .folders-sidebar {
    flex-direction: column;
    gap: 60px;
    width: auto;
    margin-top: 40px;
}

.lists-container {
    flex: 1;
    max-width: 750px;
    display: none;
    align-items: flex-start;
}

.certificates-container.is-open .lists-container {
    display: flex;
}

.list-title {
    font-size: 24px;
    color: var(--accent-color);
    margin-bottom: 25px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 5px solid var(--accent-color);
    padding-left: 15px;
}

.folder-wrapper {
    perspective: 1500px;
    cursor: pointer;
    padding: 20px;
}

.folder {
    position: relative;
    width: 200px;
    /* Smaller size */
    height: 140px;
    background-color: #d2c1b3;
    border-radius: 0 15px 15px 15px;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.folder-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #d2c1b3;
    border-radius: 0 15px 15px 15px;
    transform: translateZ(-1px);
}

.folder-front {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #e2d1c3;
    border-radius: 0 15px 15px 15px;
    transform-origin: bottom;
    transition: transform 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 5;
}

.folder-tab {
    position: absolute;
    top: -16px;
    left: 0;
    width: 60px;
    height: 18px;
    background-color: #d2c1b3;
    border-radius: 6px 6px 0 0;
}

.folder-title {
    font-weight: 800;
    color: #8d6f49;
    letter-spacing: 2px;
    font-size: 14px;
    opacity: 0.7;
}

.paper {
    position: absolute;
    width: 90%;
    height: 120px;
    /* Reduced to fit 140px folder */
    background: white;
    left: 5%;
    bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}

.paper i {
    font-size: 30px;
    color: #8d6f49;
}

.paper span {
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.paper-1 {
    transform: rotate(-5deg);
    z-index: 1;
}

.paper-2 {
    transform: rotate(0deg);
    z-index: 2;
}

.paper-3 {
    transform: rotate(5deg);
    z-index: 3;
}

.folder.active .folder-front,
.folder:hover .folder-front {
    transform: rotateX(-45deg);
    background-color: #fff3eb;
}

.folder.active .paper-1,
.folder:hover .paper-1 {
    transform: translate(-30px, -60px) rotate(-15deg);
}

.folder.active .paper-2,
.folder:hover .paper-2 {
    transform: translateY(-80px) rotate(0deg);
}

.folder.active .paper-3,
.folder:hover .paper-3 {
    transform: translate(30px, -60px) rotate(15deg);
}

.cert-icon-box {
    width: 70px;
    height: 70px;
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: var(--accent-color);
    font-size: 28px;
}

.cv-preview {
    width: 80px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.cv-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cert-list {
    width: 100%;
    min-height: 450px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 35px;
    display: none;
    flex-direction: column;
    gap: 20px;
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.cert-list.active {
    display: flex;
}

.cert-item {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 20px 25px;
    background: var(--nav-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.02);
}

.cert-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px var(--accent-glow);
    border-color: var(--accent-color);
}

.cert-item i {
    font-size: 28px;
    color: var(--accent-color);
    background: var(--accent-glow);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    transition: all 0.3s;
}

.cert-item:hover i {
    background: var(--accent-color);
    color: white;
    transform: rotate(10deg);
}

.cert-info {
    flex-grow: 1;
}

.cert-info h4 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.cert-info p {
    margin: 6px 0 0;
    font-size: 15px;
    color: #888;
    font-weight: 500;
}

.view-cert {
    padding: 10px 25px;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px var(--accent-glow);
}

.view-cert:hover {
    background: var(--letstalk-bg);
    transform: scale(1.1);
    box-shadow: 0 6px 15px var(--accent-glow);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-theme="dark"] .paper {
    background: white;
    color: black;
}

[data-theme="dark"] .paper span {
    color: #ccc;
}

/* ============================================
   MEDIA QUERIES POUR TOUTES LES TAILLES
   ============================================ */

/* Extra small devices (phones, 320px and below) */
@media screen and (max-width: 320px) {

    /* Votre code existant pour 320px reste ici */
    body {
        padding: 30px 15px;
        overflow-x: hidden;
        position: relative;
    }

    .navbar {
        padding: 15px 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1001;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        top: 60px;
        left: -100%;
        flex-direction: column;
        background-color: var(--bg-color);
        height: 100%;
        text-align: left;
        transition: 0.35s;
        gap: 0;
        padding: 10px 30px 30px 30px;
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        width: 100%;
        margin: 5px 0;
    }

    .nav-menu a {
        font-size: 16px;
        padding: 10px 15px;
        display: block;
        border-bottom: 1px solid var(--letstalk-bg);
        border-radius: 5px;
        width: 100%;
        margin-left: 0;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(-49deg) translate(-5px, 7px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(46deg) translate(-5px, -8px);
    }

    .page1 {
        padding-top: 20px;
        text-align: center;
        flex-direction: column;
    }

    .btnPage1 {
        gap: 5px;
    }

    .details {
        order: 2;
        margin-top: 50px;
    }

    .logo {
        font-size: 22px;
    }

    .burreau img {
        width: 100%;
        max-width: 280px;
        order: 1;
    }

    .hello {
        margin-top: -20px;
        font-size: 17px;
    }

    .allName {
        margin-top: -5px;
        font-size: 28px;
        width: 300px;
    }

    .specialite {
        margin-top: -10px;
        font-size: 16px;
    }

    .description {
        margin-top: -6px;
        font-size: 16px;
        margin-bottom: 26px;
    }

    .letsTalk {
        padding: 8px 15px;
        display: block;
        margin: 0 auto;
        font-size: 15px;
        width: 45%;
        margin-bottom: 10px;
    }

    .about {
        margin-top: 65px;
        flex-direction: column;
        padding: 15px;
    }

    .formInfos {
        padding-right: 0;
        width: 90%;
    }

    .profil {
        flex: 100%;
        margin-top: -90px;
        display: flex;
    }

    .profil img {
        width: 75%;
        max-width: 75%;
        margin-left: 5px;
        margin-top: 50px;
        transition: transform 0.4s ease;
    }

    .TitreAbout {
        margin-top: -30px;
        font-size: 20px;
        margin-bottom: 35px;
    }

    .TitreAbout::after {
        width: 60px;
        height: 3px;
    }

    .about .TitreAbout {
        margin-right: 40px;
    }

    .desc {
        font-size: 14px;
        width: 90%;
        text-align: center;
        margin-left: 0;
    }

    .info {
        display: flex;
        width: 100%;
        margin-left: 0;
        margin-bottom: 5px;
        padding-left: 10px;
    }

    .info span:first-child {
        font-size: 14px;
        min-width: 100px;
    }

    .info span:last-child {
        font-size: 13px;
    }

    .skills {
        width: 100%;
    }

    .glass-card h3 {
        font-size: 18px;
    }

    .glass-skill-tag {
        font-size: 13px;
        padding: 5px 10px;
    }

    .projects {
        margin-top: -100px;
    }

    .project-card {
        max-width: 240px;
        min-width: 240px;
    }

    .projects-slider {
        height: 100%;
        margin-top: 30px;
        width: 100%;
    }

    .project-image {
        height: 190px;
    }

    .project-title {
        font-size: 15px;
    }

    .project-description {
        font-size: 13px;
        margin-top: 2px;
    }

    .tag {
        font-size: 13px;
        padding: 3px 3px;
        margin-bottom: -10px;
    }

    .btn-website {
        font-size: 14px;
        padding: 3px 8px;
    }

    .project-card[data-pos="1"],
    .project-card[data-pos="2"],
    .project-card[data-pos="-1"],
    .project-card[data-pos="-2"] {
        opacity: 0;
        pointer-events: none;
    }

    .project-card[data-pos="0"] {
        transform: translateX(0) scale(1);
        z-index: 10;
        opacity: 1;
    }

    .project-info {
        padding: 15px;
    }

    .projects .TitreAbout {
        margin-top: 180px;
        margin-bottom: -210px;
    }

    .projects-carousel {
        height: 600px;
    }

    .prev-btn-projects,
    .next-btn-projects {
        width: 35px;
        height: 35px;
        top: 60%;
    }

    .prev-btn-projects {
        left: -3%;
    }

    .next-btn-projects {
        right: -3%;
    }

    .project-card {
        margin-top: 120px;
    }

    .projects .carousel-indicators {
        margin-top: 0;
    }

    .contacts {
        flex: 100%;
        margin: auto;
        padding: 5% 3%;
    }

    .contactTout {
        overflow: inherit;
    }

    .photoContact {
        display: none;
    }

    .contact-form {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .contact-form input {
        border-radius: 15px;
        width: 85%;
        border: none;
        padding-left: 12px;
        background-color: var(--card-bg);
        padding: 10px;
    }

    #Message {
        height: 45px;
        min-height: 40px;
        max-height: 50px;
    }

    .contact-info {
        text-align: center;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
    }

    .infos {
        font-size: 11px;
    }

    .infos img {
        width: 40px;
    }

    .info1 {
        font-weight: bold;
        font-size: 18px;
    }

    .info2 {
        font-style: normal;
        font-size: 14px;
    }

    .social-links img {
        width: 25px;
    }

    .indicator {
        width: 8px;
        height: 8px;
    }


    .footer {
        padding: 5px 0;
        font-size: 12px;
        width: 100%;
        margin-bottom: -28px;
    }

    /* Certificates logic for <320px */
    .certificates-container {
        flex-direction: column;
        padding: 0 10px;
        gap: 15px;
        min-height: auto;
        overflow: visible;
    }

    .certificates-container.is-open {
        gap: 15px;
    }

    .certificates-container {
        padding: 0 5px !important;
    }

    .container {
        padding: 0 10px !important;
    }

    .folders-sidebar {
        flex-direction: row !important;
        justify-content: center;
        gap: 10px;
        width: 100%;
        margin: 0 auto;
        margin-top: 50px;
    }

    .certificates-container.is-open .folders-sidebar {
        flex-direction: row !important;
        margin-top: 0;
        gap: 10px;
        width: 100%;
    }

    .folder-wrapper {
        padding: 0 !important;
    }

    .folder {
        width: 100px !important;
        height: 70px !important;
    }

    .folder-tab {
        width: 35px;
        height: 10px;
        top: -9px;
    }

    .folder-title {
        font-size: 9px;
    }

    .paper {
        height: 75px;
    }

    .paper i {
        font-size: 18px;
    }

    .lists-container {
        max-width: 100%;
        width: 100%;
    }

    .cert-list {
        padding: 15px;
        min-height: auto;
        gap: 15px;
    }

    .cert-item {
        gap: 12px;
        padding: 12px;
    }

    .cert-info h4 {
        font-size: 15px;
    }

    .cert-info p {
        font-size: 13px;
    }

    .view-cert {
        padding: 8px 15px;
        font-size: 12px;
    }

    .folder.active .paper-2,
    .folder:hover .paper-2 {
        transform: translateY(-45px) rotate(0deg);
    }

    .folder.active .paper-1,
    .folder:hover .paper-1 {
        transform: translate(-15px, -30px) rotate(-15deg);
    }

    .folder.active .paper-3,
    .folder:hover .paper-3 {
        transform: translate(15px, -30px) rotate(15deg);
    }
}

/* Small devices (phones, 321px to 576px) */
@media screen and (min-width: 321px) and (max-width: 576px) {
    body {
        overflow-x: hidden;
    }

    .navbar {
        padding: 10px 10px;
    }

    .container {
        padding: 0 5px;
    }

    .logo {
        font-size: 25px;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        flex-direction: column;
        background-color: var(--bg-color);
        width: 150px;
        gap: 18px;
        height: 100%;
        transition: 0.35s;
        z-index: 999;
        padding: 10px 30px 30px 30px;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        padding: 8px 8px;
        width: 100%;
        border-bottom: 1px solid var(--letstalk-bg);
        border-radius: 6px;
    }

    .nav-menu a {
        font-size: 17px;
        padding: 10px 15px;
        width: 100%;
    }

    .page1 {
        display: flex;
        flex-direction: column;
        padding: 50px;
        padding-top: 0;
        margin-top: 60px;
        gap: 20px;
    }

    .burreau,
    .details {
        width: 100%;
        line-height: 14px;
        order: 2;
        text-align: center;
    }

    .burreau {
        width: 100%;
        order: 1;
        display: flex;
        justify-content: center;
    }

    .burreau img {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        display: block;
    }

    .hello {
        font-size: 15px;
    }

    .allName {
        font-size: 24px;
    }

    .specialite {
        margin-top: -8px;
        font-size: 16px;
    }

    .description {
        font-size: 15px;
    }

    .letsTalk {
        display: block;
        margin: 0 auto;
        font-size: 15px;
        padding: 8px 3px;
        width: 45%;
        margin-bottom: 10px;
    }

    .about {
        flex-direction: column;
        padding: 20px;
        margin-top: -10px;
        margin-right: 30px;
    }

    .profil img {
        width: 70%;
        max-width: 280px;
        margin: 0 auto;
        margin-bottom: -20px;
        display: block;
    }

    .TitreAbout {
        font-size: 23px;
        margin-bottom: 25px;
    }

    .TitreAbout::after {
        width: 70px;
    }

    .about .TitreAbout {
        margin-right: 30px;
    }

    .desc {
        font-size: 14px;
        text-align: center;
        width: 100%;
    }

    .info {
        padding: 10px 0;
        width: 100%;
        margin: 0;
    }

    .info span:first-child {
        padding-left: 12px;
        font-size: 15px;
        min-width: 125px;
    }

    .info span:last-child {
        font-size: 15px;
    }

    .skills-container-glass {
        margin: 10px;
    }

    .glass-card h3 {
        font-size: 20px;
    }

    .glass-skill-tag {
        font-size: 15px;
        padding: 5px 10px;
    }

    .projects {
        margin-top: 40px;
    }

    .project-card {
        max-width: 80%;
        width: 90%;
    }

    .project-image {
        height: 190px;
    }

    .project-title {
        font-size: 15px;
    }

    .project-description {
        font-size: 13px;
        margin-top: 2px;
    }

    .tag {
        font-size: 13px;
        padding: 3px 3px;
        margin-bottom: -10px;
    }

    .btn-website {
        font-size: 14px;
        padding: 3px 8px;
    }

    .project-card[data-pos="1"],
    .project-card[data-pos="2"],
    .project-card[data-pos="-1"],
    .project-card[data-pos="-2"] {
        opacity: 0;
        pointer-events: none;
    }

    .project-card[data-pos="0"] {
        transform: translateX(0) scale(1);
        z-index: 10;
        opacity: 1;
    }

    .project-info {
        padding: 15px;
    }

    .projects .TitreAbout {
        margin-top: 50px;
        margin-bottom: -140px;
    }

    .projects-carousel {
        height: 500px;
    }

    .prev-btn-projects,
    .next-btn-projects {
        width: 35px;
        height: 35px;
        top: 60%;
    }

    .prev-btn-projects {
        left: 0%;
    }

    .next-btn-projects {
        right: 0%;
    }

    .project-card {
        margin-top: 120px;
    }

    .projects .carousel-indicators {
        margin-top: 20px;
    }

    .contactTout {
        flex-direction: column;
        padding: 20px;
    }

    .contact-form input {
        padding: 13px;
    }

    .photoContact {
        display: none;
    }

    .contacts {
        width: 100%;
        margin: 0;
        padding: 20px;
        margin-bottom: 30px;
    }

    .contact-info {
        flex-direction: column;
        gap: 20px;
    }

    .infos img {
        width: 50px;
    }

    .infos {
        margin-top: 15px;
        margin-bottom: -20px;
    }

    .info1 {
        font-size: 20px;
    }

    .info2 {
        font-size: 18px;
    }

    .social-links img {
        margin-top: 40px;
        width: 35px;
    }


    .footer {
        font-size: 14px;
        padding: 10px 0;
    }

    .certificates-container {
        display: flex;
        flex-direction: column;
        padding: 0 10px;
        gap: 20px;
        min-height: auto;
        overflow: visible;
    }

    .certificates-container.is-open {
        gap: 25px;
    }

    .folders-sidebar {
        flex-direction: row !important;
        justify-content: center;
        gap: 38px;
        width: 100%;
        margin-top: 50px;
    }

    .certificates-container.is-open .folders-sidebar {
        flex-direction: row !important;
        margin-top: 70px;
        gap: 12px;
        width: 100%;
    }

    .folder-wrapper {
        padding: 0 !important;
    }

    .folder {
        width: 110px !important;
        height: 75px !important;
    }

    .folder-tab {
        width: 35px;
        height: 10px;
        top: -9px;
    }

    .folder-title {
        font-size: 9px;
    }

    .paper {
        height: 60px;
    }

    .paper i {
        font-size: 22px;
    }

    .lists-container {
        max-width: 100%;
        width: 100%;
    }

    .cert-list {
        padding: 25px;
        min-height: auto;
    }

    .list-title {
        font-size: 20px;
    }

    .cert-item {
        gap: 20px;
        padding: 18px;
    }

    .cert-info h4 {
        font-size: 14px;
    }

    .folder.active .paper-2,
    .folder:hover .paper-2 {
        transform: translateY(-60px) rotate(0deg);
    }

    .folder.active .paper-1,
    .folder:hover .paper-1 {
        transform: translate(-20px, -40px) rotate(-15deg);
    }

    .folder.active .paper-3,
    .folder:hover .paper-3 {
        transform: translate(20px, -40px) rotate(15deg);
    }
}

/* Medium devices (tablets, 577px to 768px) */
@media screen and (min-width: 577px) and (max-width: 768px) {
    .container {
        padding: 0 25px;
    }

    .logo {
        font-size: 28px;
    }

    .nav-menu {
        gap: 20px;
    }

    .nav-menu a {
        font-size: 15px;
    }

    .page1 {
        padding: 30px;
        margin-top: 80px;
    }

    .hello {
        font-size: 16px;
    }

    .allName {
        font-size: 30px;
    }

    .specialite {
        font-size: 18px;
    }

    .description {
        font-size: 17px;
        max-width: 340px;
    }

    .letsTalk {
        font-size: 14px;
        padding: 10px 30px;
    }

    .about {
        padding: 30px 40px;
    }

    .desc {
        font-size: 16px;
    }

    .burreau img {
        max-width: 350px;
    }

    .about {
        margin-top: 20px;
    }

    .about img {
        width: auto;
        height: 65%;
        margin-left: -40px;
        margin-top: 10px;
    }

    .TitreAbout {
        font-size: 36px;
    }

    .glass-card {
        width: 45%;
    }

    .about .TitreAbout {
        margin-bottom: 30px;
    }

    .desc {
        font-size: 17px;
    }

    .formulaire {
        flex: 70%;
    }

    .formInfos {
        gap: 5px;
        margin-right: 10px;
    }

    .info {
        padding: 10px;
    }

    .info span:first-child {
        font-size: 16px;
        min-width: 120px;
    }

    .info span:last-child {
        font-size: 15px;
    }

    .skills-container-glass {
        width: 100%;
        display: flex;
        flex-direction: row;
        gap: 30px;
    }

    .glass-card h3 {
        font-size: 20px;
    }

    .glass-skill-tag {
        font-size: 15px;
        padding: 5px 10px;
    }

    .project-card {
        width: 330px;
    }

    .carousel-btn {
        width: 35px;
        height: 35px;
    }

    .projects .carousel-indicators {
        margin-top: 0;
    }

    .projects .TitreAbout {
        margin-top: -30px;
        margin-bottom: -40px;
    }

    .TitreAbout::after {
        width: 100px;
    }

    .projects {
        margin: 0 30px;
    }

    .project-card {
        margin-top: 20px;
        max-width: 90%;
        width: 350px;
    }

    .project-image {
        height: 180px;
        width: 100%;
    }

    .project-title {
        font-size: 15px;
    }

    .project-description {
        font-size: 13px;
    }

    .tag {
        font-size: 11px;
        margin-bottom: -5px;
    }

    .btn-website {
        font-size: 13px;
    }

    .prev-btn-projects,
    .next-btn-projects {
        top: 40%;
        width: 35px;
        height: 35px;
    }

    .prev-btn-projects {
        left: -3%;
    }

    .next-btn-projects {
        right: -3%;
    }

    .projects .carousel-indicators {
        margin-top: 20px;
    }

    .project-card[data-pos="1"] {
        transform: translateX(200px) translateZ(-150px) rotateY(-20deg) scale(0.9);
    }

    .project-card[data-pos="-1"] {
        transform: translateX(-200px) translateZ(-150px) rotateY(20deg) scale(0.9);
    }

    .project-card[data-pos="2"] {
        transform: translateX(420px) translateZ(-320px) rotateY(-38deg) scale(0.7);
        z-index: 3;
        opacity: 0.5;
    }

    .project-card[data-pos="-2"] {
        transform: translateX(-420px) translateZ(-320px) rotateY(38deg) scale(0.7);
        z-index: 3;
        opacity: 0.5;
    }

    .projects-carousel {
        height: 550px;
    }

    .contactTout {
        padding: 20px;
        margin-bottom: 20px;
        padding-left: 0;
        padding-right: 80px;
    }

    .contact .TitreAbout {
        margin-bottom: 30px;
    }

    .photoContact img {
        flex: 30%;
        min-width: 80%;
        width: 190px;
        margin-right: -10px;
    }

    .contacts {
        width: 100%;
        margin-left: -30px;
        margin-right: 40px;
        padding: 20px;
    }

    .contacts input {
        padding: 10px;
        font-size: 12px;
    }

    .contact-info {
        gap: 20px;
    }

    .infos img {
        width: 40px;
        margin-top: 8px;
    }

    .info1 {
        font-size: 16px;
    }

    .info2 {
        font-size: 14px;
    }

    .social-links img {
        width: 35px;
        margin-bottom: -10px;
    }

    .footer {
        font-size: 16px;
    }

    /* Certificates logic for Tablets */
    .certificates-container {
        flex-direction: column;
        padding: 0 20px;
        gap: 30px;
        min-height: auto;
        align-items: center;
    }

    .certificates-container.is-open {
        align-items: center;
        gap: 30px;
    }

    .folders-sidebar {
        flex-direction: row !important;
        justify-content: center;
        gap: 20px;
        width: 100%;
        margin-bottom: 20px;
        margin-top: 50px;
    }

    .certificates-container.is-open .folders-sidebar {
        flex-direction: row !important;
        margin-top: 70px;
        gap: 20px;
        width: 100%;
    }

    .folder {
        width: 160px;
        height: 110px;
    }

    .lists-container {
        max-width: 100%;
        width: 100%;
    }

    .cert-list {
        padding: 30px;
        width: 100%;
    }
}

/* Large devices (laptops, 769px to 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 40px;
    }

    .logo {
        font-size: 35px;
    }

    .nav-menu {
        gap: 25px;
    }

    .nav-menu a {
        font-size: 19px;
    }

    .page1 {
        padding: 40px 60px;
        margin-top: 100px;
    }

    .hello {
        font-size: 24px;
    }

    .allName {
        font-size: 42px;
    }

    .specialite {
        font-size: 23px;
    }

    .description {
        font-size: 21px;
    }

    .letsTalk {
        font-size: 20px;
        padding: 10px 30px;
    }

    .about {
        padding: 40px 40px;
        padding-top: 5px;
    }

    .TitreAbout {
        font-size: 40px;
    }

    .about,
    .TitreAbout {
        margin-top: 40px;
    }

    .desc {
        font-size: 20px;
    }

    .info span:first-child {
        font-size: 22px;
        min-width: 180px;
    }

    .info span:last-child {
        font-size: 21px;
    }

    .formulaire {
        flex: 70%;
        margin-right: -20px;
    }

    .formInfos {
        gap: 10px;
    }

    .profil img {
        width: 140%;
        max-width: 300px;
        height: 88%;
        margin-left: -40px;
        margin-top: 40px;
    }

    .glass-card h3 {
        font-size: 22px;
    }

    .glass-skill-tag {
        font-size: 15px;
        padding: 10px 15px;
        border-radius: 18px;
    }

    .projects .container {
        margin-top: -45px;
    }

    .projects {
        padding-top: 120px;
    }

    .project-card {
        min-width: 350px;
    }

    .projects .carousel-indicators {
        margin-top: -60px;
    }

    .project-card[data-pos="1"] {
        transform: translateX(220px) translateZ(-180px) rotateY(-22deg) scale(0.88);
    }

    .project-card[data-pos="-1"] {
        transform: translateX(-220px) translateZ(-180px) rotateY(22deg) scale(0.88);
    }

    .project-card[data-pos="2"] {
        transform: translateX(400px) translateZ(-320px) rotateY(-38deg) scale(0.7);
        z-index: 3;
        opacity: 0.5;
    }

    .project-card[data-pos="-2"] {
        transform: translateX(-400px) translateZ(-320px) rotateY(38deg) scale(0.7);
        z-index: 3;
        opacity: 0.5;
    }

    .contactTout {
        padding: 0px;
        padding-top: 5px;
    }

    .photoContact img {
        /* max-width: 130%; */
        min-width: 110%;
        margin-right: -25%;
        margin-top: -30px;
    }

    .btn-website {
        margin-top: -10px;
    }

    .contacts {
        padding: 30px;
        flex: 60%;
        max-width: 750px;
        margin-right: 150px;
        margin-bottom: 30px;
    }

    .contact-form input {
        padding: 12px;
    }

    .infos img {
        width: 55px;
    }

    .info1 {
        font-size: 21px;
    }

    .info2 {
        font-size: 19px;
    }

    .social-links {
        margin-top: -10px;
        margin-bottom: -10px;
    }

    .social-links img {
        width: 45px;
    }

    .contact-info {
        gap: 40px;
    }

    .footer {
        font-size: 20px;
    }
}

/* Extra large devices (large desktops, 1025px to 1399px) */
@media screen and (min-width: 1025px) and (max-width: 1399.5px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }

    .page1 {
        padding: 40px 70px;
        margin: 30px;
        margin-right: 0;
        padding-top: 70px;
    }

    .about {
        padding: 40px 100px;
    }

    .about,
    .TitreAbout {
        margin-top: 10px;
    }

    .formulaire {
        flex: 60%;
    }

    .info span:first-child {
        min-width: 180px;
    }

    .profil img {
        max-width: 400px;
    }

    .skills-carousel {
        width: 72%;
    }

    .project-card {
        width: 420px;
    }

    .project-card[data-pos="1"] {
        transform: translateX(240px) translateZ(-180px) rotateY(-23deg) scale(0.9);
    }

    .project-card[data-pos="-1"] {
        transform: translateX(-240px) translateZ(-180px) rotateY(23deg) scale(0.9);
    }

    .photoContact img {
        max-width: 115%;
        margin-right: -22%;
    }

    .contacts {
        margin-right: 16%;
    }
}

/* Extra extra large devices (4K and above, 1400px and up) */
@media screen and (min-width: 1400px)and (max-width: 1919px) {

    /* Votre code original pour 1400px+ reste ici */
    /* (le code que vous avez déjà fourni) */
    .container {
        max-width: 1400px;
        margin: 0 auto;
    }

    .navbar {
        padding: 20px 100px;
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 1001;
    }

    .logo {
        font-size: 42px;
        margin-left: -100px;
        font-weight: bold;
    }

    .nav-menu a {
        font-size: 22px;
    }

    .page1 {
        margin: 40px auto;
        padding: 20px 80px;
        align-items: center;
        min-height: 400px;
        margin-top: 8%;
    }

    .burreau {
        flex: 1;
    }

    .burreau img {
        width: 100%;
        max-width: 830px;
    }

    .details {
        flex: 1;
    }

    .hello {
        font-weight: bold;
        font-size: 30px;
        margin: 0 0 10px 0;
    }

    .allName {
        font-weight: bold;
        font-size: 52px;
        margin: 0 0 28px 0;
    }

    .specialite {
        font-size: 29px;
        margin: 0;
    }

    .description {
        margin-bottom: 5%;
        font-size: 28px;
    }

    .letsTalk {
        padding: 16px 40px;
        font-size: 22px;
        transition: all 0.3s;
    }

    .about {
        display: flex;
        padding: 20px 140px;
        margin-top: 50px;
        gap: 30px;
        max-width: 100%;
        margin-left: 0;
    }

    .profil {
        display: flex;
        justify-content: center;
    }

    .about img {
        max-width: 350px;
        height: 88%;
        margin-left: -190px;
        margin-top: 50px;
    }

    .formulaire {
        flex: 70%;
        margin-right: -30px;
    }

    .TitreAbout {
        font-size: 50px;
    }

    .TitreAbout::after {
        content: '';
        bottom: -15px;
        left: 50%;
        width: 200px;
        height: 6px;
    }

    .desc {
        font-size: 26px;
        margin-bottom: 35px;
        padding-right: 20px;
    }

    .formInfos {
        gap: 10px;
    }

    .info {
        display: flex;
        padding: 14px 0;
        border-radius: 10px;
        padding-left: 30px;
    }

    .info span:first-child {
        font-size: 28px;
        font-weight: 600;
        min-width: 200px;
    }

    .info span:last-child {
        font-size: 26px;
        font-weight: 500;
    }

    /* Projects Section */
    .projetsPart {
        margin-top: 8%;
    }

    .projects {
        padding: 100px 0;
    }

    .projects .container {
        max-width: 100%;
        width: 100%;
        padding: 0;
        align-items: center;
        margin-bottom: -2%;
    }

    .projects .TitreAbout {
        margin-top: -100px;
        margin-bottom: 10px;
    }

    .projects-carousel {
        position: relative;
        height: 600px;
        width: 100%;
        margin: 40px 0;
        overflow: visible;
    }

    .projects-slider {
        position: relative;
        width: 100%;
        height: 100%;
        perspective: 2000px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .project-card {
        position: absolute;
        background-color: var(--card-bg);
        border-radius: 30px;
        overflow: hidden;
        width: 450px;
        transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: pointer;
        box-shadow: 5px 25px 40px rgba(141, 111, 73, 0.4);
    }

    .project-card:hover {
        box-shadow: 0 5px 25px var(--text-color);
    }

    /* 3D Carousel Positions */
    .project-card[data-pos="0"] {
        transform: translateX(0) translateZ(0) scale(1.1);
        z-index: 10;
        opacity: 1;
    }

    .project-card[data-pos="1"] {
        transform: translateX(280px) translateZ(-200px) rotateY(-25deg) scale(0.85);
        z-index: 4;
        opacity: 0.8;
    }

    .project-card[data-pos="-1"] {
        transform: translateX(-280px) translateZ(-200px) rotateY(25deg) scale(0.85);
        z-index: 4;
        opacity: 0.8;
    }

    .project-card[data-pos="2"] {
        transform: translateX(480px) translateZ(-350px) rotateY(-35deg) scale(0.7);
        z-index: 3;
        opacity: 0.5;
    }

    .project-card[data-pos="-2"] {
        transform: translateX(-480px) translateZ(-350px) rotateY(35deg) scale(0.7);
        z-index: 3;
        opacity: 0.5;
    }

    .project-card[data-pos="hidden"] {
        transform: translateX(0) translateZ(-500px) scale(0.5);
        z-index: 1;
        opacity: 0;
        pointer-events: none;
    }

    .project-image {
        width: 100%;
        height: 250px;
        object-fit: cover;
    }

    .project-info {
        padding: 25px;
        color: var(--bg-color);
    }

    .project-description {
        color: rgb(98, 98, 98);
        font-style: italic;
        margin-bottom: 15px;
    }

    .project-tags {
        display: flex;
        gap: 6px;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }

    .tag {
        background-color: transparent;
        border: 2px solid rgb(141, 111, 73);
        color: rgb(89, 69, 44);
        padding: 5px 5px;
        border-radius: 20px;
        font-size: 15px;
    }

    .project-buttons {
        display: flex;
        gap: 15px;
    }

    .btn-website {
        padding: 5px 20px;
        text-align: center;
        text-decoration: none;
        border-radius: 30px;
        font-weight: 600;
        transition: all 0.3s ease;
        font-size: 16px;
        border: 2px solid rgb(141, 111, 73);
        color: rgb(89, 69, 44);
        background: transparent;
        display: inline-block;
        min-width: 15%;
    }

    .btn-website:hover {
        background: rgb(212, 198, 179);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(141, 111, 73, 0.4);
    }

    .prev-btn-projects,
    .next-btn-projects {
        position: absolute;
        top: 50%;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        z-index: 101;
        background: rgb(217, 208, 197);
        border: none;
        width: 50px;
        height: 50px;
        border-radius: 50%;
    }

    .prev-btn-projects {
        left: 5%;
    }

    .next-btn-projects {
        right: 5%;
    }

    .prev-btn-projects:hover,
    .next-btn-projects:hover {
        box-shadow: 0 5px 15px rgb(141, 111, 73);
    }

    .prev-btn-projects svg,
    .next-btn-projects svg {
        width: 24px;
        height: 24px;
        stroke: var(--text-color);
    }

    .contact {
        margin-bottom: -20px;
    }

    .contacts {
        flex: 66%;
        margin-left: 0;
        margin-right: 18%;
        align-items: center;
        border: solid 1px var(--text-color);
        border-radius: 30px;
        padding: 2% 5%;
        box-shadow: 5px 5px 25px var(--text-color);
    }

    .contactTout {
        margin-top: -4%;
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        padding: 50px 0;
    }

    .photoContact {
        flex: 33%;
        display: flex;
        justify-content: flex-end;
        z-index: 2;
    }

    .photoContact img {
        max-width: 110%;
        min-width: 70%;
        height: auto;
        margin-right: -22%;
    }

    .contact-form {
        display: flex;
        flex-direction: column;
    }

    .contact-form input {
        border-radius: 15px;
        padding: 15px;
        border: none;
        padding-left: 18px;
        background-color: var(--card-bg);
    }

    #Message {
        height: 60px;
        min-height: 50px;
        max-height: 100px;
    }

    #submit-btn {
        background-color: var(--letstalk-bg);
        color: var(--letstalk-text);
        font-weight: bold;
        margin-bottom: 4%;
        transition: all 0.3s;
    }

    .contact-form input:hover {
        box-shadow: 5px 5px 15px var(--letstalk-text);
    }

    #submit-btn:hover {
        background-color: var(--lesttalk-hover-bg);
        transition: translateY(-2px);
        box-shadow: 5px 2px 15px var(--letstalk-text);
    }

    .contact-info {
        margin: 0 10%;
        text-align: center;
        display: flex;
        justify-content: center;
        margin-bottom: 1%;
        line-height: 1.4;
        gap: 60px;
    }

    .infos {
        margin-bottom: 20px;
        line-height: 1.4;
    }

    .infos img {
        width: 80px;
        border: 2px solid var(--text-color);
        border-radius: 50%;
        box-shadow: 1px 2px 20px var(--text-color);
        background-color: var(--card-bg);
    }

    .info1 {
        font-weight: bold;
        color: var(--accent-color);
        font-size: 160%;
    }

    .info2 {
        font-style: normal;
        color: var(--text-color);
        font-size: 140%;
    }

    .info2:hover {
        color: var(--lesttalk-hover-bg);
    }

    .social-links {
        display: flex;
        justify-content: center;
        gap: 20px;
    }

    .social-links img {
        align-items: center;
        width: 50px;
        border: 1px solid var(--text-color);
        border-radius: 50%;
        padding: 5px;
        background-color: var(--card-bg);
    }

    .social-links img:hover {
        box-shadow: 1px 2px 20px var(--text-color);
    }


    .footer {
        text-align: center;
        padding: 1px 0;
        color: var(--text-color);
        font-size: 20px;
        border-top: 1px solid var(--text-color);
        box-shadow: 5px 5px 25px var(--text-color);
        bottom: 0;
    }
}
@media screen and (min-width: 1795px)and (max-width: 1882px){
    .navbar{
        margin-left: -100px;
        padding-right: 0px;
    }
    .about{
        margin-left: 60px;
    }
    .glass-card{
        width: 25%;
    }

}
@media screen and (min-width: 1882px)and (max-width: 1919px){
    .navbar{
        margin-left: -130px;
        padding-right: 0px;
    }
    .about{
        margin-left: 60px;
    }
    .skills-container-glass{
        gap: 100px;
    }
    .glass-card{
        width: 23%;
    }
}

/* Pour les écrans très larges (2K, 4K) */
@media screen and (min-width: 1920px){
    .container {
        max-width: 4000px;
    }

    .logo {
        font-size: 76px;
        padding: 20px 50px;
    }

    .nav-menu a {
        font-size: 40px;
    }

    .navbar {
        width: 100%;
    }

    .page1 {
        padding: 280px 100px;
    }

    .burreau {
        margin-right: -40px;
    }

    .burreau img {
        max-width: 1200px;
    }

    .hello {
        font-size: 50px;
    }

    .allName {
        font-size: 80px;
    }

    .specialite {
        font-size: 45px;
    }

    .description {
        font-size: 50px;
        max-width: 1400px;
    }

    .letsTalk {
        font-size: 40px;
        padding: 30px 60px;
    }

    .about {
        padding: 180px 150px;
    }

    .TitreAbout {
        font-size: 85px;
    }

    .desc {
        font-size: 50px;
    }

    .about img {
        min-height: 1000px;
        margin-top: 140px;
    }

    .info {
        padding: 30px;
    }

    .info span:first-child {
        font-size: 50px;
    }

    .info span:last-child {
        font-size: 45px;
    }

    .glass-card {
        width: 30%;
        height: auto;
    }

    .card-icon {
        width: 240px;
        height: 240px;
    }

    .glass-card h3 {
        font-size: 50px;
        margin-bottom: 70px;
    }

    .glass-skill-tag {
        font-size: 36px;
        padding: 15px 30px;
        border-radius: 30px;
    }

    .projects {
        padding: 200px 0px;
    }

    .project-card {
        margin-top: 500px;
        height: 120%;
        border-radius: 40px;
    }

    .project-title {
        font-size: 50px;
        margin-top: 20px;
        margin-bottom: 30px;
    }

    .project-description {
        font-size: 35px;
        margin-bottom: 30px;
    }

    .project-image {
        width: 100%;
    }

    .tag {
        font-size: 30px;
        padding: 10px 25px;
        border-radius: 30px;
    }

    .btn-website {
        font-size: 35px;
        padding: 10px 25px;
    }

    .projects .carousel-indicators {
        margin-top: 200px;
    }

    .project-image {
        height: 300px;
    }

    .prev-btn-projects,
    .next-btn-projects {
        width: 100px;
        height: 100px;
        top: 80%;
    }

    .prev-btn-projects {
        left: 10%;
    }

    .next-btn-projects {
        right: 10%;
    }

    .projects .carousel-indicators {
        margin-top: 450px;
    }

    .contact {
        padding: 200px 0;
    }

    .contacts {
        padding: 60px;
        width: 90%;
    }

    .contact-form input {
        font-size: 30px;
        margin-bottom: 10px;
        padding: 20px;
        border-radius: 25px;
        padding-left: 70px;
    }

    #Message {
        padding: 70px;
    }

    .contactTout {
        padding-right: 500px;
        padding-bottom: 0;
        margin-bottom: -50px;
    }

    .contacts,
    .TitreAbout {
        margin-bottom: 150px;
    }

    .infos img {
        width: 120px;
    }

    .contact-info {
        gap: 100px;
    }

    .info1 {
        font-size: 45px;
    }

    .info2 {
        font-size: 40px;
    }

    .social-links img {
        margin-top: 30px;
        width: 90px;
    }

    .footer {
        font-size: 40px;
    }

    .photoContact img {
        width: 90%;
        margin-bottom: 170px;
        margin-right: -130px;
    }

}

/* --- Toast Notifications --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    padding: 15px 25px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: 500;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 5px solid #4CAF50;
}

.toast.error {
    border-left: 5px solid #f44336;
}

.toast i {
    font-size: 20px;
}

.toast.success i {
    color: #4CAF50;
}

.toast.error i {
    color: #f44336;
}

[data-theme="dark"] .toast {
    background: rgba(20, 20, 20, 0.8);
    color: #fff;
}