:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --secondary-color: #1e40af;
  --accent-color: #06b6d4;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-light: #64748b;

  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;

  --border-color: #e2e8f0;
  --color-opacity: rgba(0, 0, 0, 0.1);

  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1),
            0 2px 4px -2px rgb(0 0 0 / 0.1);

  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1),
               0 8px 10px -6px rgb(0 0 0 / 0.1);

  --gradient: linear-gradient(135deg, #667eea 0%, #280f62 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);

  --swiper-pagination-color: var(--primary-color);
  --swiper-pagination-bullet-inactive-color: var(--text-secondary);
  --hover-shadow-color: rgba(99, 102, 241, 0.3);
}

body[data-theme="dark"] {
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-light: #94a3b8;

  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #334155;

  --border-color: #475569;
  --color-opacity: rgba(255, 255, 255, 0.1);
  --hover-shadow-color: rgba(147, 197, 253, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

:root { --header-h: 72px; }

html { scroll-behavior: smooth; }
:root { scroll-padding-top: var(--header-h); }

section[id] { scroll-margin-top: var(--header-h); }

/* accessibilite */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

[data-theme="dark"] nav {
    background: rgba(15, 23, 42, 0.95);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Language Switch */
.language-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
    background: var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
}

.language-switch:hover {
    border-color: var(--primary-color);
}

.language-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.language-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    border-radius: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.language-slider::before {
    content: '';
    position: absolute;
    height: 24px;
    width: 24px;
    left: 2px;
    background: var(--primary-color);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.language-switch input:checked + .language-slider::before {
    transform: translateX(28px);
    background: var(--accent-color);
}

.language-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    z-index: 2;
    transition: color 0.3s ease;
    padding: 0 4px;
}

.language-label.en {
    margin-left: 2px;
}

.language-label.fr {
    margin-right: 2px;
}

.language-switch input:not(:checked) + .language-slider .language-label.en {
    color: var(--bg-primary);
}

.language-switch input:checked + .language-slider .language-label.fr {
    color: var(--bg-primary);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.6s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: white;
    color: var(--secondary-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* Section Styles */
section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about {
    background: var(--bg-secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    text-align: justify;
}

.about-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 1.5rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ====== Timeline (mise en page en lignes miroir) ====== */
.timeline.mirrored {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
  isolation: isolate;
}

/* Barre centrale */
.timeline.mirrored::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  background: var(--border-color);
  z-index: 1;
}

/* Une ligne (row) = 2 colonnes (gauche/droite) */
.timeline-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 3rem 0;
  z-index: 2;
  align-items: start;
}

/* Pastille au centre pour chaque ligne */
.timeline-row::after {
  content: "";
  position: absolute;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 4px solid var(--bg-primary);
  z-index: 3;
}

/* Colonnes */
.timeline-col { position: relative; }

/* Cartes texte */
.timeline-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform .3s ease;
}
.timeline-card:hover { transform: translateY(-2px); }

.timeline-date    { color: var(--accent-color); font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
.timeline-title   { font-size: 1.4rem; font-weight: 700; margin-bottom: .5rem; }
.timeline-company { color: var(--primary-color); font-weight: 600; margin-bottom: 1rem; }
.timeline-description { color: var(--text-secondary); line-height: 1.6; text-align: justify; }

/* Media (image) */
.timeline-media {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: block;
  height: auto;
  align-self: start;
}

/* hauteur homogene des images, sans etirer le conteneur */
.timeline-media img {
  display: block;
  width: 100%;
  height: auto;              /* <-- image selon son contenu, pas 100% de la colonne */
  aspect-ratio: 16/9;        /* homogeneise la hauteur perçue */
  object-fit: cover;
  max-height: 320px;
}

/* Utilitaire : visible desktop only */
.only-desktop { display: block; }

/* =========================
   Responsive (<= 992px)
   ========================= */
@media (max-width: 992px) {
  /* position de l’axe + taille de la gouttiere à gauche */
  .timeline.mirrored { --axis-x: 1.1rem; --axis-gutter: 2.9rem; }

  /* axe colle à gauche */
  .timeline.mirrored::before {
    left: var(--axis-x);
    width: 2px;
  }

  /* une seule colonne + place pour la pastille */
  .timeline-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 2rem 0;
    padding-left: var(--axis-gutter);   /* espace pour l’axe + pastille */
  }

  /* pastille alignee sur l’axe, un peu plus haut pour degager la date */
  .timeline-row::after {
    left: var(--axis-x);
    top: .75rem;
    width: 12px;
    height: 12px;
    border-width: 3px;
  }

  /* un peu d’air à gauche dans la carte */
  .timeline-card { padding-left: 1.6rem; }

  /* Cacher TOUT media en responsive */
  .only-desktop,
  .timeline-media { display: none !important; }
}


/* Skills Section */
.skills {
    background: var(--bg-secondary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.skill-category h3 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Contact Section */
.contact {
    background: var(--gradient);
    color: white;
}

.contact-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contact h2 {
    color: white;
    margin-bottom: 1rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 1rem 2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.contact-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Cacher sur telephone (<= 800px) */
@media (max-width: 800px) {
    .back-to-top {
        display: none !important;
    }
}

/* Achievements Section */

/* .achievements {
    background: var(--bg-secondary);
} */

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.achievement-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    will-change: transform;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
}

.achievement-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.achievement-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    position: relative;
}

.achievement-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: var(--gradient-accent);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.achievement-card:hover .achievement-icon::after {
    opacity: 1;
}

.achievement-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.achievement-category {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.achievement-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.achievement-date {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.achievement-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}



/* Footer */
footer {
    background: var( --bg-primary);
    color: var(--text-primary);
    text-align: center;
    padding: 2rem 0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 964px) {
    .nav-links {
        display: none;
    }

    .language-switch {
        width: 50px;
        height: 28px;
    }

    .language-slider::before {
        height: 20px;
        width: 20px;
    }

    .language-switch input:checked + .language-slider::before {
        transform: translateX(22px);
    }

    .language-label {
        font-size: 9px;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        justify-content: center;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .container, .nav-container {
        padding: 1rem 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .achievement-card {
        padding: 1.5rem;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

/* Scroll animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
    opacity: 1 !important;
    transform: none !important;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* projects */
.projects {
    background: var(--bg-secondary);
}

.wrapper {
    max-width: 1100px;
    padding: 0px 10px;
    margin: 0 60px 35px;
    overflow: hidden;
}

.wrapper .card {
    height: auto;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.wrapper .card:hover {
    transform: translateY(-10px);
}

.card .card-image {
    position: relative;
}

.card .card-footer .card-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px var(--hover-shadow-color);
}

.card .card-image img {
    width: 100%;
    height: auto;
    border-radius: 22px;
    padding: 10px;
    display: block;
    max-width: 100%;
    object-fit: contain;
}

.card .card-image video {
    width: 100%;
    border-radius: 22px;
    padding: 10px;
    aspect-ratio: 16/9;
    object-fit: cover;
}


.card .card-image {
    position: relative;
}

.card .card-image .card-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    border-radius: 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    font-size: 0.6rem;
    padding: 5px 12px;
    background: var(--accent-color);
    z-index: 2;
    max-width: 90%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

/* Responsive : ajuster un peu la taille sur petits ecrans */
@media (max-width: 800px) {
    .card .card-image .card-tag {
        font-size: 0.55rem;
        padding: 4px 10px;
        top: 8px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .card .card-image .card-tag {
        font-size: 0.5rem;
        padding: 3px 8px;
        top: 5px;
        right: 5px;
    }
}

.card .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 25px 25px;
}

.card .card-content .card-title {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
    text-align: center;
}

.card .card-content .card-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

.card .card-content .card-footer {
    display: flex;
    align-items: center;
    padding-top: 15px;
    margin-top: auto;
    justify-content: space-between;
    border-top: 1px solid var(--color-opacity);
}

.card .card-footer .card-button {
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.81rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--primary-color);
    box-shadow: var(--shadow) ;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.card .card-footer .card-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(99, 102, 241, 0.3) ;
}

.wrapper .swiper-pagination-bullet {
    height: 15px;
    width: 150px;
    overflow: hidden;
    opacity: 1;
    background: white;
}

.wrapper .swiper-pagination-bullet-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: var(--primary-hover);
    transform: scaleX(0);
    transform-origin: left center;
    animation: autoplay-loading 3s linear forwards;
}

@keyframes autoplay-loading {
    100% {
        transform: scaleX(1);
    }
}

.wrapper :where(.swiper-button-prev, .swiper-button-next) {
    color: white;
    margin-top: -35px;
    transition: all 0.3s ease;
}

.wrapper :where(.swiper-button-prev, .swiper-button-next):hover {
    color: var(--bg-secondary);
}

/* === SWIPER === */
/* Conteneur principal swiper */
.swiper {
    width: 100%;
    max-width: none;
    padding: 60px 0;
    margin: 0 auto;
}

/* Wrapper Swiper */
.swiper-wrapper {
    display: flex;
    align-items: stretch;
}

/* Slide swiper : il doit prendre toute la largeur */
.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100% !important;
    flex-shrink: 0;
}


/* Carte */
.card {
    background-color: var(--bg-secondary);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 1000px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease;
}

/* Image de la carte */
.card-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card:hover {
    transform: scale(1.02);
}

/* Responsive pour mobile */
@media screen and (max-width: 800px) {
    .card {
        max-width: 90%;
    }

    .swiper-button-prev,
    .swiper-button-next {
        display: none;
    }
}

/* === Modal Styles === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 25px;
    border-radius: 20px;
    max-width: 90vw;
    max-height: 90vh;
    width: 1000px;
    height: 1000px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    animation: modalSlideIn 0.3s ease forwards;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    margin: 0;
}


/* 🟦 CONTENEUR POUR FOND FLOU + BLOQUER SCROLL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid var(--color-opacity);
    position: relative;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-tag {
    display: inline-block;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    cursor: default;
}

.modal-body {
    padding: 40px 30px 30px 30px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Custom scrollbar for modal body */
.modal-body::-webkit-scrollbar {
    width: 8px;
}
.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 25px;
    opacity: 0.95;
}

.modal-details {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.modal-details h4 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.modal-details ul {
    list-style: none;
    padding: 0;
}

.modal-details li {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-opacity);
    display: flex;
    justify-content: space-between;
}

.modal-details li:last-child {
    border-bottom: none;
}

.competences-section {
    margin-top: 2rem;
}

.competences-section h3 {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.competences-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.competences-table th,
.competences-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.competences-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.competences-table tbody tr:hover {
    background-color: var(--hover-bg);
}

/* Large ecrans : largeur des colonnes + lisibilite */
@media (min-width: 769px){
  .competences-table th:nth-child(1),
  .competences-table td:nth-child(1){ width: 28%; }
  .competences-table th:nth-child(2),
  .competences-table td:nth-child(2){ width: 47%; }
  .competences-table th:nth-child(3),
  .competences-table td:nth-child(3){ width: 25%; }
}

/* Mobile: le tableau devient des cartes empilees */
@media (max-width: 800px){
  .competences-table thead{ display:none; }
  .competences-table,
  .competences-table tbody,
  .competences-table tr,
  .competences-table td{
    display:block;
    width:100%;
  }

  .competences-table tr{
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--color-opacity);
  }

  .competences-table td{
    border:0;
    padding:8px 0;
  }

  /* Petit label avant chaque valeur */
  .competences-table td::before{
    content: attr(data-label);
    display:block;
    font-weight:600;
    color: var(--accent-color);
    margin-bottom:4px;
  }
}

/* Liste des tags (tech stack) */
.modal-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 22px;
}

/* Style des pills façon capture */
.tech-item {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: .95rem;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.02);
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}

.tech-item:hover {
  transform: translateY(-1px);
  background: var(--hover-bg);
  border-color: var(--primary-color);
}

.tech-item.is-active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}


.modal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: white;
    background: rgba(0,0,0,0.3);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    z-index: 1100;
    transition: background 0.2s;
}

.modal-arrow:hover {
    background: rgba(0,0,0,0.6);
}

.modal-arrow-left {
    left: 15px;
}

.modal-arrow-right {
    right: 15px;
}



/* Position par defaut (ecran large) */
.close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-opacity);
    z-index: 9999;
}

/* Adaptation responsive */
@media (max-width: 800px) {
    .close {
        top: 1px;
        right: 10px;
        font-size: 24px;
        width: 30px;
        height: 30px;
    }
}
.close:hover {
    background: var(--color-opacity);
    transform: rotate(90deg);
}

/* === Responsive === */
@media (max-width: 800px) {
    .modal-content {
        width: 95vw;
        height: 95vh;
        border-radius: 0.5rem;
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }

    .modal-title {
        font-size: 1.5rem;
    }
}

#modalImage {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    margin: 10px auto;
}

.modal-content img {
    display: block;
    margin: 10px auto;
    max-width: 50%;
    height: auto;
    border: 1px solid #ccc;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}


