/* Variables CSS basées sur le CV */
:root {
    --primary: #6a35d6; /* Violet du CV */
    --primary-dark: #5022ab;
    --secondary: #e6a877; /* Orange/Sable du CV */
    --secondary-dark: #cf9365;
    --bg-color: #fafafa;
    --text-dark: #222222;
    --text-light: #ffffff;
    --card-bg: #32254e; /* Couleur foncée du bloc contact */
    --spacing: 2rem;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typographie */
h1, h2, h3 {
    font-weight: 800;
    line-height: 1.2;
}

h1 {
    font-size: clamp(3rem, 5vw, 5rem);
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 span {
    color: var(--primary);
}

h2.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
}

h2.section-title span {
    color: var(--secondary);
}

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

ul {
    list-style: none;
}

/* Header & Nav */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(250, 250, 250, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
}

.logo span {
    color: var(--primary);
}

.main-nav ul {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    transition: var(--transition);
}

.main-nav a:hover {
    color: var(--primary);
}

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

.main-nav a:hover::after {
    width: 100%;
}

/* Layout général */
.section {
    padding: 4rem 5%; /* Réduit de 6rem à 4rem */
    /* min-height enlevé pour éviter les grands espaces vides */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding-top: 10rem;
}

.hero-desc {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 500px;
}

.bubbles {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.bubble {
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.orange-bubble {
    background-color: var(--secondary);
    color: var(--text-dark);
}

.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
}

.image-placeholder {
    position: relative;
    width: 80%;
    max-width: 400px;
    aspect-ratio: 4/5;
    z-index: 1;
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    position: relative;
    z-index: 2;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.picto-container {
    background: linear-gradient(135deg, var(--text-light), #f0f0f0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.picto-svg {
    width: 50%;
    height: 50%;
    color: var(--primary);
}

.decor-box {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    z-index: 1;
    top: 2rem;
    right: -2rem;
}

.purple-box {
    background-color: var(--primary);
}

/* About & Skills Grid Layouts */
.about-grid, .skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

.about-card, .skills-card {
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.about-card:hover, .skills-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.about-card h2, .skills-card h2 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.purple-card {
    background-color: var(--primary);
    color: var(--text-light);
}

.contact-card {
    background-color: var(--card-bg);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.orange-card {
    background-color: var(--secondary);
    color: var(--text-dark);
}

.white-card {
    background-color: var(--text-light);
    color: var(--text-dark);
    border: 1px solid rgba(0,0,0,0.05);
}

.purple-card ul li, .orange-card ul li, .white-card ul li {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    padding-left: 1.5rem;
}

.purple-card ul li::before, .white-card ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: inherit;
    opacity: 0.7;
}

.contact-info p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.languages h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    color: var(--secondary);
}

.languages ul li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

/* Timeline */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: var(--secondary);
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-date {
    width: 45%;
    text-align: right;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--secondary);
}

.timeline-item:nth-child(even) .timeline-date {
    text-align: left;
}

.timeline-content {
    width: 45%;
    background: var(--text-light);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    position: relative;
    border-top: 4px solid var(--primary);
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    left: -10%; /* Approximation, to be fixed in detailed css later if needed */
    transform: translateY(-50%) translateX(-25px);
}
.timeline-item:nth-child(even) .timeline-content::before {
    right: -10%;
    transform: translateY(-50%) translateX(25px);
}
/* Fix timeline dots perfectly */
.timeline-item::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--bg-color);
    border: 4px solid var(--primary);
    border-radius: 50%;
    z-index: 2;
}

.timeline-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* Portfolio */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.portfolio-card {
    background-color: var(--text-light);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.portfolio-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    position: relative;
}

.portfolio-image h3 {
    font-size: 1.5rem;
    z-index: 2;
    text-align: center;
    padding: 0 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.video-bg { background: linear-gradient(45deg, #6a35d6, #8e54e9); }
.graphic-bg { background: linear-gradient(45deg, #e6a877, #f5d0b5); }
.web-bg { background: linear-gradient(45deg, #32254e, #5022ab); }
.social-bg { background: linear-gradient(45deg, #ff6b6b, #ff8e8e); }
.terrain-bg { background: linear-gradient(45deg, #4ecdc4, #55f2e8); }
.photo-bg { background: linear-gradient(45deg, #2b5876, #4e4376); }

.portfolio-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.portfolio-content p {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.portfolio-content ul {
    margin-top: auto;
}

.portfolio-content ul li {
    font-size: 0.9rem;
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
    color: rgba(0,0,0,0.7);
}

.portfolio-content ul li::before {
    content: '•';
    color: var(--primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 3rem 5%;
    background: var(--card-bg);
    color: var(--text-light);
}

.social-links a {
    display: inline-block;
    margin-top: 1rem;
    color: var(--secondary);
    font-weight: 600;
}

.social-links a:hover {
    text-decoration: underline;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* Responsive */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 8rem;
    }
    
    .hero-desc {
        margin: 0 auto 2rem;
    }
    
    .bubbles {
        justify-content: center;
        margin-bottom: 3rem;
    }

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

    .timeline::before {
        left: 0;
    }

    .timeline-item {
        flex-direction: column !important;
        align-items: flex-start;
        padding-left: 2rem;
    }

    .timeline-item::after {
        left: 0;
    }

    .timeline-date, .timeline-content {
        width: 100%;
        text-align: left !important;
    }
    
    .timeline-date {
        margin-bottom: 0.5rem;
    }
    
    .main-nav {
        display: none; /* Mobile menu to be added if needed */
    }
}

/* --- Modal Styles --- */
.modal {
    display: none; /* Hidden by default, JS sets to flex */
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-color);
    padding: 3rem;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(50px) scale(0.95);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.close-modal {
    color: var(--text-dark);
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary);
    text-decoration: none;
}

/* Style for injected content inside modal */
#modal-body h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

#modal-body p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

#modal-body ul {
    margin-bottom: 2rem;
}

#modal-body ul li {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}
#modal-body ul li::before {
    content: '•';
    color: var(--secondary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* --- Styles pour la galerie dans la modale --- */
.portfolio-card .modal-gallery {
    display: none; /* Toujours caché sur la carte principale */
}

.modal .modal-gallery {
    display: block; /* Visible uniquement dans la modale */
    animation: fadeInGallery 0.5s ease 0.2s both;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-grid img:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

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

/* --- Lightbox Styles --- */
.lightbox {
    display: none; /* JS sets to flex */
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 3000; /* Toujours au-dessus de la modale */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox.show .lightbox-content {
    transform: scale(1);
}

.close-lightbox {
    color: #ffffff;
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    z-index: 3001;
}

.close-lightbox:hover {
    color: var(--secondary);
}
