/* ========================================
   VARIABLES CSS - THÈMES CLAIR ET SOMBRE
   ======================================== */

:root {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --shadow: rgba(0, 0, 0, 0.1);
    --border: #e0e0e0;
    --hover-bg: rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-primary: #8b9eff;
    --accent-secondary: #9d6bc2;
    --shadow: rgba(0, 0, 0, 0.3);
    --border: #404040;
    --hover-bg: rgba(139, 158, 255, 0.1);
}

/* ========================================
   RESET & BASE
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */

.container {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   SIDEBAR (NAVIGATION LATÉRALE)
   ======================================== */

.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    padding: 2rem 1.5rem;
    box-shadow: 2px 0 10px var(--shadow);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease, background-color 0.3s ease;
    z-index: 1000;
}

.profile {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 4px solid var(--accent-primary);
    box-shadow: 0 4px 10px var(--shadow);
}

.profile h1 {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.role {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Navigation */
.nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s, color 0.3s;
    font-weight: 500;
}

.nav a:hover {
    background: var(--hover-bg);
    color: var(--accent-primary);
}

.nav a.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.nav a i {
    font-size: 1.1rem;
}

/* Contact Info dans Sidebar */
.contact-small {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
}

.contact-small div {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-small i {
    color: var(--accent-primary);
}

.contact-small a {
    color: var(--text-secondary);
    text-decoration: none;
}

.contact-small a:hover {
    color: var(--accent-primary);
}

/* Download Section */
.download-section {
    margin-top: 1rem;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main {
    margin-left: 280px;
    flex: 1;
    padding: 2rem;
    width: 100%;
    max-width: 1200px;
}

/* ========================================
   TOPBAR
   ======================================== */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.topbar h2 {
    font-size: 2rem;
    color: var(--accent-primary);
    margin: 0;
}

.muted {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    font-size: 0.95rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.icon-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    width: 45px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: all 0.3s;
}

.icon-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

#burgerBtn {
    display: none;
}

/* ========================================
   CARDS & SECTIONS
   ======================================== */

.card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow);
    margin-bottom: 2rem;
    transition: background-color 0.3s ease;
}

.card h3 {
    color: var(--accent-primary);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h4 {
    color: var(--accent-primary);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 12px;
}

.hero h3 {
    color: white;
    font-size: 2rem;
}

/* Highlights Grid */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.grid-3 > div {
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 8px;
    transition: transform 0.3s;
}

.grid-3 > div:hover {
    transform: translateY(-5px);
}

.grid-3 h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.grid-3 i {
    font-size: 1.3rem;
}

.projets-grille {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
     gap: 30px;
     margin-top: 40px;
}
 .projet-carte {
     background-color: var(--couleur-blanc);
     border-radius: 10px;
     overflow: hidden;
     box-shadow: 0 3px 10px rgba(0,0,0,0.1);
     transition: transform 0.3s, box-shadow 0.3s;
}
 .projet-carte:hover {
     transform: translateY(-5px);
     box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}
 .projet-contenu {
     padding: 25px;
}
 .projet-carte h3 {
     color: var(--couleur-principale);
     margin-bottom: 15px;
}
 .projet-technos {
     display: flex;
     gap: 10px;
     flex-wrap: wrap;
     margin-top: 15px;
}
 .techno-badge {
     background-color: var(--couleur-secondaire);
     color: var(--couleur-blanc);
     padding: 5px 12px;
     border-radius: 20px;
     font-size: 0.85rem;
}
/* ============================================ SECTION CONTACT ============================================ */
 .contact-info {
     max-width: 600px;
     margin: 40px auto;
     background-color: var(--couleur-blanc);
     padding: 40px;
     border-radius: 10px;
}
 .contact-item {
     display: flex;
     align-items: center;
     gap: 15px;
     margin-bottom: 20px;
     padding: 15px;
     background-color: var(--couleur-fond);
     border-radius: 8px;
     font-family: Arial, sans-serif;
     font-size: 16px;
}
 .contact-item strong {
     color: var(--couleur-principale);
     min-width: 100px;
     margin-right: 5px;
}
 .contact-item a {
     color: #3498db;
     text-decoration: none;
}
 .contact-item a:hover {
     text-decoration: underline;
}
 .contact-item input#phone {
     border: none;
     background: none;
     font: inherit;
     padding: 0;
     cursor: pointer;
     color: #3498db;
     text-decoration: underline;
}
 .contact-item input#phone:hover {
     color: #3498db;
}
/* ============================================ SECTION CV ============================================ */
 .pdf-grille {
     display: flex;
     justify-content: center;
     gap: 50px;
     flex-wrap: wrap;
}
 .pdf-item {
     background-color: var(--couleur-blanc);
     padding: 85px;
     border-radius: 10px;
     box-shadow: 0 3px 10px rgba(0,0,0,0.1);
     display: flex;
     flex-direction: column;
     align-items: right;
     max-width: 550px;
     width: 100%;
}

 .pdf-embed {
     width: 100%;
     height: 800px;
     border: none;
     background: transparent;
}
 .pdf-wrapper {
     display: flex;
     flex-direction: column;
     gap: 15px;
}
 .pdf-container {
     position: relative;
     width: 100%;
     height: 600px;
     border-radius: 8px;
     overflow: hidden;
     cursor: pointer;
     box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
     transition: transform 0.3s, box-shadow 0.3s;
}
 
