/* Variables Globales */
:root {
    --primary-color: #007bff;
    --primary-dark: #0069d9;
    --secondary-color: #6c757d;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --success-color: #28a745;
    --bg-color: #ffffff;
    --text-color: #333333;
    --border-color: #e1e1e1;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease-in-out;
    --border-radius: 5px;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* Reset et Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-title {
    font-size: 2.2rem; /* Légèrement réduit */
    text-align: center;
    margin-bottom: 2rem; /* Réduit de 3rem à 2rem */
    position: relative;
    color: var(--dark-color);
}

.section-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
}

section {
    padding: 4rem 0; /* Réduit de 6rem à 4rem pour moins d'espacement vertical */
}

/* Styles avec dégradés modernes pour les sections */
section:nth-child(even) {
    background-image: linear-gradient(135deg, #f5f7fa 0%, #eef2f7 100%);
    position: relative;
}

/* Section À Propos avec dégradé moderne */
section.about {
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.95)), 
                      linear-gradient(to right, #007bff 0%, #00dbde 100%);
    background-size: 100% 100%, 100% 5px;
    background-position: 0 0, 0 100%;
    background-repeat: no-repeat;
}

/* Section Compétences avec dégradé moderne */
section.skills {
    position: relative;
    background-image: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%);
}

/* Section Projets avec dégradé moderne */
section.projects {
    background-image: linear-gradient(to top, #f3f3f3 0%, #ffffff 100%);
}

/* Section Contact avec dégradé moderne */
section.contact {
    position: relative;
    background-image: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: black;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Styles pour les éléments indiquant "bientôt disponible" */
.coming-soon {
    color: var(--secondary-color);
    font-style: italic;
    background-color: rgba(108, 117, 125, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

.btn-disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #f1f1f1 !important;
    color: var(--secondary-color) !important;
    border: 1px dashed var(--border-color) !important;
}

.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: transform 0.3s ease, padding 0.3s ease;
    transform: translateY(0);
}

header.scrolled {
    padding: 0.25rem 0;
}

header.hidden {
    transform: translateY(-100%);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    font-family: 'Poppins', sans-serif;
}

.navbar {
    display: flex;
}

.navbar li {
    margin: 0 1rem;
}

.navbar a {
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.25rem 0;
    position: relative;
    font-size: 0.9rem;
}

.navbar a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.navbar a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Section Hero */
.hero {
    height: 90vh; /* Réduit de 100vh à 90vh pour moins d'espace vertical */
    background-color: #F0F4F8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: rgb(10, 9, 9);
    position: relative;
}

.hero-content {
    max-width: 800px;
    text-align: center;
    width: 100%;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInDown 1s;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    animation: fadeInDown 1s 0.2s;
    animation-fill-mode: both;
    font-weight: 600;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s 0.4s;
    animation-fill-mode: both;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.highlight {
    color: var(--primary-color);
    font-weight: 700;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    animation: fadeInUp 1s 0.6s;
    animation-fill-mode: both;
}

.scroll-down {
    position: absolute;
    bottom: 2rem;
    animation: bounce 2s infinite;
}

.scroll-down a {
    color: white;
    font-size: 1.5rem;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-30px);
    }
    60% {
        transform: translateY(-15px);
    }
}

/* Section À Propos */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
}

.profile-img {
    border-radius: 50%;
    box-shadow: var(--card-shadow);
    border: 5px solid white;
    max-width: 300px;
    margin: 0 auto;
}

.about-text p {
    margin-bottom: 0.8rem; /* Réduit de 1.5rem à 0.8rem */
}

.about-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.8rem; /* Réduit de 1rem à 0.8rem */
    margin: 1rem 0; /* Réduit de 1.5rem à 1rem */
}

.detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail i {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-links a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-color);
    color: var(--dark-color);
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Section Projets */
.projects-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Réduit la taille minimale de 350px à 300px */
    gap: 1.5rem; /* Réduit l'écart de 2rem à 1.5rem */
    align-items: stretch; /* Ensure all cards stretch to same height */
}

.project-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: white;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.project-img {
    height: 200px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.project-img::before {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.project-img:hover::before {
    opacity: 1;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-img img {
    transform: scale(1.05);
}

.project-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 280px; /* Ensure minimum height for consistency */
}

.project-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    order: 1; /* Ensure title comes first */
}

.project-info p {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    order: 2; /* Description comes after title */
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    order: 3; /* Tags come after description */
}

.project-tags span {
    background-color: var(--light-color);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    height: fit-content;
}

.project-links {
    display: flex;
    gap: 0.5rem;
    margin-top: auto; /* This pushes the buttons to the bottom */
    flex-wrap: wrap;
    order: 4; /* Links come last */
}

/* Section Compétences */
.skills-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.skills-category {
    margin-bottom: 2rem;
}

.skills-category h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    background-color: white;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    height: 140px; /* Hauteur fixe pour tous les éléments */
}

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

.skill-icon {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--light-color);
    border-radius: 50%;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.skill-item:hover .skill-icon {
    background-color: var(--primary-color);
    color: white;
}

.skill-info {
    flex: 1;
}

.skill-info h4 {
    margin-bottom: 0;
    font-size: 1.1rem;
    color: var(--dark-color);
}

/* Section Contact */
.contact-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact-form {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.2);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Footer */
footer {
    background-image: linear-gradient(to right, #1a237e 0%, #283593 100%);
    color: white;
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 999;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    color: white;
}

/* Styles pour l'overlay d'image (Lightbox) */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.image-overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-image {
    max-width: 90%;
    max-height: 90%;
    border: 2px solid white;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
    transform: scale(0.85);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0.8;
}

.image-overlay.active .overlay-image {
    transform: scale(1);
    opacity: 1;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.close-btn:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

/* Boutons de navigation pour l'overlay */
.nav-btn {
    position: absolute;
    top: 50%;
    font-size: 50px;
    color: white;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: translateY(-50%);
    transition: all 0.3s;
    opacity: 0.7;
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--primary-color);
    opacity: 1;
}

/* Compteur d'images pour le lightbox */
.image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Animation améliorée pour l'image dans l'overlay */
