/* Style général */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a5a6f; /* Couleur turquoise plus foncée */
    --secondary-color: #357b87;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

/* Navigation */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 0.75rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
}

header ul {
    display: flex;
    list-style-type: none;
    gap: 2rem;
}

header ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    padding-bottom: 0.25rem;
}

header ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

header ul li a:hover::after {
    width: 100%;
}

/* Hero Section */
#hero {
    min-height: 75vh;
    background: linear-gradient(
        150deg,
        #2c3e50 0%,
        #3c94a1 45%, 
        #5bc3d1 75%,
        #6ecfdb 100%
    );
    color: #333; 
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform, opacity;
    transition: opacity 0.2s ease-out;
}

#hero .hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateZ(0);
}

#hero h2 {
    font-size: clamp(1.75rem, 4vw, 3rem);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

#hero p {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    max-width: 600px;
    margin: 0 auto 1.5rem;
    opacity: 0.9;
    text-align: center;
}

#hero::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(255,255,255,0.15) 0%,
        rgba(255,255,255,0.1) 25%,
        transparent 60%
    );
    animation: rotate 20s linear infinite;
    transform: translateZ(-1px);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Typing animation */
.animated-title {
    font-size: clamp(1.75rem, 4vw, 3rem);
    margin-bottom: 0.75rem;
    font-weight: 700;
    display: inline-block;
    color: #016878; /* Couleur du texte assombrie */
}

.cursor {
    display: inline-block;
    width: 3px;
    margin-left: 3px;
    animation: blink 1s infinite;
    color: white;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

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

section h2, section h3 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: 1rem;
    color: var(--secondary-color);
    text-align: center;
}

/* Projets Container */
.projets-container {
    position: relative;
    max-width: 1200px;
    margin: 3rem auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.carousel-container {
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    gap: 1.5rem;
}

.carousel-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.carousel-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.carousel-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Projet Cards */
.card {
    flex: 0 0 300px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 420px; /* Hauteur fixe pour toutes les cartes */
}

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

.card img {
    width: 100%;
    height: 180px; /* Hauteur fixe pour toutes les images */
    object-fit: cover;
    border-radius: 20px 20px 0 0;
}

.card-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.15rem; /* Réduit la taille du titre */
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.card-content p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.95rem; /* Réduit la taille du texte */
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Réduit à 3 lignes au lieu de 4 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content .btn {
    align-self: flex-start;
    margin-top: auto;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 500;
    transition: var(--transition);
}

.card-content .btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Bouton */
.btn {
    padding: 0.8rem 2rem;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn:hover {
    background: transparent;
    color: white;
    border-color: white;
    transform: translateY(-2px);
}

/* À propos */
.about-content {
    max-width: 1000px;
    margin: 0 auto;
}

.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
    align-items: start;
}

.about-text {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.cv-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.cv-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.cv-image:hover {
    transform: scale(1.02);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    padding: 20px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

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

.close-modal {
    position: absolute;
    right: 35px;
    top: 15px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--primary-color);
}

/* Contact */
#contact {
    text-align: center;
    background: var(--light-bg);
    border-radius: 20px;
    padding: 3rem;
}

#contact p {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-top: 1rem;
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header nav {
        flex-direction: column;
        gap: 1rem;
    }

    header ul {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .projets-container {
        grid-template-columns: 1fr;
    }

    #hero {
        padding: 1rem;
    }

    section {
        padding: 3rem 1rem;
    }

    #a-propos {
        padding: 2rem 1rem;
    }

    .card {
        margin: 0 1rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .cv-container {
        margin-top: 2rem;
    }
}

/* Project Pages Styles */
.project-hero {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    padding: 8rem 2rem 4rem;
    text-align: center;
}

.project-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.project-hero h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
}

.project-hero p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    opacity: 0.9;
}

.project-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.project-overview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

@media (min-width: 768px) {
    .project-overview {
        grid-template-columns: 1fr 1fr;
    }
}

.project-image {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

.featured-image:hover {
    transform: scale(1.02);
}

.project-description {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-description p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.detail-section {
    margin-bottom: 3rem;
}

.detail-section h3 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    text-align: left;
}

.detail-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.sub-section {
    margin-bottom: 2rem;
}

.sub-section h4 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.sub-section ul {
    list-style: none;
    padding: 0;
}

.sub-section ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

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

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 768px) {
    .project-content {
        padding: 2rem 1rem;
    }

    .project-hero {
        padding: 6rem 1rem 3rem;
    }

    .detail-section h3 {
        font-size: 1.5rem;
    }

    .sub-section h4 {
        font-size: 1.2rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}
