/* ============================================= */
/* Variables CSS (Thèmes)                        */
/* ============================================= */
:root {
    --primary: #7c3aed;
    --primary-dark: #5b21b6;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --gray: #6b7280;
    --white: #ffffff;
    --bg-main: #ffffff;
    --text-main: #333;
    --card-bg: #ffffff;
}

[data-theme="dark"] {
    --dark: #f8f9fa;
    --light: #1a1a2e;
    --white: #1a1a2e;
    --bg-main: #0f0f1a;
    --text-main: #e5e7eb;
    --card-bg: #1e1e2e;
    --gray: #9ca3af;
}

/* ============================================= */
/* Styles Globaux & Reset                        */
/* ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-main);
    position: relative;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ============================================= */
/* Fond animé                                    */
/* ============================================= */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -2;
    opacity: 0.03;
}

.bg-circles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, rgba(124, 58, 237, 0.05) 50%, transparent 100%);
    animation: float 20s infinite ease-in-out;
}

.circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.circle:nth-child(2) {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 15%;
    animation-delay: 5s;
    animation-duration: 30s;
}

.circle:nth-child(3) {
    width: 400px;
    height: 400px;
    bottom: 10%;
    left: 50%;
    animation-delay: 10s;
    animation-duration: 35s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    25% {
        transform: translate(30px, -30px) scale(1.1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.4;
    }
    75% {
        transform: translate(40px, 10px) scale(1.05);
        opacity: 0.6;
    }
}

/* ============================================= */
/* Navigation                                    */
/* ============================================= */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

nav.scrolled {
    padding: 0.5rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.theme-toggle {
    background: var(--primary);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

.burger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    margin-left: 1rem;
}

.burger span {
    width: 25px;
    height: 3px;
    background: var(--text-main);
    margin: 3px 0;
    transition: 0.3s;
}

.burger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}
.burger.active span:nth-child(2) {
    opacity: 0;
}
.burger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ============================================= */
/* Structure des Sections                          */
/* ============================================= */
section {
    padding: 5rem 2rem;
    display: flex;
    align-items: center;
    position: relative;
    background: transparent;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#accueil::before {
    background: linear-gradient(135deg, #1a1a2e 0%, #5b21b6 100%);
}

#projets::before {
    background: rgba(248, 249, 250, 0.95);
}
[data-theme="dark"] #projets::before {
    background: rgba(30, 30, 46, 0.95);
}

#apropos::before {
    background: rgba(255, 255, 255, 0.95);
}
[data-theme="dark"] #apropos::before {
    background: rgba(15, 15, 26, 0.95);
}

#savoir-faire::before {
    background: rgba(248, 249, 250, 0.95);
}
[data-theme="dark"] #savoir-faire::before {
    background: rgba(30, 30, 46, 0.95);
}

#contact::before {
    background: #1a1a2e;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================= */
/* Section Accueil                               */
/* ============================================= */
#accueil {
    color: var(--white);
    min-height: 100vh;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: fadeInUp 0.8s ease;
}

.hero-text h2 {
    font-size: 2rem;
    color: #c4b5fd;
    margin-bottom: 1.5rem;
    font-weight: normal;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-text p {
    font-size: 1.5rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: #e5e7eb;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInUp 0.8s ease 0.6s both;
}

.image-placeholder {
    width: 350px;
    height: 350px;
    border-radius: 50%; 
    background: rgba(255, 255, 255, 0.1);
    /* border: 3px dashed rgba(255, 255, 255, 0.3); */ /* Bordure pointillée retirée */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; 
}

.image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    border-radius: 50%;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-btn:hover::before {
    width: 300px;
    height: 300px;
}

.cta-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}

/* ============================================= */
/* Titres de Section                             */
/* ============================================= */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--text-main);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    margin: 1rem auto;
    border-radius: 2px;
}

.section-title.light {
    color: #fff;
}

/* ============================================= */
/* Section À propos                              */
/* ============================================= */
.bio-content {
    display: flex;
    align-items: center; 
    gap: 3rem;           
    max-width: 1100px;   
    margin: 0 auto;
}

.bio-image {
    flex: 1; 
    min-width: 300px;
    animation: fadeInLeft 0.8s ease; 
}

.bio-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.bio-text {
    flex: 1.5; 
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--gray);
    text-align: justify;
    animation: fadeInRight 0.8s ease; 
}

[data-theme="dark"] .bio-text {
    color: var(--gray);
}

