@import url('https://api.fontshare.com/v2/css?f[]=satoshi@700,500,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ===== RESET ET BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== VARIABLES CSS ===== */
:root {
    /* Nouvelle charte graphique */
    --background-main: #111111;
    --text-primary: #EAEAEA;
    --text-secondary: #888888;
    --accent-indigo: rgb(99, 102, 241);
    --gradient-accent: linear-gradient(135deg, var(--accent-indigo) 0%, #7c3aed 100%);
    --font-primary: 'Satoshi', sans-serif;
    --font-secondary: 'Inter', sans-serif;

    /* Mise à jour des anciennes variables pour assurer la compatibilité */
    --primary-blue: var(--accent-indigo);
    --secondary-blue: #6366f1; /* Conservé pour l'instant */
    --accent-blue: #3b82f6; /* Conservé pour l'instant */
    --dark-bg: var(--background-main);
    --section-dark: #1a1a1a;
    --card-dark: #2a2a2a;
    --text-white: var(--text-primary);
    --text-gray: var(--text-secondary);
    --border-gray: #374151;
    --gradient-blue: var(--gradient-accent);
    --gradient-hero: linear-gradient(135deg, var(--accent-indigo) 0%, #7c3aed 50%, #2563eb 100%);
}

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #111111;
    background-image: linear-gradient(180deg, #111111 0%, #191938 50%, #111111 100%);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
}

a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-indigo);
}


/* ===== HEADER ET NAVIGATION ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-gray);
    padding: 1rem 0;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-indigo);
}

.lang-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-switcher a {
    padding: 0.5rem 1rem;
    background: var(--card-dark);
    color: var(--text-white);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lang-switcher a.active,
.lang-switcher a:hover {
    background: var(--accent-indigo);
}

.lang-switcher-mobile {
    display: none; /* Caché par défaut sur desktop */
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
    width: 24px;
    height: 24px;
}

.nav-toggle .hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: background 0.2s 0.3s ease-in-out;
}

.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: top 0.3s 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.nav-toggle .hamburger::before {
    top: -8px;
}

.nav-toggle .hamburger::after {
    top: 8px;
}

.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
    transition: top 0.3s ease-in-out, transform 0.3s 0.3s ease-in-out;
}

.nav-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
    transition: top 0.3s ease-in-out, transform 0.3s 0.3s ease-in-out;
}

/* ===== SECTION HERO ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 8rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

/* Background animé WebGL */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-background canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Styles pour l'animation WebGL - gérés par JavaScript */

/* Overlay pour améliorer la lisibilité du texte */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.hero .description {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4rem;
    line-height: 1.7;
}

/* ===== CARTES HERO ===== */
.hero-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* grid-template-columns supprimé : Flexbox */
    gap: 1.5rem;
    margin-top: 4rem;
    max-width: 900px;
    width: 100%;
}

.hero-card {
    background: rgba(30, 30, 45, 0.5);
    cursor: pointer;
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.hero .hero-card:hover,
.hero .hero-card:active {
    transform: translateY(-10px);
    background: rgba(45, 45, 65, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.hero-card-icon {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.1);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hero-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-white);
}

/* Override : centrer les cartes Hero en Flexbox */
.hero-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-card {
    flex: 1 0 200px;
    max-width: 220px;
}

/* Override : centrer les blocs Services et Projets en Flexbox */
.services-grid,
.projects-grid {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center !important;
}

.service-card,
.project-card {
    flex: 0 0 280px; /* largeur fixe pour éviter l'étirement */
    width: 280px;
    max-width: 320px;
}

/* ===== SECTIONS GÉNÉRALES ===== */
.section {
    padding: 8rem 2rem;
    position: relative;
}

.section:not(.hero)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.section.dark {
    background: var(--section-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-white);
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== SECTION ABOUT ===== */

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    align-items: center;
    justify-content: center;
    justify-items: center;
}

.about-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-white);
}

.about-subtitle {
    font-size: 1.25rem;
    color: var(--accent-blue);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.about-description {
    font-size: 1.125rem;
    color: var(--text-gray);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.about-highlights {
    list-style: none;
}

.about-highlights li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-white);
    font-weight: 500;
}

