:root {
    --bg-color: #f4f4f9;
    --text-color: #333;
    --accent-color: #245EDC;
    --card-bg: #ffffff;
    --timeline-line: #ccc;
    --shadow-color: rgba(0, 0, 0, 0.1);
    /* Image de fond mode CLAIR */
    --hero-bg: url('images/hero-bg-light.png');
    /* Filtre BLANC pour le mode clair (pour éclaircir l'image) */
    --hero-overlay: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --accent-color: #38bdf8;
    --card-bg: #1e293b;
    --timeline-line: #334155;
    --shadow-color: rgba(0, 0, 0, 0.3);
    /* Image de fond mode SOMBRE */
    --hero-bg: url('images/hero-bg.png');
    /* Filtre NOIR pour le mode sombre */
    --hero-overlay: rgba(0, 0, 0, 0.6);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    padding: 0;
    transition: background 0.3s, color 0.3s;
    background-image: none !important;
}

/* --- Navbar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--card-bg);
    box-shadow: 0 2px 10px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 10px;
    font-weight: 600;
}

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

.control-btn {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
    margin-left: 5px;
}

.control-btn:hover {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    text-align: center;
    padding: 8rem 1rem;
    background: var(--hero-bg) no-repeat center center;
    background-size: cover;
    /* Le texte prend la couleur du thème (Noir en clair, Blanc en sombre) */
    color: var(--text-color);
    overflow: hidden;
    z-index: 1;
    transition: background-image 0.3s ease-in-out, color 0.3s ease-in-out;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Le filtre change selon le thème (Blanc ou Noir) */
    background: var(--hero-overlay);
    z-index: -1;
    transition: background 0.3s ease-in-out;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    color: inherit;
    /* Ombre ajustée pour être visible sur fond clair ou sombre */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero h2 {
    font-size: 1.5rem;
    color: inherit;
    margin-bottom: 2rem;
    font-weight: 400;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.hero p {
    color: inherit;
    font-size: 1.2rem;
    line-height: 1.6;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2.5rem;
    max-width: 650px;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    font-size: 1.8rem;
    /* Les icônes prennent la couleur du texte (Noir en clair) */
    color: inherit;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

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

/* --- Sections --- */
.section {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.section-title {
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 40px;
    display: inline-block;
    color: var(--text-color);
}

/* --- TIMELINE MODERNE --- */
.timeline {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--timeline-line);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    padding-left: 1.5rem;
}

.timeline-marker {
    position: absolute;
    top: 1.5rem;
    left: -6px;
    width: 14px;
    height: 14px;
    background: var(--bg-color);
    border: 3px solid var(--accent-color);
    border-radius: 50%;
    z-index: 2;
    transition: transform 0.3s ease, background-color 0.3s;
}

.timeline-item:hover .timeline-marker {
    background-color: var(--accent-color);
    transform: scale(1.2);
    box-shadow: 0 0 0 4px var(--shadow-color);
}

.timeline-content {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--timeline-line);
    box-shadow: 0 4px 6px var(--shadow-color);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
}

.timeline-item:hover .timeline-content {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px var(--shadow-color);
    border-color: var(--accent-color);
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    left: -8px;
    width: 16px;
    height: 16px;
    background: var(--card-bg);
    border-left: 1px solid var(--timeline-line);
    border-bottom: 1px solid var(--timeline-line);
    transform: rotate(45deg);
    transition: border-color 0.3s;
}

.timeline-item:hover .timeline-content::before {
    border-color: var(--accent-color);
}

.timeline-date {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Wrapper pour en-tête et logo */
.timeline-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.timeline-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 6px;
    background: white;
    padding: 2px;
    border: 1px solid var(--timeline-line);
    box-shadow: 0 2px 4px var(--shadow-color);
}

.timeline-content h3 {
    margin: 0.5rem 0 0.2rem 0;
    color: var(--text-color);
    font-size: 1.25rem;
}

.timeline-location {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 1rem;
    font-style: italic;
}

.timeline-location i {
    margin-right: 5px;
}

.timeline-content p {
    margin: 0;
    line-height: 1.6;
    opacity: 0.9;
    color: var(--text-color);
}

.timeline-link {
    display: inline-flex;
    align-items: center;
    margin-top: 1rem;
    text-decoration: none;
    color: var(--accent-color);
    font-weight: 600;
    gap: 5px;
    transition: gap 0.2s;
}

.timeline-link:hover {
    gap: 8px;
    text-decoration: underline;
}

/* --- SKILLS CARDS --- */
#skills-network.skills-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    height: auto;
    background: transparent;
    border: none;
    box-shadow: none;
}

