/*
 * CV Personnel - Styles
 * Auteur: Anthony SEYS
 * GitHub: https://github.com/AnthoGit62
 * LinkedIn: https://www.linkedin.com/in/anthony-seys-565180300
 * Date: Février 2024
 */

/* ========================================
   1. VARIABLES CSS & CONFIGURATION
======================================== */

:root {
    /* Couleurs */
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --background-color: #ffffff;
    --text-color: #1f2937;
    --accent-color: #dbeafe;
    --bg-color-light: #f9fafb;
    
    /* Animations */
    --transition: all 0.3s ease;
    --animation-duration: 0.4s;
    
    /* Espacements */
    --section-padding: 5rem 10%;
    --navbar-height: 90px;
    
    /* Tailles */
    --border-radius: 15px;
    --small-border-radius: 10px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Thème sombre */
[data-theme="dark"] {
    --background-color: #0f172a;
    --text-color: #f1f5f9;
    --accent-color: #1e293b;
    --bg-color-light: #334155;
}

/* ========================================
   2. RESET & BASE
======================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

/* ========================================
   3. NAVIGATION
======================================== */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 10%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links a {
    margin-left: 2rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Bouton toggle mobile */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

.nav-toggle:hover {
    color: var(--accent-color);
}

/* Bouton thème */
.theme-toggle {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--accent-color);
}

.theme-toggle i {
    font-size: 1.2rem;
    color: var(--text-color);
}

/* Conteneur pour le thème et la langue */
.nav-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; /* Espace entre le bouton de thème et les boutons de langue */
}