/* ========================================
   COMPÉTENCES
   ======================================== */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.skill-item h4 {
    margin-bottom: 1rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--accent-primary);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: transform 0.2s;
}

.tag:hover {
    transform: scale(1.05);
}

/* ========================================
   PROJETS
   ======================================== */

.projects-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-preview {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-preview:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px var(--shadow);
}

.project-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 12px;
    flex-shrink: 0;
}

.project-preview h4 {
    margin: 0;
    font-size: 1.1rem;
}

.projects-list .project {
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-primary);
}

.project h3 {
    color: var(--accent-primary);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-style: italic;
}

/* ========================================
   CV SECTIONS
   ======================================== */

.contact-info {
    list-style: none;
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.contact-info i {
    color: var(--accent-primary);
    width: 20px;
}

.contact-info a {
    color: var(--text-primary);
    text-decoration: none;
}

.contact-info a:hover {
    color: var(--accent-primary);
}

.card ul {
    margin-left: 1.5rem;
}

.card ul li {
    margin-bottom: 0.75rem;
}

/* ========================================
   LETTRE DE MOTIVATION
   ======================================== */

.lettre p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

/* ========================================
   CERTIFICATIONS
   ======================================== */

.certs ul {
    list-style: none;
    margin: 0;
}

.certs li {
    background: var(--bg-primary);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-primary);
}

/* ========================================
   FORMULAIRE DE CONTACT
   ======================================== */

.contact-form {
    max-width: 600px;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.9rem;
    margin-bottom: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================================
   NAVIGATION MOBILE (BOTTOM BAR)
   ======================================== */

.mobile-bottom {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 2px solid var(--border);
    padding: 0.75rem;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 10px var(--shadow);
}

.mobile-bottom a {
    color: var(--text-primary);
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
    text-decoration: none;
}

.mobile-bottom a:hover,
.mobile-bottom a.active {
    color: var(--accent-primary);
    background: var(--hover-bg);
}

/* ========================================
   IMPRESSION (PDF)
   ======================================== */

@media print {
    body {
        background: white;
        color: black;
    }

    .sidebar,
    .topbar .controls,
    .mobile-bottom,
    .download-section,
    #burgerBtn,
    #themeToggle {
        display: none !important;
    }

    .main {
        margin-left: 0;
        max-width: 100%;
    }

    .card {
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* ========================================
   RESPONSIVE - TABLETTE
   ======================================== */

@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }

    .main {
        margin-left: 250px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
        padding: 1.5rem 1rem;
        padding-bottom: 5rem;
    }

    #burgerBtn {
        display: flex;
    }

    .mobile-bottom {
        display: flex;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .controls {
        width: 100%;
        justify-content: space-between;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 2rem 1.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .project-preview {
        flex-direction: column;
        text-align: center;
    }

    .contact-form {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .topbar h2 {
        font-size: 1.5rem;
    }

    .card h3 {
        font-size: 1.3rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .avatar-img {
        width: 100px;
        height: 100px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.5s ease-out;
}