/* ===== Variables CSS ===== */
:root {
    --primary-color: #18214c;
    --accent-color: #31a26e;
    --text-dark: #3c4258;
    --text-light: #999fb3;
    --white: #ffffff;
    --bg-light: #f8f9fa;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow-lg);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
}

.logo-img {
    height: 80px;
    width: auto;
    border-radius: 50%;
    transition: var(--transition);
}

.navbar.scrolled .logo-img {
    height: 40px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--white);
    font-weight: 400;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a3a6b 100%);
    color: var(--white);
    text-align: center;
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 2rem;
}

.hero-logo {
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease;
    display: flex;
    justify-content: center;
    width: 390px;
    height: 390px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    background-image: url('../images/logo_MDIY3D.png');
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.8;
    animation: fadeInUp 1.2s ease;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1.4s ease;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid var(--white);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    animation: fadeIn 2s ease;
}

.scroll-indicator span {
    width: 6px;
    height: 10px;
    background-color: var(--white);
    border-radius: 3px;
    margin-top: 8px;
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0%, 100% {
        transform: translateY(0);
        opacity: 0;
    }
    50% {
        transform: translateY(15px);
        opacity: 1;
    }
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: transparent;
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(49, 162, 110, 0.3);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--white);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-view {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 10px 25px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-view:hover {
    background-color: var(--white);
    color: var(--primary-color);
    transform: scale(1.05);
}

/* ===== Sections ===== */
section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.title-underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    margin: 0 auto 20px;
    border-radius: 2px;
}

