/* --- style.css --- */

/* =========================================
   1. CONFIGURATION GLOBALE (VARIABLES)
   ========================================= */
:root {
    --bg-dark: #0b1120;       /* Fond très sombre */
    --bg-panel: #1e293b;      /* Fond des cartes */
    --primary: #38bdf8;       /* Bleu Cyber (Cyan) */
    --primary-glow: rgba(56, 189, 248, 0.4);
    --secondary: #8b5cf6;     /* Violet */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --font-ui: 'Inter', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-dark);
    /* Grille Cybernétique en fond */
    background-image:
            linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center top;

    color: var(--text-main);
    font-family: var(--font-ui);
    line-height: 1.6;
    margin: 0;
    overflow-x: hidden;
}

/* --- Scrollbar Design --- */
::-webkit-scrollbar {
    width: 9px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
a:hover { color: var(--primary); }
ul { list-style: none; padding: 0; margin: 0; }

/* =========================================
   2. LAYOUT GLOBAL
   ========================================= */
.app-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Lueur d'ambiance (Glow) en arrière-plan */
.app-wrapper::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 60% 40%, rgba(56, 189, 248, 0.06) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* =========================================
   SIDEBAR (NOUVEAU DESIGN)
   ========================================= */

/* Le panneau principal */
.sidebar-panel {
    background: rgba(15, 23, 42, 0.8); /* Fond sombre semi-opaque */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Avatar Profil */
.profile-avatar-container {
    position: relative;
    width: 140px;
    height: 140px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 3px solid var(--primary);
    padding: 3px; /* Espace entre border et image */
    background: var(--bg-dark);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.status-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    background-color: #22c55e;
    border: 3px solid var(--bg-dark);
    border-radius: 50%;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Badge Rôle */
.job-pill {
    display: inline-block;
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-family: var(--font-code);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Cartes de Statut (BPCE / BUT) */
.status-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: 0.3s ease;
}

.status-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Boutons Contact */
.contact-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--text-main);
    transition: all 0.2s ease;
    text-decoration: none;
    display: block; /* Important pour le width */
}

/* Spécifique pour l'email : centrage et colonne */
.contact-btn:not(.d-flex) {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

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

.social-btn:hover i {
    color: #fff;
}

/* Icon wrapper pour tel */
.icon-wrapper {
    width: 30px;
    display: flex;
    justify-content: center;
    color: var(--primary);
}

/* Responsiveness tweaks */
@media (max-width: 991px) {
    .sidebar-panel {
        /* Sur mobile, on enlève le sticky ou on l'adapte */
        margin-bottom: 2rem;
    }
}

/* --- Animation Avatar 360 Aller-Retour --- */

/* Rend l'image cliquable visuellement */
.profile-avatar {
    cursor: pointer;
    transition: transform 0.3s ease; /* Pour les petits effets de survol existants */
}

/* La classe qui sera ajoutée par le JS lors du clic */
.spin-trigger {
    animation: spinBackAndForth 1.2s cubic-bezier(0.45, 0, 0.55, 1);
}

/* Définition du mouvement : 0 -> 360 -> 0 */
@keyframes spinBackAndForth {
    0% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(360deg); /* Tour complet sens horaire */
    }
    100% {
        transform: rotate(0deg); /* Retour complet sens anti-horaire */
    }
}

/* Navbar Mobile */
.nav-profile-img {
    object-fit: cover;
    border: 2px solid var(--primary);
}

.nav-brand-text {
    font-family: var(--font-code);
    font-size: 0.9rem;
    font-weight: bold;
}

/* Offcanvas (Menu Mobile) */
#mobileMenu {
    background-color: var(--bg-dark) !important;
}

.offcanvas-title-primary {
    color: var(--primary);
}

/* Cartes de Statut (Logos et Textes) */
.status-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Conteneur spécifique pour le logo école */
.logo-box-lg {
    width: 40px;
    height: 40px;
}

/* Utilitaires de texte */
.lh-1 {
    line-height: 1;
}

.text-xs {
    font-size: 0.6rem;
}

/* Contacts */
.email-text-mobile {
    font-size: 0.85rem;
}

.email-text-desktop {
    font-family: var(--font-code);
    font-size: 0.85rem;
    line-height: 1.2;
}

