/* =========================================
   1. VARIABLES & THEMES
   ========================================= */

:root {
    /* Day Theme Colors - Murasaki Purple */
    --primary: #884898; 
    --primary-dark: #5a2f66; 
    --accent: #ab5cc2; 
    
    /* Background & Dots */
    --bg-color: #ffffff;
    --dot-color: #e0e0e0;
    
    /* Surfaces & Text */
    --surface: #ffffff;
    --text-primary: rgba(0, 0, 0, 0.87);
    --text-secondary: rgba(0, 0, 0, 0.60);
    --divider: rgba(0, 0, 0, 0.12);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-text: rgba(0, 0, 0, 0.87);
    
    /* Elevations */
    --shadow-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
    --shadow-4: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);

    /* Scrollbar */
    --scrollbar-bg: var(--bg-color);
    --scrollbar-thumb: #bdbdbd; 
    --scrollbar-thumb-hover: var(--primary);
}

/* Dark Theme (Time-based) */
body.dark-theme {
    --bg-color: #121212; 
    --dot-color: #2a2a2a; 
    --surface: #1e1e1e; 
    --text-primary: rgba(255, 255, 255, 0.87);
    --text-secondary: rgba(255, 255, 255, 0.60);
    --divider: rgba(255, 255, 255, 0.12);
    --nav-bg: rgba(30, 30, 30, 0.95);
    --nav-text: rgba(255, 255, 255, 0.87);
    
    /* Brighter Murasaki for contrast on dark backgrounds */
    --primary: #a361b3; 
    
    --scrollbar-bg: var(--bg-color);
    --scrollbar-thumb: #616161; 
    --scrollbar-thumb-hover: var(--primary);
}

/* =========================================
   2. BASE SETUP & UTILITIES
   ========================================= */

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
    scroll-behavior: smooth;
    transition: background-color 0.8s ease, color 0.8s ease; 
    
    /* Dotted Mosaic Background */
    background-color: var(--bg-color);
    background-image: radial-gradient(var(--dot-color) 1.5px, transparent 1.5px);
    background-size: 20px 20px; 
}

.text-center { text-align: center; }
.mt-2 { margin-top: 32px; }
.bg-light { background-color: var(--surface); transition: background-color 0.8s ease; }

/* =========================================
   3. CUSTOM SCROLLBAR
   ========================================= */

html {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-bg);
}

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--scrollbar-bg); }
::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 20px; 
    border: 3px solid var(--scrollbar-bg); 
    transition: background-color 0.3s ease;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-thumb-hover); }

/* =========================================
   4. NAVIGATION BAR
   ========================================= */

.md-appbar {
    background-color: var(--nav-bg);
    color: var(--nav-text);
    box-shadow: var(--shadow-2);
    position: fixed;
    top: 0; 
    width: 100%;
    z-index: 100;
    transition: background-color 0.8s ease, color 0.8s ease;
    backdrop-filter: blur(4px); 
}
.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
}
.nav-content .logo { 
    display: flex; 
    align-items: center; /* Centre le texte verticalement par rapport à l'image */
    gap: 16px; /* Crée un espace propre entre le logo et le texte */
    font-size: 1.5rem; /* Légèrement agrandi pour bien s'équilibrer avec l'image de 100px */
    font-weight: 500; 
    color: var(--primary); /* Optionnel : applique votre violet Murasaki au texte */
}

.nav-links a {
    color: var(--nav-text);
    text-decoration: none;
    margin-right: 24px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.875rem;
}
#lang-switch {
    background: transparent;
    color: var(--nav-text);
    border: 1px solid var(--divider);
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
}
#lang-switch option { color: #000; } 

/* =========================================
   5. HERO SECTION
   ========================================= */

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 24px;
    background-color: transparent; 
}
.hero h1 { 
    font-size: 3.75rem; 
    font-weight: 300; 
    letter-spacing: -0.5px; 
    margin-bottom: 24px; 
}

/* =========================================
   6. INTERACTIVE INFINITE MINDMAP
   ========================================= */

.skills-subtitle {
    width: 80vw;
    max-width: 1400px;
    margin: 0 auto 40px auto;
    display: flex;
    justify-content: center;
}

.mindmap-viewport {
    position: relative;
    width: 100%;
    height: 450px; 
    overflow: hidden;
    cursor: grab;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
}

.mindmap-track {
    display: flex;
    width: max-content;
    height: 100%;
}

.mindmap-section {
    position: relative;
    width: 2400px;
    height: 450px;
    flex-shrink: 0;
}

.mindmap-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none; 
}

.mindmap-lines line {
    stroke: var(--divider);
    stroke-width: 2px;
    stroke-dasharray: 4; 
    transition: stroke 0.8s ease;
}

.skill-chip {
    position: absolute;
    z-index: 2;
    background-color: var(--surface);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 16px; 
    box-shadow: var(--shadow-1);
    font-size: 0.875rem;
    font-weight: 500;
    transform: translate(-50%, -50%);
    transition: box-shadow 0.3s, color 0.3s, background-color 0.3s ease, transform 0.3s;
    user-select: none; 
}

