@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0a66c2;
    --primary-dark: #084f95;
    --secondary: #2d2d2d;
    --light-gray: #f7f7f8;
    --medium-gray: #e5e5e5;
    --dark-gray: #666;
    --text: #1a1a1a;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
}

/* Dark Mode Variables */
:root.dark-mode {
    --primary: #1a73e8;
    --primary-dark: #0c47a1;
    --secondary: #121212;
    --light-gray: #1e1e1e;
    --medium-gray: #2c2c2c;
    --dark-gray: #b3b3b3;
    --text: #e0e0e0;
    --white: #121212;
    --shadow: 0 4px 20px rgba(0,0,0,0.5);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.7);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light-gray);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

/* NAVIGATION AMÉLIORÉE */
nav {
    background: var(--white);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

nav.scrolled {
    transform: translateY(-10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), #0077b5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text);
}

/* Dark Mode Toggle Switch */
.theme-toggle {
    position: relative;
    width: 50px;
    height: 25px;
    background: var(--medium-gray);
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    padding: 0 5px;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    transition: transform 0.3s ease, background 0.3s ease;
    transform: translateX(0);
}

.theme-toggle.dark-mode {
    background: var(--primary);
}

.theme-toggle.dark-mode::before {
    transform: translateX(25px);
    background: var(--primary-dark);
}

/* Animation pour le bouton thème */
.theme-toggle.rotating {
    animation: spinTheme 0.6s ease-in-out;
}

@keyframes spinTheme {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* SECTION ACCUEIL AMÉLIORÉE */
#accueil {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

#accueil::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(10,102,194,0.05) 0%, transparent 70%);
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(30px, 30px) rotate(180deg); }
}

.profile-pic {
    width: 180px; /* Increased size */
    height: 180px; /* Increased size */
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, var(--primary), #0077b5);
    color: white;
    font-size: 3.5rem;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(10,102,194,0.3);
    animation: fadeInUp 0.8s ease;
    position: relative;
    z-index: 1;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#accueil h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease 0.2s backwards;
    letter-spacing: -1px;
    white-space: nowrap; /* Ensure name stays on one line */
}

.subtitle {
    font-size: 1.5rem;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease 0.4s backwards;
    font-weight: 500;
}

.description {
    max-width: 700px;
    margin: 0 auto 3rem;
    color: var(--dark-gray);
    font-size: 1.1rem;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease 0.6s backwards;
}

/* BOUTONS AMÉLIORÉS */
.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.8s backwards;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #0077b5);
    color: white;
    box-shadow: 0 4px 15px rgba(10,102,194,0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(10,102,194,0.4);
}

.btn-secondary {
    background: var(--white);
    color: var(--text);
    border: 2px solid var(--medium-gray);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* SOCIAL LINKS HERO SECTION */
.hero-social {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 3rem;
    animation: fadeInUp 0.8s ease 1s backwards;
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    font-size: 1.3rem;
}

.social-icon:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.social-icon.linkedin:hover {
    background: var(--primary);
    color: white;
}

.social-icon.github:hover {
    background: #333;
    color: white;
}

.social-icon.cv:hover {
    background: #28a745;
    color: white;
}

/* CONTAINERS */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

section {
    position: relative;
}

section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary), #0077b5);
    border-radius: 2px;
}

/* CARDS AMÉLIORÉES */
.card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary), #0077b5);
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card:hover::before {
    opacity: 1;
}

/* À PROPOS */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.goal-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.goal-item:hover {
    background: var(--light-gray);
    transform: translateX(5px);
}

.goal-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
    flex-shrink: 0;
}

/* FORMATION */
.formation-item {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.formation-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-hover);
}

.formation-icon {
    background: linear-gradient(135deg, var(--primary), #0077b5);
    padding: 1rem;
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* COMPÉTENCES */
.competences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-tag {
    background: var(--light-gray);
    color: var(--text);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
    margin: 0.5rem 0.3rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.skill-tag:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
    border-color: var(--primary);
}

/* PROJETS */
.projets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.projet-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.projet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10,102,194,0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.projet-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.projet-card:hover::before {
    opacity: 1;
}

/* Projet en vedette */
.featured-project {
    position: relative;
    border: 2px solid var(--primary);
    box-shadow: 0 0 30px rgba(26, 115, 232, 0.2), var(--shadow);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(26, 115, 232, 0.2), var(--shadow);
    }
    50% {
        box-shadow: 0 0 50px rgba(26, 115, 232, 0.4), var(--shadow-hover);
    }
}

.featured-project:hover {
    transform: translateY(-12px);
    box-shadow: 0 0 60px rgba(26, 115, 232, 0.5), var(--shadow-hover);
}

.project-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary), #0077b5);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

.projet-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    text-decoration: none;
    color: var(--primary);     /* couleur visible du texte */
    font-weight: 600;
    cursor: pointer;           /* montre que c'est cliquable */
    transition: all 0.3s ease;
    pointer-events: auto;      /* assure que le lien reçoit les clics */
    position: relative;        /* évite que d'autres éléments recouvrent le lien */
    z-index: 1;                /* priorise le lien au-dessus d'éléments voisins */
}

.projet-link:hover {
    gap: 1rem;
    color: var(--primary-dark);
}


/* Style for clickable project keywords */
.projet-card .tech-tag {
    background: var(--light-gray);
    color: var(--primary);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    margin: 0.5rem 0.3rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.projet-card .tech-tag:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
    border-color: var(--primary);
}

/* CONTACT AMÉLIORÉ */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: var(--light-gray);
    transform: translateX(5px);
}

.contact-icon {
    background: linear-gradient(135deg, var(--primary), #0077b5);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Beautify clickable links in contact section */
.contact-item .value a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    transition: color 0.3s ease, transform 0.3s ease;
}

.contact-item .value a:hover {
    color: var(--primary-dark);
    transform: scale(1.05);
}

.contact-item .value a:visited {
    color: var(--dark-gray);
}

/* SOCIAL LINKS SECTION */
.social-section {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.social-links-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    background: var(--light-gray);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.social-link:hover::before {
    transform: scaleY(1);
}

.social-link.linkedin:hover {
    background: rgba(10,102,194,0.1);
    color: var(--primary);
}

.social-link.github:hover {
    background: rgba(51,51,51,0.1);
    color: #333;
}

.social-link-icon {
    font-size: 1.5rem;
}

.social-section h3 {
    position: relative;
    display: inline-block;
}

.social-section h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.social-section h3:hover::after {
    width: 100%;
}

/* MODAL CV AMÉLIORÉE */
.cv-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cv-modal.active {
    display: block;
}

.cv-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.cv-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    height: 90%;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.cv-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.cv-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #ff4d4d, #cc0000);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.cv-close:hover {
    transform: rotate(90deg);
    box-shadow: 0 4px 15px rgba(255,77,77,0.4);
}

/* FOOTER */
footer {
    background: linear-gradient(135deg, var(--secondary), #1a1a1a);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 5rem;
}

/* RESPONSIVE */
@media (max-width: 800px) {
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        display: none;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    #accueil h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    section h2 {
        font-size: 2rem;
    }

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }
}
