:root {
    --bg-dark: #0d1117;
    --bg-darker: #161b22;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent: #03dd5a;
    --border: #30363d;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}

/* Navigation */
.nav-menu {
    position: fixed;
    top: 0;
    right: 20px;
    background-color: var(--bg-darker);
    padding: 1rem;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 1000;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-menu a:hover {
    background-color: var(--accent);
    color: var(--bg-darker);
}

/* Header */
header {
    text-align: center;
    padding: 4rem 0;
    position: relative;
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('image/fondbanner.webp') center/cover;
    opacity: 0.15;
    z-index: 0;
}

.container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    padding-right: 100px;
    z-index: 1;
}

/* Header avec photo */
.profile-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 2rem;
    position: relative;
}

.header-content {
    flex: 1;
}

.profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--accent);
    box-shadow: 0 0 10px rgba(2, 159, 117, 0.3);
    position: relative;
    z-index: 50;
    left: -25px;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo::after {
    content: '';
    position: absolute;
    bottom: -3rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 3rem;
    background-color: var(--accent);
}

/* Conteneur des sections avec timeline */
.sections-container {
    display: flex;
    position: relative;
    margin-left: 100px;
}

.vertical-timeline {
    position: absolute;
    left: -26px;
    top: -10rem;
    bottom: 0;
    width: 4px;
    background-color: var(--accent);
}

.sections-content {
    flex: 1;
    position: relative;
}

section {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 4rem;
}

.section-dot {
    width: 16px;
    height: 16px;
    background-color: var(--accent);
    border: 3px solid var(--bg-darker);
    border-radius: 50%;
    position: absolute;
    left: -33px;
    top: 1.5rem;
    box-shadow: 0 0 0 3px var(--accent);
    z-index: 2;
}

section::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 1.90rem;
    width: 53%;
    height: 4px;
    background-color: var(--accent);
}

/* Timeline Formation et Expérience */
.formation-timeline {
    position: relative;
    padding: 2rem 0;
    margin: 2rem 0;
}

.formation-line {
    position: absolute;
    left: 50%;
    top: -47px;
    bottom: 0;
    width: 4px;
    background-color: var(--accent);
    transform: translateX(-50%);
}

.formation-items {
    position: relative;
}

.formation-item {
    position: relative;
    margin: 2rem 0;
    width: 50%;
}

.formation-item.left {
    padding-right: 3rem;
    margin-left: 0;
}

.formation-item.right {
    padding-left: 3rem;
    margin-left: 50%;
    margin-top: -150px; /* Remonte les cartes de droite */
}

.formation-item:first-child.right {
    margin-top: 2rem;
}

.formation-dot {
    width: 16px;
    height: 16px;
    background-color: var(--accent);
    border: 3px solid var(--bg-darker);
    border-radius: 50%;
    position: absolute;
    top: 1.5rem;
    box-shadow: 0 0 0 3px var(--accent);
    z-index: 2;
}

.formation-item.left .formation-dot {
    right: -8px;
}

.formation-item.right .formation-dot {
    left: -8px;
}

.formation-content {
    background-color: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
    position: relative;
}

.formation-item.left .formation-content::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 1.5rem;
    border-width: 10px 0 10px 10px;
    border-style: solid;
    border-color: transparent transparent transparent var(--border);
}

.formation-item.right .formation-content::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 1.5rem;
    border-width: 10px 10px 10px 0;
    border-style: solid;
    border-color: transparent var(--border) transparent transparent;
}

.timeline-date {
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.timeline-photos,
.timeline-clients {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.timeline-photos img,
.timeline-clients img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.timeline-photos img:hover,
.timeline-clients img:hover {
    transform: scale(1.1);
    cursor: pointer;
}

/* Compétences grid avec images */
.competences-grid {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.competence-item {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.competence-item i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.competence-item:hover {
    transform: translateY(-5px);
}

.competence-item:hover i {
    transform: scale(1.1);
}

.competence-item.active {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: scale(1.1);
    z-index: 2;
}

.competence-item:not(.active) {
    opacity: 0.7;
    transform: scale(0.95);
}

.competence-item p {
    margin: 0;
    color: var(--text);
    font-weight: 500;
}

@media (max-width: 768px) {
    .competences-grid {
        flex-direction: column;
        gap: 1rem;
    }
    
    .competence-item.active {
        transform: scale(1.05);
    }
}

.contact-info {
    color: var(--text-secondary);
    margin: 1rem 0;
}

.contact-info a {
    color: var(--accent);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

h1, h2 {
    color: var(--text-primary);
    margin-bottom: 2rem;
}

h2 {
    padding-bottom: 0.5rem;
}

.experience-item, .formation-item {
    margin-bottom: 1.5rem;
}

.date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.title {
    font-weight: bold;
    color: var(--accent);
}

.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-top: 1rem;
    aspect-ratio: 16/9;
    background: var(--bg-dark);
}

.carousel-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    cursor: pointer;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.carousel-button:hover {
    opacity: 1;
}

.carousel-button.prev {
    left: 10px;
}

.carousel-button.next {
    right: 10px;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    z-index: 2;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: background-color 0.3s;
}

.carousel-dot.active {
    background: var(--accent);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 20px;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 10px;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}

/* Ajustement pour le responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        padding-right: 20px;
    }
    
    .nav-menu {
        position: static;
        border-radius: 0;
    }
    
    .nav-menu ul {
        flex-direction: column;
        align-items: center;
    }
    
    .formation-item {
        width: 100%;
        margin-left: 0;
        padding-left: 2rem;
        padding-right: 0;
    }

    .formation-item.right {
        margin-left: 0;
        padding-left: 2rem;
    }

    .formation-line {
        left: 0;
    }

    .formation-dot {
        left: -8px !important;
        right: auto !important;
    }

    .formation-content::after {
        display: none;
    }

    .sections-container {
        flex-direction: column;
    }

    section {
        padding-left: 0;
    }

    section::before {
        display: none;
    }

    .vertical-timeline {
        display: none;
    }

    .section-dot {
        display: none;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
    }

    .profile-photo::after {
        display: none;
    }

    .sections-container {
        margin-left: 0;
    }

    .competences-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .competence-item.active {
        order: 0;
    }

    .timeline-photos,
    .timeline-clients {
        grid-template-columns: repeat(2, 1fr);
    }

    .carousel {
        aspect-ratio: 4/3;
    }
}

.logiciel-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px;
}

.logiciel-item {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.logiciel-item img {
    width: 90px;
    height: 90px;
    object-fit: contain;
}

.logiciel-item p {
    display: none;
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    padding: 5px 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(18, 174, 60, 0.89);
    white-space: nowrap;
    font-size: 0.9em;
    color: var(--accent);
}

.logiciel-item:hover p {
    display: block;
}