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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Navigation */
nav {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 1rem;
}

nav ul li {
    margin: 0 1.5rem;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

nav ul li a:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

nav ul li a.active {
    color: #007bff;
    background-color: #e9ecef;
}

/* Sections principales */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    margin-bottom: 4rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #2c3e50;
}

/* Barre de recherche */
.search-container {
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
}

/* Grille de projets */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
}

/* Carrousel d'images */
.image-carousel {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

.carousel-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 2;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.carousel-button:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-button.prev {
    left: 0.5rem;
}

.carousel-button.next {
    right: 0.5rem;
}

.carousel-dots {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 2;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.carousel-dot.active {
    background: white;
}

.project-info {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.project-description {
    margin-bottom: 1rem;
    color: #666;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stack-item {
    background: #f0f0f0;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.875rem;
    color: #666;
}

.project-duration {
    font-size: 0.875rem;
    color: #666;
}

.project-link {
    display: inline-block;
    margin-top: 1rem;
    color: #007bff;
    text-decoration: none;
}

.project-link:hover {
    text-decoration: underline;
}

/* Timeline Formation */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: #ddd;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 0 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: height 0.3s ease;
    overflow: hidden; /* Empêche le débordement des contenus */
}

.timeline-item .details {
    margin-top: 1rem;
    padding-left: 1.5rem;
    list-style-type: disc;
    color: #555;
    font-size: 0.9rem;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.date {
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin: 0.5rem 0;
    }

    .timeline::before {
        left: 0;
    }

    .timeline-item {
        width: 100%;
        left: 0 !important;
        padding-left: 2rem;
    }
}