/* ============================================= */
/* Section Savoir-Faire                          */
/* ============================================= */
.skills-subtitle {
    font-size: 2rem;
    color: var(--primary);
    text-align: center;
    margin-top: 4rem;
    margin-bottom: 1rem;
}

.skills-description {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem auto;
    font-size: 1.1rem;
    color: var(--gray);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: all 0.4s ease;
    border: 2px solid transparent;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    opacity: 0;
}

.skill-card.animate {
    animation: fadeInUp 0.6s ease forwards;
}

.skill-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(124, 58, 237, 0.3);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(124, 58, 237, 0.1) 100%);
}

.skill-card h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* ============================================= */
/* Section Projets (Carrousel)                   */
/* ============================================= */
.project-carousel-container {
    position: relative;
    width: 90%;
    max-width: 900px; 
    margin: 3rem auto 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.project-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.project-card {
    min-width: 100%; 
    width: 100%;
    flex-shrink: 0;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: none; 
    transition: all 0.4s ease;
    opacity: 1; 
}

.project-card:hover {
    transform: none; 
    box-shadow: none;
}

.project-image {
    width: 100%;
    height: 250px; /* CORRIGÉ : 50vh était trop grand */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.9rem;
    text-align: center;
    padding: 0;
    border-bottom: 3px solid var(--primary);
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite linear;
    z-index: 1;
}

@keyframes shimmer {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    color: var(--text-main);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.project-content p {
    color: var(--gray);
    margin-bottom: 1rem;
    line-height: 1.7;
    height: 100px; /* CORRIGÉ : Standardisé à 100px (au lieu de 80px) */
    overflow: auto;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-tag {
    background: #ede9fe;
    color: var(--primary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Boutons de navigation du carrousel */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.carousel-btn:hover {
    background: var(--white);
    color: var(--primary-dark);
    transform: translateY(-50%) scale(1.1);
}

[data-theme="dark"] .carousel-btn {
    background: rgba(30, 30, 46, 0.7);
    color: var(--light);
}
[data-theme="dark"] .carousel-btn:hover {
    background: rgba(30, 30, 46, 1);
    color: var(--primary);
}


.carousel-btn.prev {
    left: 1rem;
}

.carousel-btn.next {
    right: 1rem;
}

/* ============================================= */
/* Section Contact                               */
/* ============================================= */
#contact {
    color: #fff;
}

.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-form {
    margin: 2rem 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.15);
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(34, 197, 94, 0.2);
    border: 2px solid rgba(34, 197, 94, 0.5);
    color: #22c55e;
}

.form-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

.contact-info {
    margin: 2rem 0;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    font-size: 1.1rem;
}

.contact-item a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ============================================= */
/* Footer                                        */
/* ============================================= */
footer {
    background: #0f0f1a;
    color: #fff;
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

footer p {
    margin: 0.5rem 0;
}

/* ============================================= */
/* Bouton Retour en Haut                         */
/* ============================================= */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(124, 58, 237, 0.4);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.6);
}

/* ============================================= */
/* Animations (FadeIn)                           */
/* ============================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================= */
/* Responsive Media Queries                      */
/* ============================================= */
@media (max-width: 768px) {
    /* Navigation responsive */
    .burger {
        display: flex;
    }

    .theme-toggle {
        order: -1;
    }

    .nav-links {
        position: fixed;
        right: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--card-bg);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.1);
        padding: 2rem 0;
    }

    .nav-links.active {
        right: 0;
    }

    /* Section Accueil responsive */
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-text h2 {
        font-size: 1.2rem;
    }

    .image-placeholder {
        width: 250px;
        height: 250px;
    }

    /* Sections responsives */
    section {
        padding: 3rem 1rem;
        min-height: auto;
    }

    .section-title {
        font-size: 2rem;
    }
    
    .skills-subtitle {
        font-size: 1.8rem;
    }
    /* Section À propos responsive */
    .bio-content {
        flex-direction: column; 
        gap: 2rem;
    }
    .bio-image {
        min-width: unset;
        width: 80%; 
        margin: 0 auto; 
    }
    .bio-text {
        flex: 1; 
    }
    /* Carrousel responsive */
    .project-carousel-container {
        width: 100%; 
    }

    .project-image {
        height: 200px; 
    }

    .project-content p {
        height: 100px; 
    }

    .carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .carousel-btn.prev {
        left: 0.5rem;
    }
    
    .carousel-btn.next {
        right: 0.5rem;
    }
}