.skill-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px var(--shadow-color);
    border: 1px solid var(--timeline-line);
    transition: transform 0.2s, box-shadow 0.2s;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px var(--shadow-color);
}

.skill-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--timeline-line);
    padding-bottom: 0.8rem;
}

.skill-header i {
    font-size: 1.5rem;
    margin-right: 12px;
    color: var(--accent-color);
}

.skill-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.skill-body {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: default;
}

.skill-pill:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* Couleurs des badges */
.skill-pill.blue {
    background-color: #e0f2fe;
    color: #0369a1;
}

.skill-pill.green {
    background-color: #dcfce7;
    color: #15803d;
}

.skill-pill.purple {
    background-color: #f3e8ff;
    color: #7e22ce;
}

[data-theme="dark"] .skill-pill.blue {
    background-color: #0c4a6e;
    color: #bae6fd;
}

[data-theme="dark"] .skill-pill.green {
    background-color: #14532d;
    color: #bbf7d0;
}

[data-theme="dark"] .skill-pill.purple {
    background-color: #581c87;
    color: #e9d5ff;
}

/* --- Footer & Misc --- */

.xp-mode-btn {
    position: relative;
    background: linear-gradient(to bottom, #3C8018 0%, #4CA922 100%);
    color: white;
    padding: 10px 25px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Tahoma', sans-serif;
    transition: transform 0.2s, box-shadow 0.2s;
}

.xp-mode-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* --- Logo Container Styles --- */
.timeline-logos-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.timeline-logo-small {
    height: 40px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    background: white;
    padding: 2px;
}

/* BOUTON RETOUR EN HAUT */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background-color: var(--text-color);
    transform: translateY(-5px);
}

footer {
    text-align: center;
    padding: 3rem 1rem;
    border-top: 1px solid var(--timeline-line);
    margin-top: 4rem;
    background-color: var(--bg-color);
}

/* --- Video --- */
.timeline-video-container {
    margin-top: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    max-width: 100%;
}

.video-link {
    display: block;
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

.video-thumbnail {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.play-overlay i {
    color: white;
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0.8);
}

.video-link:hover .play-overlay {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.4);
}

.video-link:hover .play-overlay i {
    transform: scale(1.1);
}

.video-link:hover .video-thumbnail {
    transform: scale(1.02);
}

/* --- Dropdown --- */
.dropdown {
    position: relative;
    display: inline-block;
    margin: 0 10px;
}

.dropbtn {
    background-color: transparent;
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s;
}

.dropdown:hover .dropbtn,
.nav-links a:hover {
    color: var(--accent-color);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--card-bg);
    min-width: 220px;
    box-shadow: 0 8px 16px var(--shadow-color);
    border: 1px solid var(--timeline-line);
    border-radius: 8px;
    z-index: 1001;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
    padding: 5px 0;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    margin: 0;
    font-weight: 400;
    transition: background 0.2s, color 0.2s;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: var(--accent-color);
    color: #ffffff;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropbtn i {
    font-size: 0.8em;
    margin-left: 5px;
}

/* --- Bouton CV --- */
.cta-button {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--accent-color);
    /* FORCE la couleur blanche pour le texte, peu importe le thème */
    color: #fff !important;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, background-color 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
}

.cta-button:hover {
    transform: translateY(-3px);
    /* Au survol, fond transparent mais bordure bleue et TEXTE BLEU pour rester lisible */
    background-color: transparent;
    border-color: var(--accent-color);
    color: var(--accent-color) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}