.section-description {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== About Section ===== */
.about {
    background-color: var(--bg-light);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.about-text p {
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.about-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Animation de l'imprimante 3D - Version Finale Corrigée */
.printer-animation {
    width: 100%;
    max-width: 420px;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    perspective: 1200px;
}

.printer-frame {
    width: 300px;
    height: 380px;
    position: relative;
    transform: rotateY(-8deg) rotateX(3deg);
    transition: transform 0.4s ease;
}

/* ===== SOCLE (en bas) ===== */
.printer-base {
    position: absolute;
    width: 280px;
    height: 55px;
    background: linear-gradient(180deg, #3a4575 0%, #2d3561 30%, #18214c 100%);
    border-radius: 12px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: inset 0 2px 5px rgba(255,255,255,0.1), inset 0 -2px 10px rgba(0,0,0,0.5), 0 10px 30px rgba(0,0,0,0.4);
    z-index: 1;
}

.led-indicator {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    top: 18px;
}

.led-power {
    background: #00ff00;
    left: 25px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

.led-status {
    background: #ff6b35;
    left: 42px;
    animation: statusBlink 2s ease-in-out infinite;
}

@keyframes statusBlink {
    0%, 45%, 55%, 100% { opacity: 1; box-shadow: 0 0 12px rgba(255, 107, 53, 0.9); }
    50% { opacity: 0.3; box-shadow: 0 0 5px rgba(255, 107, 53, 0.3); }
}

.base-logo {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    font-weight: 700;
    color: rgba(255, 107, 53, 0.6);
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(255, 107, 53, 0.3);
}

/* ===== BARRES VERTICALES reliées au socle ===== */
.frame-left,
.frame-right {
    position: absolute;
    width: 12px;
    height: 270px;
    background: linear-gradient(90deg, #1a1f3a 0%, #2d3561 50%, #1a1f3a 100%);
    border-radius: 6px;
    bottom: 47px;
    box-shadow: inset 2px 0 5px rgba(255,255,255,0.1), inset -2px 0 5px rgba(0,0,0,0.5), 0 5px 20px rgba(0,0,0,0.3);
    z-index: 0;
}

.frame-left { left: 16px; }
.frame-right { right: 16px; }

/* Connecteurs à la base */
.frame-connector {
    position: absolute;
    width: 16px;
    height: 12px;
    background: #2d3561;
    bottom: -5px;
    left: -2px;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

/* Barre supérieure */
.frame-top {
    position: absolute;
    width: calc(100% - 40px);
    height: 16px;
    background: linear-gradient(180deg, #3a4575 0%, #2d3561 50%, #1a1f3a 100%);
    border-radius: 8px;
    top: 50px;
    left: 20px;
    box-shadow: inset 0 2px 5px rgba(255,255,255,0.1), inset 0 -2px 5px rgba(0,0,0,0.5), 0 5px 20px rgba(0,0,0,0.3);
    z-index: 3;
}

/* Moteurs */
.motor {
    position: absolute;
    width: 22px;
    height: 22px;
    background: radial-gradient(circle, #4a5575 0%, #2d3561 70%);
    border-radius: 4px;
    top: -3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.motor::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #1a1f3a;
    border-radius: 50%;
    top: 6px;
    left: 6px;
    animation: motorRotate 2s linear infinite;
}

@keyframes motorRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.motor-left { left: -6px; }
.motor-right { right: -6px; }

/* Tiges de guidage chromées */
.guide-rod {
    position: absolute;
    width: 5px;
    height: 270px;
    background: linear-gradient(90deg, #b8b8b8 0%, #e0e0e0 50%, #b8b8b8 100%);
    border-radius: 2.5px;
    bottom: 50px;
    box-shadow: inset 1px 0 2px rgba(0,0,0,0.3), inset -1px 0 2px rgba(255,255,255,0.3);
    z-index: 0;
}

.guide-rod-left { left: 30px; }
.guide-rod-right { right: 30px; }

/* ===== ROULEAU DE FILAMENT (caché) ===== */
.filament-spool {
    display: none;
}

/* ===== AXE X avec TÊTE D'IMPRESSION ===== */
.x-axis {
    position: absolute;
    width: calc(100% - 50px);
    height: 12px;
    background: linear-gradient(180deg, #4a5575 0%, #2d3561 100%);
    border-radius: 6px;
    left: 25px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    z-index: 5;
    /* Animation: monte puis fait couche */
    animation: xAxisLayerByLayer 32s ease-in-out infinite;
}

@keyframes xAxisLayerByLayer {
    /* Chaque couche : gauche->droite puis monte */
    0%, 100% { top: 250px; }    /* Couche 1 */
    12% { top: 250px; }
    13%, 24% { top: 240px; }     /* Couche 2 */
    25%, 36% { top: 230px; }     /* Couche 3 */
    37%, 48% { top: 220px; }     /* Couche 4 */
    49%, 60% { top: 210px; }     /* Couche 5 */
    61%, 72% { top: 200px; }     /* Couche 6 */
    73%, 84% { top: 190px; }     /* Couche 7 */
    85%, 96% { top: 180px; }     /* Couche 8 (sommet) - reste au sommet puis efface */
    97%, 100% { top: 250px; }   /* Retour position initiale */
}

/* Tête d'impression avec buse collée */
.print-head {
    position: absolute;
    width: 55px;
    height: 60px;
    left: 50%;
    top: -12px;
    transform: translateX(-50%);
    /* Mouvement gauche-droite pendant chaque couche */
    animation: headLeftRight 4s ease-in-out infinite;
}

@keyframes headLeftRight {
    0%, 100% { left: 30%; }
    50% { left: 70%; }
}

/* Ventilateur */
.cooling-fan {
    position: absolute;
    width: 22px;
    height: 22px;
    background: radial-gradient(circle, #333 30%, #555 100%);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.cooling-fan::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 45%, #222 45%, #222 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, #222 45%, #222 55%, transparent 55%);
    border-radius: 50%;
    animation: fanSpin 0.4s linear infinite;
}

@keyframes fanSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Corps extrudeuse */
.extruder-body {
    position: absolute;
    width: 42px;
    height: 30px;
    left: 50%;
    top: 5px;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 50%, #d45420 100%);
    border-radius: 8px;
    box-shadow: inset -2px -2px 5px rgba(0,0,0,0.3), inset 2px 2px 5px rgba(255,255,255,0.2), 0 4px 15px rgba(255, 107, 53, 0.4);
}

/* Dissipateur */
.heat-sink {
    position: absolute;
    width: 28px;
    height: 7px;
    background: repeating-linear-gradient(90deg, #888 0px, #888 2px, #666 2px, #666 4px);
    left: 50%;
    top: 35px;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Buse collée sous la tête */
.nozzle {
    position: absolute;
    width: 14px;
    height: 20px;
    background: linear-gradient(180deg, #444 0%, #222 100%);
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 50% 50%;
    box-shadow: 0 3px 8px rgba(0,0,0,0.5);
}

.nozzle-tip {
    position: absolute;
    width: 10px;
    height: 3px;
    background: linear-gradient(90deg, #ff4500, #ff6b35, #ff4500);
    top: 5px;
    left: 2px;
    border-radius: 1px;
    animation: nozzleGlow 1s ease-in-out infinite;
}

@keyframes nozzleGlow {
    0%, 100% { opacity: 0.7; box-shadow: 0 0 5px rgba(255, 107, 53, 0.5); }
    50% { opacity: 1; box-shadow: 0 0 12px rgba(255, 107, 53, 0.9); }
}

/* ===== PLATEAU FIXE ===== */
.print-bed {
    position: absolute;
    width: 200px;
    height: 12px;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.bed-surface {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #d8d8d8 50%, #c8c8c8 100%);
    border-radius: 5px;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.5), inset 0 -1px 3px rgba(0,0,0,0.3), 0 3px 15px rgba(0,0,0,0.2);
    position: relative;
}

.bed-grid {
    position: absolute;
    width: 95%;
    height: 95%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-image:
        repeating-linear-gradient(0deg, rgba(0,0,0,0.05) 0px, rgba(0,0,0,0.05) 1px, transparent 1px, transparent 10px),
        repeating-linear-gradient(90deg, rgba(0,0,0,0.05) 0px, rgba(0,0,0,0.05) 1px, transparent 1px, transparent 10px);
}

/* ===== SAPIN EN IMPRESSION ===== */
.printing-tree {
    position: absolute;
    width: 100px;
    height: 140px;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
}

.tree-layer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #228B22 0%, #32CD32 50%, #00FF00 100%);
    border-radius: 2px;
    opacity: 0;
    transform-origin: bottom center;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.2), 0 2px 5px rgba(0,0,0,0.3);
}

/* Base carrée */
.tree-base { bottom: 0; width: 45px; height: 8px; animation: treePrintBase 32s ease-in-out infinite; }
/* Tronc */
.tree-trunk { bottom: 8px; width: 18px; height: 12px; animation: treePrintTrunk 32s ease-in-out infinite; }
/* Niveaux du sapin (pyramide) */
.tree-level-1 { bottom: 20px; width: 60px; height: 8px; animation: treePrintL1 32s ease-in-out infinite; }
.tree-level-2 { bottom: 28px; width: 50px; height: 8px; animation: treePrintL2 32s ease-in-out infinite; }
.tree-level-3 { bottom: 36px; width: 40px; height: 8px; animation: treePrintL3 32s ease-in-out infinite; }
.tree-level-4 { bottom: 44px; width: 30px; height: 8px; animation: treePrintL4 32s ease-in-out infinite; }
.tree-level-5 { bottom: 52px; width: 20px; height: 8px; animation: treePrintL5 32s ease-in-out infinite; }
/* Sommet (étoile/pointe) */
.tree-top { bottom: 60px; width: 12px; height: 10px; border-radius: 50% 50% 0 0; animation: treePrintTop 32s ease-in-out infinite; }

/* Animations pour chaque couche avec apparition/disparition synchronisée */
@keyframes treePrintBase {
    0%, 12% { opacity: 0; transform: translateX(-50%) scaleY(0); }
    13%, 93% { opacity: 1; transform: translateX(-50%) scaleY(1); }
    94%, 100% { opacity: 0; transform: translateX(-50%) scaleY(0); }
}

@keyframes treePrintTrunk {
    0%, 24% { opacity: 0; transform: translateX(-50%) scaleY(0); }
    25%, 93% { opacity: 1; transform: translateX(-50%) scaleY(1); }
    94%, 100% { opacity: 0; transform: translateX(-50%) scaleY(0); }
}

@keyframes treePrintL1 {
    0%, 36% { opacity: 0; transform: translateX(-50%) scaleY(0); }
    37%, 93% { opacity: 1; transform: translateX(-50%) scaleY(1); }
    94%, 100% { opacity: 0; transform: translateX(-50%) scaleY(0); }
}

@keyframes treePrintL2 {
    0%, 48% { opacity: 0; transform: translateX(-50%) scaleY(0); }
    49%, 93% { opacity: 1; transform: translateX(-50%) scaleY(1); }
    94%, 100% { opacity: 0; transform: translateX(-50%) scaleY(0); }
}

@keyframes treePrintL3 {
    0%, 60% { opacity: 0; transform: translateX(-50%) scaleY(0); }
    61%, 93% { opacity: 1; transform: translateX(-50%) scaleY(1); }
    94%, 100% { opacity: 0; transform: translateX(-50%) scaleY(0); }
}

@keyframes treePrintL4 {
    0%, 72% { opacity: 0; transform: translateX(-50%) scaleY(0); }
    73%, 93% { opacity: 1; transform: translateX(-50%) scaleY(1); }
    94%, 100% { opacity: 0; transform: translateX(-50%) scaleY(0); }
}

@keyframes treePrintL5 {
    0%, 84% { opacity: 0; transform: translateX(-50%) scaleY(0); }
    85%, 93% { opacity: 1; transform: translateX(-50%) scaleY(1); }
    94%, 100% { opacity: 0; transform: translateX(-50%) scaleY(0); }
}

@keyframes treePrintTop {
    0%, 90% { opacity: 0; transform: translateX(-50%) scaleY(0); }
    91%, 93% { opacity: 1; transform: translateX(-50%) scaleY(1); }
    94%, 100% { opacity: 0; transform: translateX(-50%) scaleY(0); }
}

/* ===== Services Section ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.service-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.service-icon svg {
    width: 40px;
    height: 40px;
}

.service-card h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-light);
    line-height: 1.7;
}

/* ===== Projects Section ===== */
.projects {
    background-color: var(--bg-light);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 25px;
    border: 2px solid var(--accent-color);
    background-color: transparent;
    color: var(--accent-color);
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--accent-color);
    color: var(--white);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-card.hide {
    display: none;
}

.project-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(24, 33, 76, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-info {
    padding: 25px;
}

.project-info h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 15px;
}

.project-tag {
    display: inline-block;
    padding: 5px 15px;
    background-color: rgba(49, 162, 110, 0.1);
    color: var(--accent-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== Contact Section ===== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-info h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.contact-info p {
    color: var(--text-dark);
    margin-bottom: 30px;
    line-height: 1.8;
}

.contact-items {
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
}

.contact-icon svg {
    width: 24px;
    height: 24px;
}

.contact-item h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.contact-item p {
    color: var(--text-light);
    margin: 0;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
}

.social-links a:hover {
    transform: translateY(-3px);
    background: var(--accent-color);
}

.social-links svg {
    width: 20px;
    height: 20px;
}

.contact-form {
    background: var(--bg-light);
    padding: 40px;
    border-radius: 15px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.contact-form .btn-primary {
    width: 100%;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px;
}

.contact-form .btn-primary:hover {
    background-color: #2a3a6b;
    transform: translateY(-2px);
}

/* ===== Footer ===== */
.footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 20px;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.footer-section ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
    overflow: auto;
}

.modal-content {
    position: relative;
    background-color: var(--white);
    margin: 5% auto;
    padding: 40px;
    width: 90%;
    max-width: 800px;
    border-radius: 15px;
    animation: slideDown 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    font-weight: 300;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--primary-color);
}

/* ===== Carousel dans la modal ===== */
.carousel-container {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.carousel-main-image {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--bg-light);
}

.carousel-main-image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 500px;
    object-fit: contain;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.carousel-btn:hover {
    background-color: var(--white);
    box-shadow: var(--shadow-lg);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== Miniatures du carousel ===== */
.carousel-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    margin-top: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-light);
}

.carousel-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.carousel-thumbnails::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 3px;
}

.carousel-thumbnails::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.carousel-thumbnails::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.thumbnail {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition);
    position: relative;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail:hover {
    border-color: var(--secondary-color);
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--primary-color);
}

.thumbnail.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(24, 33, 76, 0.2);
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* ===== Responsive Design ===== */
@media (max-width: 968px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--primary-color);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
        padding: 30px 0;
        z-index: 999;
        gap: 0;
        margin: 0;
    }

    .nav-menu li {
        width: 100%;
        padding: 15px 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
        position: relative;
        z-index: 1001;
        cursor: pointer;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Carousel responsive */
    .modal-content {
        padding: 30px 20px;
        margin: 10% auto;
        width: 95%;
    }

    .carousel-main-image img {
        max-height: 300px;
    }

    .carousel-btn {
        width: 35px;
        height: 35px;
    }

    .carousel-btn svg {
        width: 18px;
        height: 18px;
    }

    .carousel-prev {
        left: 5px;
    }

    .carousel-next {
        right: 5px;
    }

    .carousel-counter {
        font-size: 0.8rem;
        padding: 4px 10px;
        bottom: 10px;
        right: 10px;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .stat-number {
        font-size: 2rem;
    }

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

@media (max-width: 640px) {
    .hero-logo {
        width: 280px;
        height: 280px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .section-title {
        font-size: 2rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .filter-buttons {
        flex-direction: column;
        align-items: center;
    }

    .filter-btn {
        width: 100%;
        max-width: 200px;
    }

    .modal-content {
        padding: 30px 20px;
        margin: 10% auto;
    }

    .contact-form {
        padding: 30px 20px;
    }
}