.skill-chip:hover {
    box-shadow: var(--shadow-4); 
    color: white; 
    background-color: var(--primary);
    transform: translate(-50%, -50%) scale(1.15); 
    z-index: 3;
}

/* =========================================
   7. BUTTONS, CARDS & LAYOUT
   ========================================= */

.md-btn {
    display: inline-block;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s, box-shadow 0.3s, transform 0.2s;
    border: none;
}
.md-btn-primary { 
    background-color: var(--primary); 
    color: white; 
    box-shadow: var(--shadow-1); 
}
.md-btn-primary:hover { 
    background-color: var(--primary-dark); 
    box-shadow: var(--shadow-2); 
    transform: translateY(-2px); 
}
/* Style pour les boutons désactivés */
.md-btn:disabled,
.md-btn-primary:disabled {
    background-color: var(--divider);
    color: var(--text-secondary);
    box-shadow: none;
    cursor: not-allowed;
}

.md-btn-primary:disabled:hover {
    background-color: var(--divider);
    transform: none; /* Désactive la petite animation de saut vers le haut */
    box-shadow: none;
}

.section { padding: 80px 24px; max-width: 1200px; margin: 0 auto; }
.section-title { font-size: 2.125rem; font-weight: 400; margin-bottom: 40px; text-align: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

.md-card {
    background: var(--surface);
    border-radius: 4px;
    box-shadow: var(--shadow-1);
    transition: box-shadow 0.3s, transform 0.3s;
    overflow: hidden;
    cursor: pointer; /* Indicates the card is clickable */
}
.md-card:hover { box-shadow: var(--shadow-4); transform: translateY(-4px); }
.md-card-content { padding: 16px; }
.md-card-content h3 { font-size: 1.25rem; font-weight: 500; margin-bottom: 8px; }
.md-card-content p { color: var(--text-secondary); font-size: 0.875rem; }

/* --- Base Card Image Setup --- */
.md-card-img { 
    height: 160px; 
    width: 100%; 
    background-color: var(--surface);
    border-bottom: 1px solid var(--divider);
}

/* --- Project Images --- */
.img-project-1 {
    background-image: url('https://images.unsplash.com/photo-1551288049-bebda4e38f71?auto=format&fit=crop&w=600&q=80');
    background-size: cover;
    background-position: center;
}
.img-project-2 {
    background-image: url('https://images.unsplash.com/photo-1461749280684-dccba630e2f6?auto=format&fit=crop&w=600&q=80');
    background-size: cover;
    background-position: center;
}
.img-project-3 {
    background-image: url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=600&q=80');
    background-size: cover;
    background-position: center;
}

/* --- Brand Logos --- */
.brand-logo {
    background-size: contain; 
    background-position: center;
    background-repeat: no-repeat;
    background-color: #ffffff;
}
.logo-decathlon { background-image: url('https://www.danstapub.com/wp-content/uploads/2024/03/Wolff_Olins_Decathlon_Press_02_Logo_1920x1280.jpg'); }
.logo-wiiisdom { background-image: url('https://mms.businesswire.com/media/20231003449511/fr/1902671/22/Logo-Wiiisdom-1200x90.jpg'); }
.logo-imsa { background-image: url('https://www.ellesbougent.com/documents/partenaires/247/bm_imsa.logo.jpg'); }
    
/* =========================================
   8. FOOTER
   ========================================= */

.md-footer { 
    background-color: var(--surface); 
    padding: 24px; 
    text-align: center; 
    color: var(--text-secondary); 
    font-size: 0.875rem;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.12); 
}

/* =========================================
   9. RESPONSIVE DESIGN
   ========================================= */

@media (max-width: 600px) {
    .hero h1 { font-size: 2.5rem; }
    .nav-links a { display: none; }
}

/* =========================================
   10. MODAL COMPONENT
   ========================================= */

.md-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.md-modal.active {
    opacity: 1;
    visibility: visible;
}

.md-modal-surface {
    background-color: var(--surface);
    width: 80vw; /* Prend 80% de la largeur de l'écran */
    height: 80vh; /* Prend 80% de la hauteur de l'écran */
    max-width: none; /* Enlève l'ancienne limite de 600px */
    border-radius: 8px;
    box-shadow: var(--shadow-4);
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.md-modal.active .md-modal-surface {
    transform: scale(1);
}

.md-modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(0,0,0,0.5); 
    color: white;
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.3s;
}

.md-modal-close:hover { background: rgba(0,0,0,0.8); }

.md-modal-header {
    height: 200px;
    width: 100%;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--divider);
}

.md-modal-header.modal-brand {
    background-size: contain;
    background-repeat: no-repeat;
    background-color: #ffffff;
}

.md-modal-content {
    padding: 24px;
}

.md-modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--primary); /* Uses the new Murasaki purple */
}

.md-modal-content p, .md-modal-content ul {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 16px;
}