.about-highlights li i {
    background: var(--primary-blue);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.about-text {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

/* ===== SECTION SERVICES ===== */

.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* grid-template-columns supprimé (Flexbox) */
    gap: 2rem;
}

.service-card {
    background: rgba(30, 30, 45, 0.5);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.service-card:hover {
    transform: translateY(-10px);
    background: rgba(45, 45, 65, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.service-card:hover .service-icon {
    background: var(--accent-indigo);
    color: var(--text-primary);
    transform: scale(1.1);
}

.service-icon {
    font-size: 2.5rem;
    margin: 0 auto 2rem;
    color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.1);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-white);
}

.service-card p {
    color: var(--text-gray);
    line-height: 1.6;
    text-align: left; /* Alignement gauche pour un rendu plus propre */
}

/* ===== SECTION PROJETS ===== */
.projects {
    background: var(--section-dark);
}

.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* grid-template-columns supprimé (Flexbox) */
    gap: 2rem;
}

.project-card {
    background: rgba(30, 30, 45, 0.5);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    transform: translateY(-5px);
    background: rgba(45, 45, 65, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.project-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.project-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    flex: 0 0 50px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.project-icon i {
    font-size: 1.5rem;
    color: var(--accent-indigo);
    transition: color 0.3s ease;
}

.project-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-white);
}

.project-card p {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tag {
    background: rgba(79, 70, 229, 0.2);
    color: var(--accent-blue);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Override : alignement central Project Cards */
.project-card {
    padding: 2.5rem 2rem;
    text-align: center;
}

.project-header {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.project-icon {
    margin: 0 auto 1rem;
}

.project-tags {
    justify-content: center;
}

/* ===== SECTION CONTACT ===== */

.contact-form {
    max-width: 700px;
    margin: 0 auto;
    background: rgba(30, 30, 45, 0.5);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    padding: 3rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-white);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: #222222;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-indigo);
    background: #272727;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 1rem 2.5rem;
    background: var(--accent-indigo);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-primary:hover {
    background: transparent;
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.2);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4rem 2rem 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    align-items: start;
}

.footer-section h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer-section p,
.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    line-height: 1.7;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 3.5rem;
    }

    .about-content {
        /* grid-template-columns supprimé : Flexbox */
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 6rem 1rem;
    }

    .nav {
        padding: 1.5rem 1rem;
    }

        .header.menu-active {
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom-color: transparent;
    }

    /* --- Menu Mobile --- */
    .nav-toggle {
        display: block;
    }
    
    .nav-toggle.active {
        position: fixed; /* Positionnement par rapport au viewport */
        top: 2.2rem; /* Aligné avec le padding du header */
        right: 1rem;
    }

    .nav-links {
        display: none; /* Caché par défaut */
    }

    .nav-links.active {
        display: flex;
        position: fixed;
        inset: 0;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        background: rgba(10, 10, 20, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        z-index: 1000;
    }

    .nav-links a {
        font-size: 1.75rem; /* Un peu plus grand pour le clic */
        font-weight: 500;
    }

    /* --- Sélecteur de langue --- */
    .lang-switcher-desktop {
        display: none;
    }

    .nav-links.active .lang-switcher-mobile {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-top: 1.5rem;
        font-size: 1.25rem;
    }

    .nav-links.active .lang-switcher-mobile span {
        color: var(--text-secondary);
    }
    
    /* --- Autres ajustements --- */
    .hero h1 {
        font-size: 2.5rem;
        text-align: center;
    }

    .hero .subtitle {
        font-size: 1.125rem;
        text-align: center;
    }
    
    .hero .description {
        text-align: center;
    }

    .hero-cards {
        /* grid-template-columns supprimé : Flexbox */
    }

    .services-grid,
    .projects-grid {
        display: block; /* Simplification en conteneur block */
    }

    .service-card,
    .project-card {
        width: 100%;
        max-width: 480px;
        margin-left: auto;   /* Centrage horizontal infaillible */
        margin-right: auto;  /* Centrage horizontal infaillible */
        margin-bottom: 2rem; /* Recrée l'espacement vertical */
    }

    .service-card:last-child,
    .project-card:last-child {
        margin-bottom: 0;
    }

    .footer-content {
        text-align: center;
    }

    .footer-section {
        margin: 0 auto;
    }
}

/* ===== ALERTES ===== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert i {
    font-size: 1.25rem;
}

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


/* ===== RESPONSIVE DESIGN ===== */

/* Tablettes */
@media (max-width: 768px) {
    .hero {
        padding: 6rem 1rem 3rem;
        min-height: 100vh;
    }
    
    .hero-video {
        object-fit: cover;
        object-position: center;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero .subtitle {
        font-size: 1.25rem;
    }
    
    .hero .description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-cards {
        /* grid-template-columns supprimé : Flexbox */
        gap: 1rem;
        margin-top: 2rem;
    }
    
    .hero-card {
        padding: 1.5rem 1rem;
    }
    
    .hero-card-icon {
        font-size: 2rem;
    }
    
    .hero-card h3 {
        font-size: 1rem;
    }
}

/* Mobiles */
@media (max-width: 480px) {
    .hero {
        padding: 5rem 1rem 2rem;
    }
    
    .hero h1 {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .hero .subtitle {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }
    
    .hero .description {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-cards {
        /* grid-template-columns supprimé : Flexbox */
        gap: 0.75rem;
        margin-top: 1.5rem;
    }
    
    .hero-card {
        padding: 1.25rem 0.75rem;
    }
    
    .hero-card-icon {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-card h3 {
        font-size: 0.9rem;
    }
    
    /* Optimisation vidéo pour mobile */
    .hero-video {
        object-fit: cover;
        object-position: center center;
        transform: scale(1.1); /* Légère mise à l'échelle pour éviter les bords noirs */
    }
}

/* Très petits écrans */
@media (max-width: 320px) {
    .hero {
        padding: 4rem 0.75rem 1.5rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero .subtitle {
        font-size: 1rem;
    }
    
    .hero .description {
        font-size: 0.85rem;
    }
    
    .hero-card {
        padding: 1rem 0.5rem;
    }
}

/* Optimisations pour les écrans haute résolution */
@media (min-width: 1200px) {
    .hero-video {
        object-fit: cover;
        object-position: center;
    }
}

/* Préférences utilisateur pour les animations */
@media (prefers-reduced-motion: reduce) {
    .hero-video {
        animation: none;
    }
    
    .hero-card {
        transition: none;
    }
    
    .hero-card:hover {
        transform: none;
    }
}


/* ===== RESPONSIVE DESIGN POUR BACKGROUND ANIMÉ ===== */
@media (max-width: 768px) {
    .element-1, .element-2, .element-3, .element-4, .element-5 {
        display: none;
    }
    
    .animated-bg {
        animation-duration: 6s;
    }
    
    .hero {
        padding: 6rem 1rem 3rem;
    }
    
    .hero-content {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .animated-bg {
        background: linear-gradient(45deg, 
            #1a1a2e 0%, 
            #16213e 50%, 
            #1a1a2e 100%);
        animation-duration: 4s;
    }
}

/* Optimisation pour les appareils avec préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    .animated-bg {
        animation: none;
        background: #16213e;
    }
    
    .element {
        animation: none;
        opacity: 0.3;
    }
}


/* ===== SECTION YOUTUBE ===== */
.youtube-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
}

.youtube-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23e2e8f0" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.youtube-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

.youtube-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.youtube-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.youtube-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.youtube-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.youtube-card:hover .youtube-thumbnail img {
    transform: scale(1.05);
}

.youtube-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.youtube-card:hover .youtube-play-button {
    background: rgba(255, 0, 0, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.youtube-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.youtube-info {
    padding: 1.5rem;
}

.youtube-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    height: 3em; /* Hauteur fixe pour 2 lignes */
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    hyphens: auto;
}

.youtube-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.youtube-date {
    color: var(--text-muted);
}

.youtube-watch-btn {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.youtube-watch-btn:hover {
    background: linear-gradient(135deg, #cc0000, #990000);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.youtube-watch-btn i {
    font-size: 0.875rem;
}

/* ===== MESSAGE AUCUNE VIDÉO ===== */
.no-videos {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-gray);
}

/* === YOUTUBE DARK THEME === */
.youtube-section {
    background: var(--dark-bg);
}

.youtube-section::before {
    background: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 4px 4px;
    opacity: 0.15;
}

.youtube-card {
    background: var(--card-dark);
    border: 1px solid rgba(79, 70, 229, 0.35);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
}

.youtube-card:hover {
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.25);
}

.youtube-card .youtube-title {
    color: var(--text-white);
}

.youtube-meta,
.youtube-date {
    color: var(--text-gray);
}

/* ===== POPUP VIDÉO ===== */
.youtube-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.youtube-popup.active {
    opacity: 1;
    visibility: visible;
}

.youtube-popup-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16/9;
    background: black;
    border-radius: 1rem;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.youtube-popup.active .youtube-popup-content {
    transform: scale(1);
}

.youtube-popup iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.youtube-popup-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.youtube-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .youtube-section {
        padding: 3rem 0;
    }
    
    .youtube-grid {
        /* grid-template-columns supprimé : Flexbox */
        gap: 1.5rem;
        margin-top: 2rem;
    }
    
    .youtube-card {
        margin: 0 1rem;
    }
    
    .youtube-thumbnail {
        height: 180px;
    }
    
    .youtube-play-button {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .youtube-popup-content {
        width: 95%;
        margin: 0 1rem;
    }
    
    .youtube-popup-close {
        top: -40px;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .youtube-info {
        padding: 1rem;
    }
    
    .youtube-title {
        font-size: 1rem;
    }
    
    .youtube-meta {
        font-size: 0.8rem;
    }
}

