/* Variables pour une gestion facile des couleurs */
:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent-color: #8b0000;
    --accent-hover: #a50000;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Roboto", sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.8;
    font-weight: 300;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
}

.logo{
    height: 50px;
    width: auto;
    transition: height 0.3s ease;
}

/* Navbar styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(18, 18, 18, 0.95); /* Fond semi-transparent */
    backdrop-filter: blur(10px); /* Effet de flou moderne */
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: padding 0.3s ease;
}

.left-align {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.navbar .left-align a {
    margin-left: 0;
    display: flex;
    align-items: center;
}

.navbar a:not(.nom):not(:has(img))::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s;
}

.navbar a:not(.nom):not(:has(img)):hover::after {
    width: 100%;
}

.navbar a:hover {
    color: var(--white);
}

#nom {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
}

/* État de la Navbar lors du défilement */
.navbar.scrolled {
    padding: 5px 40px;
}

.navbar.scrolled .logo {
    height: 35px;
}


/* Sections styles */
section {
    padding: 120px 20px;
    max-width: 1200px;
    margin: 0 auto;
    opacity: 0; /* Pour l'animation d'apparition */
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

h1, h2, h3 {
    color: var(--white);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Home section */
#home {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    text-align: left;
    gap: 50px;
    background: radial-gradient(circle at center, #2a2a2a 0%, var(--bg-color) 70%);
}

#home h1 {
    font-size: 4rem;
    margin-bottom: 0.2rem;
    background: -webkit-linear-gradient(45deg, #fff, #ccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#home h3 {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

#home p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0px);
    }
}

.home-photo img {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 25% 35%;
    box-shadow: var(--shadow);
    border: 4px solid var(--surface-color);
    animation: float 6s ease-in-out infinite;
}

.home-text {
    max-width: 600px;
}

/* Responsive Home */
@media screen and (max-width: 768px) {
    #home {
        flex-direction: column;
        text-align: center;
        justify-content: flex-start;
        padding-top: 130px;
        gap: 5px;
    }
    .home-photo img {
        width: 200px;
        height: 200px;
        width: 180px;
        height: 180px;
    }
    #home h1 { font-size: 2.5rem; }
    #home h3 { font-size: 1.5rem; }
    #home p { font-size: 1rem; padding: 0 15px; }
}

/* Skills section */
#skills {
    text-align: center;
}

.skills-container {
    margin-top: 40px;
}

.skills-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--text-main);
    padding: 8px 25px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent-color);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 0 10px;
}

.skill-card {
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: left;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #333;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.skill-card h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--white);
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.skill-header h3 {
    margin-bottom: 0;
}

.skill-icon {
    width: 28px;
    height: 28px;
    fill: var(--accent-color);
    flex-shrink: 0;
}

.skill-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
}

.skill-bar {
    height: 100%;
    background-color: var(--accent-color);
    width: 0; /* Animé via JS */
    border-radius: 4px;
    transition: width 1.5s ease-out;
}

/* Experiences section */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

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

.experience {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 8px;
    width: 45%;
    position: relative;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

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

/* Alternance gauche/droite pour la timeline */
.experience:nth-child(odd) { left: 0; text-align: right; }
.experience:nth-child(even) { left: 55%; text-align: left; }

/* Points sur la timeline */
.experience::after {
    content: '';
    position: absolute;
    top: 20px;
    width: 16px;
    height: 16px;
    background-color: var(--accent-color);
    border: 4px solid var(--bg-color);
    border-radius: 50%;
    z-index: 1;
}

.experience:nth-child(odd)::after { right: calc(-11.11% - 12px); }
.experience:nth-child(even)::after { left: calc(-11.11% - 12px); }

.experience h3 {
    color: var(--accent-color);
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.experience .company {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--white);
    margin-bottom: 2px;
}

.experience .years {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-style: italic;
}

.experience .description {
    margin-bottom: 15px;
    color: var(--text-main);
}

.experience .skills-used {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.experience:nth-child(odd) .skills-used {
    justify-content: flex-end;
}

.experience .skill-tag {
    background-color: rgba(139, 0, 0, 0.15);
    border: 1px solid var(--accent-color);
    color: var(--text-main);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* Projects section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 0 10px;
}

.project-card {
    background-color: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, border-color 0.3s ease;
    border: 1px solid #333;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
}

.project-preview {
    height: 180px;
    background-color: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #333;
}

.project-preview svg {
    width: 64px;
    height: 64px;
    fill: var(--text-muted);
    transition: fill 0.3s ease;
}

.project-card:hover .project-preview svg {
    fill: var(--accent-color);
}

.project-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    color: var(--white);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.6;
}

.project-tags {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tags span {
    font-size: 0.75rem;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 2px 8px;
    border-radius: 12px;
}

/* Contact section */
#contact {
    padding-bottom: 50px;
}

footer {
    background-color: var(--surface-color);
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid #333;
    margin-top: 0;
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--accent-color);
}