/* Sidebar PC Position */
.sidebar-sticky {
    top: 2rem;
    z-index: 10;
}

/* === STYLE MOBILE SPECIFIQUE === */

/* Navbar Mobile (Header) */
.mobile-nav {
    background: rgba(11, 17, 32, 0.9); /* Fond très sombre */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.navbar-toggler {
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.25);
}

/* Offcanvas (Menu Latéral Mobile) */
.offcanvas {
    background-color: var(--bg-dark) !important; /* Force le fond sombre */
}

.offcanvas-header .btn-close {
    opacity: 0.8;
}

/* Ajustements responsive */
@media (max-width: 991px) {
    /* Sur mobile, on retire la sidebar PC */
    .sidebar-container { display: none; }

    /* Le contenu principal prend toute la largeur mais garde du padding */
    .main-content {
        padding: 1.5rem 1rem;
    }

    /* Les titres de section un peu plus petits */
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
}

/* =========================================
   4. MAIN CONTENT
   ========================================= */
.main-content { padding: 3rem 4rem; }

.section-title {
    font-family: var(--font-code);
    font-size: 1.8rem;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}
.section-title i { color: var(--primary); }

/* Animation Fade In */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* --- Timeline --- */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 2rem;
    border-left: 2px solid var(--border);
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 5px;
    width: 16px;
    height: 16px;
    background: var(--bg-dark);
    border: 2px solid var(--secondary);
    border-radius: 50%;
}
.t-date { font-family: var(--font-code); color: var(--secondary); font-size: 0.85rem; }
.t-title { font-weight: 600; font-size: 1.1rem; margin: 0.2rem 0; }
.t-place { color: var(--text-muted); font-size: 0.9rem; font-style: italic; }

/* --- Cartes Expériences & Projets --- */
.exp-card, .project-box {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.exp-card:hover, .project-box:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(56, 189, 248, 0.25);
    background: rgba(30, 41, 59, 0.8);
}

.exp-header { display: flex; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.exp-role { font-weight: 700; font-size: 1.1rem; }
.exp-date { font-family: var(--font-code); font-size: 0.8rem; background: rgba(255,255,255,0.05); padding: 2px 8px; border-radius: 4px; }
.exp-company { color: var(--primary); font-size: 0.9rem; margin-top: 0.2rem; display: block; }
.exp-desc { font-size: 0.95rem; color: var(--text-muted); margin: 0; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.project-title { font-family: var(--font-code); color: var(--primary); font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.project-desc { font-size: 0.9rem; color: var(--text-muted); }

/* =========================================
   5. COMPÉTENCES (SKILLS)
   ========================================= */
.filter-container {
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-code);
    font-size: 0.85rem;
    transition: 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

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

.skill-item {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
}

.skill-item.hidden { display: none; }
.skill-item.anim-out { opacity: 0; transform: scale(0.8); }

.skill-item:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    background: rgba(56, 189, 248, 0.15);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.skill-icon {
    height: 40px;
    width: auto;
    max-width: 40px;
    object-fit: contain;
    margin-bottom: 0.8rem;
}

.skill-icon-font { font-size: 2.2rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.skill-name { font-family: var(--font-code); font-size: 0.75rem; color: var(--text-muted); }

/* Animation Saut (JS) */
@keyframes littleJump {
    0% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}
.animate-jump { animation: littleJump 0.6s ease-in-out; }

/* =========================================
   6. INTÉRÊTS & FOOTER
   ========================================= */
.hobbies-wrapper { display: flex; flex-wrap: wrap; gap: 1rem; }
.hobby-tag {
    background: var(--bg-panel);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}
.hobby-tag i, .hobby-tag img { color: var(--secondary); height: 20px; width: auto; font-size: 1.1rem; }
.hobby-tag:hover { border-color: var(--secondary); }

.footer { border-top: 1px solid var(--border); margin-top: 4rem; padding-top: 2rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* =========================================
   7. RESPONSIVE
   ========================================= */
@media (max-width: 991px) {
    .sidebar-container { padding: 1rem; min-height: auto; }
    .sidebar-glass { padding: 1.5rem; }
    .contact-grid { flex-direction: row; flex-wrap: wrap; }
    .contact-btn { flex: 1; }
    .full-width { width: 100%; }
    .main-content { padding: 2rem 1rem; }
    .section-title { font-size: 1.5rem; }
}