/* Conteneur des boutons de langue */
.language-switcher {
    display: flex;
    gap: 5px; /* Espace entre les boutons de langue */
    background-color: var(--bg-color-light); /* Fond légèrement différent */
    padding: 4px;
    border-radius: 20px; /* Bordures arrondies pour l'ensemble */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Style de base pour chaque bouton de langue */
.lang-selector {
    background-color: transparent;
    border: none;
    color: var(--text-color-secondary);
    padding: 6px 12px;
    border-radius: 16px; /* Bordures arrondies pour chaque bouton */
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Style au survol */
.lang-selector:hover {
    color: var(--primary-color);
}

/* Style pour le bouton de la langue active */
.lang-selector.active {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* ========================================
   4. SECTIONS PRINCIPALES
======================================== */

/* Configuration générale des sections */
.about,
.experiences,
.formation,
.certifications {
    scroll-margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
    padding: var(--section-padding);
    padding-top: var(--navbar-height);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

section > h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 0 10%;
}

.hero-content {
    text-align: center;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

/* Boutons CTA */
.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.cta-primary,
.cta-secondary {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.cta-primary {
    background: var(--primary-color);
    color: white;
}

.cta-secondary {
    background: var(--accent-color);
    color: var(--text-color);
}

/* ========================================
   5. SECTION PROJETS
======================================== */

.projects {
    scroll-margin-top: 100px;
    min-height: calc(100vh - 100px);
    padding-top: var(--navbar-height);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 5rem;
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.project-item {
    position: relative;
    height: 400px;
    cursor: pointer;
}

/* Styles desktop pour les projets */
@media (min-width: 769px) {
    .project-item {
        perspective: 1000px;
    }

    .project-inner {
        position: relative;
        width: 100%;
        height: 100%;
        text-align: center;
        transition: transform 0.8s;
        transform-style: preserve-3d;
    }

    .project-item:hover .project-inner {
        transform: rotateY(180deg);
    }

    .project-front, 
    .project-back {
        position: absolute;
        width: 100%;
        height: 100%;
        backface-visibility: hidden;
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem;
    }

    .project-back {
        transform: rotateY(180deg);
    }
}

/* Contenu des projets */
.project-front {
    background: var(--accent-color);
    color: var(--text-color);
}

.project-back {
    background: var(--primary-color);
    color: white;
}

.project-content {
    width: 100%;
}

.project-content i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.project-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.project-content p {
    font-size: 1.1rem;
    opacity: 0.8;
}

.project-details {
    width: 100%;
}

.project-details h4 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.project-details ul {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
}

.project-details li {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.project-link {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
}

.project-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

/* ========================================
   6. SECTION À PROPOS
======================================== */

.about {
    background: var(--accent-color);
}

.about-content p {
    margin-bottom: 2rem;
    line-height: 1.8;
}

.skills {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.skill-category {
    background: var(--background-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.skill-category h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

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

.skill {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    background: var(--accent-color);
    border-radius: var(--small-border-radius);
    transition: var(--transition);
}

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

.skill:hover {
    transform: translateY(-5px);
    background: var(--primary-color);
    color: white;
}

.skill:hover i {
    color: white;
}

/* ========================================
   7. SECTION EXPÉRIENCES
======================================== */

.experiences {
    margin: 40px 0;
    text-align: center;
}

.slider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.slider-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--primary-color);
    transition: var(--transition);
}

.slider-btn:hover {
    color: #007bff;
}

.experience-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 40px 48px;
    min-width: 380px;
    max-width: 520px;
    margin: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow 0.2s, opacity var(--animation-duration), transform var(--animation-duration);
    font-size: 1.15rem;
}

.experience-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Animations du slider */
.experience-card.slide-out-left {
    opacity: 0;
    transform: translateX(-60px);
}

.experience-card.slide-out-right {
    opacity: 0;
    transform: translateX(60px);
}

.experience-card.slide-in-left {
    opacity: 1;
    transform: translateX(0);
    animation: slideInLeft var(--animation-duration);
}

.experience-card.slide-in-right {
    opacity: 1;
    transform: translateX(0);
    animation: slideInRight var(--animation-duration);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.exp-logo {
    width: 90px;
    height: 90px;
    margin-bottom: 18px;
}

.exp-date {
    font-size: 1.1em;
    margin-bottom: 1rem;
}

/* ========================================
   8. SECTION FORMATION
======================================== */

.formation {
    background: var(--background-color);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem 0;
}

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

.timeline-item {
    padding: 1rem;
    position: relative;
    width: 50%;
    margin-bottom: 2rem;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 3rem;
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    top: 0;
}

.timeline-item:nth-child(odd)::before {
    right: -10px;
}

.timeline-item:nth-child(even)::before {
    left: -10px;
}

.timeline-item .date {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.timeline-item .content {
    background: var(--accent-color);
    padding: 1.5rem;
    border-radius: var(--small-border-radius);
    box-shadow: var(--box-shadow);
}

.timeline-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.formation-details,
.project-features {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.formation-details li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.formation-details li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.project-features li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.project-features li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.project-highlight {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.project-highlight h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* ========================================
   9. SECTION CERTIFICATIONS
======================================== */

.certifications {
    text-align: center;
}

.certifications-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem auto;
    max-width: 800px;
}

.certification-card {
    background: var(--background-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.certification-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--box-shadow-hover);
}

.cert-logo {
    width: 200px;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
}

.certification-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.certification-card p {
    margin-bottom: 0.8rem;
    color: var(--text-color);
    font-size: 1.1rem;
}

.cv-download {
    text-align: center;
    margin-top: 3rem;
}

.cv-download .cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cv-download i {
    font-size: 1.2rem;
}

/* ========================================
   10. FOOTER
======================================== */

footer {
    background: var(--accent-color);
    padding: 2rem 10%;
    text-align: center;
}

.social-links {
    margin-bottom: 1rem;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    margin: 0 1rem;
    transition: var(--transition);
}

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

.footer-link {
    color: inherit;
    text-decoration: none;
}

.footer-link:visited {
    color: inherit;
}

/* ========================================
   11. THÈME SOMBRE
======================================== */

/* Boutons de langue en mode sombre */
[data-theme="dark"] .language-switcher {
    background-color: var(--bg-color-light);
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .lang-selector {
    color: var(--text-color);
}

[data-theme="dark"] .lang-selector:hover {
    color: var(--secondary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .lang-selector.active {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Navbar en mode sombre */
[data-theme="dark"] .navbar {
    background-color: rgba(15, 23, 42, 0.9);
}

[data-theme="dark"] .experience-card {
    background: var(--accent-color);
    color: var(--text-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .experience-card:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .exp-logo {
    filter: brightness(0.8);
}

/* ========================================
   12. RESPONSIVE DESIGN
======================================== */

/* Tablettes et mobiles */
@media (max-width: 768px) {
    .nav-toggle {
        display: block !important; /* Force l'affichage */
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--primary-color);
        cursor: pointer;
        padding: 0.5rem;
        transition: var(--transition);
    }

    .nav-toggle:hover {
        color: var(--secondary-color);
    }

    /* Navbar cachée par défaut */
    .navbar {
        padding: 1rem 5%;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        transition: transform 0.3s ease;
        transform: translateY(-100%);
    }

    /* Navbar visible */
    .navbar.visible {
        transform: translateY(0);
    }

    /* Ajuster le padding des sections pour l'espace navbar */
    .about,
    .experiences,
    .formation,
    .certifications {
        padding-top: 2rem;
        scroll-margin-top: 2rem;
    }

    /* Quand la navbar est visible, ajuster le scroll */
    .navbar.visible ~ main .about,
    .navbar.visible ~ main .experiences,
    .navbar.visible ~ main .formation,
    .navbar.visible ~ main .certifications {
        padding-top: var(--navbar-height);
        scroll-margin-top: var(--navbar-height);
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        width: 100%;
    }

    .nav-links a {
        margin: 0;
        padding: 0.5rem 1rem;
        background: var(--accent-color);
        border-radius: 20px;
    }

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

    /* Projets mobile */
    .projects-container {
        grid-template-columns: 1fr;
    }

    .project-item {
        height: auto;
    }

    .project-front, 
    .project-back {
        width: 100%;
        min-height: 300px;
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
        padding: 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: opacity 0.3s ease;
    }

    .project-back {
        display: none;
        opacity: 0;
    }

    .project-item.active .project-front {
        display: none;
    }

    .project-item.active .project-back {
        display: flex;
        opacity: 1;
    }

    .project-link {
        position: relative;
        z-index: 100;
        display: inline-block;
        padding: 0.5rem 1rem;
        background: var(--primary-color);
        color: white;
        text-decoration: none;
        border-radius: 5px;
        margin-top: 1rem;
        transition: var(--transition);
    }

    .project-link:hover {
        background: var(--accent-color);
        transform: translateY(-2px);
    }

    .project-details {
        pointer-events: none;
    }

    .project-details > * {
        pointer-events: auto;
    }

    /* Expériences mobile */
    .experience-card {
        min-width: 280px;
        max-width: 75vw;
        padding: 20px 16px;
        font-size: 0.95rem;
        margin: 0 10px;
    }

    .exp-logo {
        width: 50px;
        height: 50px;
    }

    .slider-container {
        gap: 8px;
        padding: 0 10px;
    }

    .slider-btn {
        font-size: 1.6rem;
        padding: 8px;
    }
    
    /* Timeline mobile */
    .timeline::before {
        left: 0;
    }

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

    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
        padding-right: 0;
        padding-left: 2rem;
    }

    .timeline-item::before {
        left: -9px !important;
    }

    .project-highlight {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }

    /* Autres ajustements mobile */
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .certification-card {
        padding: 1rem;
    }

    .cert-logo {
        width: 150px;
    }

    .certification-card h3 {
        font-size: 1.5rem;
    }
}

/* Mobiles */
@media (max-width: 480px) {
    .nav-toggle {
        font-size: 1.3rem;
        padding: 0.4rem;
        top: 0.8rem;
        left: 0.8rem;
    }

    .navbar {
        padding: 1rem 3%;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .nav-links a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .project-content i {
        font-size: 2.5rem;
    }

    .cert-logo {
        width: 120px;
    }
}

/* Styles alternance */
.alternance-highlight {
    background: linear-gradient(90deg, #0077b6 0%, #00b4d8 100%);
    color: #fff;
    padding: 0.7em 1.2em;
    border-radius: 1.5em;
    font-weight: 600;
    font-size: 1.15em;
    display: inline-block;
    margin: 0.7em 0 0.7em 0;
    box-shadow: 0 2px 12px rgba(0, 123, 255, 0.08);
    letter-spacing: 0.5px;
    transition: transform 0.2s;
}

.alternance-highlight:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.15);
}