/* Form styles */
form {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

form input, form textarea {
    display: block;
    margin-bottom: 20px;
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--white);
    transition: border-color 0.3s;
}

form textarea {
    resize: none;
    overflow-y: auto;
    height: 150px;
}

form input:focus, form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

form button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
}

form button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

/* Styles pour la gestion des langues */
html[lang="en"] .lang-fr { display: none !important; }
html[lang="fr"] .lang-en { display: none !important; }

/* Styles du menu déroulant de langue */
.lang-dropdown { position: relative; display: inline-block; margin-left: 15px; vertical-align: middle; }
.lang-dropbtn { background: none; border: none; cursor: pointer; padding: 5px; display: flex; align-items: center; }
.lang-dropbtn svg { width: 20px; height: 20px; fill: var(--text-main); transition: transform 0.3s ease, fill 0.3s; margin-left: 5px; }
.lang-dropbtn.active svg { transform: rotate(180deg); }
.lang-dropbtn:hover svg { fill: var(--accent-color); }
.lang-content { display: none; position: absolute; right: 0; background-color: var(--surface-color); min-width: 160px; box-shadow: var(--shadow); z-index: 1000; border-radius: 4px; border: 1px solid #333; }
.lang-content a { color: var(--text-main); padding: 12px 16px; text-decoration: none; display: block; cursor: pointer; text-align: left; font-size: 14px; margin-left: 0; }
.lang-content a::after { content: none !important; }
.lang-content a:hover { background-color: #333; color: var(--accent-color); }
.show { display: block; }

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-main);
}

.menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
.menu-toggle.is-active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Responsive Timeline */
@media screen and (max-width: 768px) {
    .timeline::before { left: 30px; }
    .experience { width: 100%; padding-left: 70px; padding-right: 25px; text-align: left !important; }
    .experience:nth-child(odd) .skills-used { justify-content: flex-start; }
    .experience:nth-child(even) { left: 0; }
    .experience::after { left: 23px !important; right: auto !important; }
    .navbar { padding: 15px 20px; }
    
    /* Mobile Navbar Styles */
    .menu-toggle { display: block; cursor: pointer; }
    .right-align {
        display: flex;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-20px);
        transition: all 0.3s ease-in-out;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(18, 18, 18, 0.98);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        border-top: 1px solid #333;
        box-shadow: 0 10px 10px rgba(0,0,0,0.5);
    }
    .right-align.active { 
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
    }
    .navbar a { margin: 15px 0; font-size: 1.2rem; }
    .lang-dropdown { margin-left: 0; margin-top: 10px; }
    .lang-content { right: auto; left: 50%; transform: translateX(-50%); }
    #nom { font-size: 1.2rem; }
}

/* Social Media Icons */
.social-icon {
    display: inline-block;
    margin: 15px 5px;
    color: var(--text-main);
    transition: transform 0.3s, color 0.3s;
}
.social-icon svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}
.social-icon:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

.social-container {
    text-align: center;
    margin-top: 30px;
}

/* Modal styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.8); 
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: var(--surface-color);
    margin: 10% auto; 
    padding: 40px;
    border: 1px solid #333;
    width: 80%; 
    max-width: 800px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    position: relative;
    color: var(--text-main);
    animation: slideIn 0.3s ease-out;
}

.modal-content h3 {
    font-size: 1.2rem;
    margin-top: 25px;
    margin-bottom: 10px;
    color: var(--white);
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.modal-content p {
    margin-bottom: 15px;
    color: var(--text-muted);
}

.modal-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
    list-style-type: disc;
    color: var(--text-muted);
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

.modal.hide {
    animation: fadeOut 0.3s ease-in forwards;
}

.modal.hide .modal-content {
    animation: slideOut 0.3s ease-in forwards;
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--accent-color);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 20px;
    transition: background-color 0.3s, transform 0.2s;
}

.modal-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    color: var(--white);
}

.modal-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}