/* =========================================
   1. VARIABLES & THEMES
   ========================================= */
:root {
    /* --- DARK MODE (Défaut) --- */
    --bg-body: #050b14;
    --text-main: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8; /* Cyan Néon */
    
    /* Glassmorphism */
    --glass-bg: rgba(15, 23, 42, 0.4); 
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    --tag-bg: rgba(56, 189, 248, 0.1);
}

[data-theme="light"] {
    /* --- LIGHT MODE --- */
    --bg-body: #f0f2f5;
    --text-main: #1e293b;
    --text-secondary: #475569;
    --accent-color: #2563eb; /* Bleu Royal */
    
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    
    --tag-bg: rgba(37, 99, 235, 0.1);
}

/* =========================================
   2. BASE & RESET
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; transition: 0.3s ease; }

body { 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    height: 93vh; /* App-like fixed height */
    overflow: hidden; 
    display: flex; justify-content: center; align-items: center;
}

ul { list-style: none; }
a { text-decoration: none; color: inherit; }

/* Background Particles */
#particles-js { position: fixed; width: 100%; height: 100%; z-index: -1; }
[data-theme="light"] #particles-js { filter: invert(1); opacity: 0.4; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-color); }

/* =========================================
   3. GLOBAL LAYOUT
   ========================================= */
.layout-container {
    width: 95%; max-width: 1400px;
    height: 90vh; 
    display: grid;
    grid-template-columns: 350px 1fr; /* Sidebar | Content */
    gap: 1.5rem;
}

/* Glass Class */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    box-shadow: var(--shadow);
}

/* =========================================
   4. SIDEBAR PROFIL (Gauche)
   ========================================= */
.sidebar-profile {
    height: 100%;
    display: flex; flex-direction: column;
    overflow: hidden; 
    text-align: center; /* Centre tout le texte */
    position: relative;
}

.profile-content-wrapper {
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 2.5rem 2rem;
    display: flex; flex-direction: column; align-items: center;
    scrollbar-width: none;
}
.profile-content-wrapper::-webkit-scrollbar { display: none; }

/* Photo avec Glow */
.profile-img-container {
    width: 150px; height: 150px; 
    margin: 0 auto 1.5rem;
    border-radius: 50%; 
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.25);
    overflow: hidden; 
    transition: 0.3s;
}
.profile-img-container:hover { transform: scale(1.05); }
.profile-img-container img { width: 100%; height: 100%; object-fit: cover; }

/* Nom & Infos */
.profile-header h1 { 
    font-size: 2rem; margin-bottom: 0.5rem; font-weight: 700;
    background: linear-gradient(to right, var(--text-main), var(--accent-color));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    display: inline-block;
}

.typewriter { 
    font-size: 0.9rem; color: var(--accent-color); 
    height: 20px; margin-bottom: 1rem; 
    display: flex; justify-content: center;
}
.cursor { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

.school { font-size: 0.9rem; color: var(--text-secondary); margin-top: 5px; }
.school-name { font-size: 0.95rem; font-weight: 600; color: var(--text-main); }

.divider { 
    width: 80%; height: 1px; 
    background: radial-gradient(circle, var(--glass-border) 0%, transparent 100%); 
    margin: 1.5rem auto; border: none; 
}

/* Contacts Centrés & Stylisés */
.contact-details { width: 100%; display: flex; flex-direction: column; gap: 1rem; }

.contact-row { 
    display: flex; align-items: center; justify-content: center; gap: 10px; 
    color: var(--text-secondary); 
    padding: 12px 20px; 
    border-radius: 50px; /* Forme Pilule */
    background: rgba(255, 255, 255, 0.03); 
    border: 1px solid transparent;
    transition: 0.3s;
}
.contact-row:hover { 
    background: var(--tag-bg); 
    color: var(--accent-color); 
    border-color: var(--accent-color);
    transform: translateY(-2px); 
}

/* Footer Fixe (Bouton CV) */
.sidebar-footer { 
    padding: 1.5rem 2rem; 
    background: rgba(0,0,0,0.1); 
    border-top: 1px solid var(--glass-border);
}
.btn-glow {
    display: block; width: 100%; 
    padding: 1rem; 
    background: var(--accent-color);
    color: var(--bg-body); 
    border-radius: 50px; 
    font-weight: bold; border: none; cursor: pointer; text-align: center;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4); 
    transition: 0.3s;
}
.btn-glow:hover { transform: translateY(-3px); box-shadow: 0 0 30px rgba(56, 189, 248, 0.6); }

/* =========================================
   5. RIGHT PANEL (Navbar + Main)
   ========================================= */
.right-panel {
    display: flex; flex-direction: column; gap: 1.5rem;
    height: 100%; min-height: 0;
}

/* Navbar */
.top-nav {
    flex-shrink: 0; padding: 0 2rem; height: 80px; display: flex; align-items: center;
}
.nav-container {
    width: 100%; display: grid; 
    grid-template-columns: 1fr auto 1fr; align-items: center;
}

.nav-links { grid-column: 2; display: flex; gap: 3rem; }
.nav-links li { 
    cursor: pointer; font-weight: 600; color: var(--text-secondary); 
    position: relative; font-size: 1.1rem;
}
.nav-links li:hover, .nav-links li.active { color: var(--accent-color); }
.nav-links li.active::after {
    content: ''; position: absolute; bottom: -5px; left: 0; width: 100%; height: 3px;
    background: var(--accent-color); border-radius: 2px; 
    box-shadow: 0 0 10px var(--accent-color);
}

.nav-controls { grid-column: 3; justify-self: end; display: flex; gap: 10px; }
.control-item {
    background: transparent; border: 1px solid var(--glass-border);
    color: var(--text-main); padding: 8px 15px; border-radius: 12px; cursor: pointer;
}
.control-item:hover { border-color: var(--accent-color); color: var(--accent-color); }

/* Main Content Area */
.main-content {
    flex-grow: 1; overflow-y: auto; padding: 3rem; 
    position: relative; min-height: 0;
}

/* =========================================
   6. SECTIONS CONTENT
   ========================================= */
.tab-content { display: none; animation: fadeIn 0.5s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.card-title { font-size: 2.2rem; margin-bottom: 2rem; color: var(--text-main); }
.section-subtitle { font-size: 1.2rem; color: var(--accent-color); margin-bottom: 1.5rem; margin-top: 3rem; }

/* Status Box (Profile) */
.status-box {
    display: inline-flex; align-items: center; gap: 12px; 
    padding: 10px 20px; margin-top: 2rem;
    background: rgba(56, 189, 248, 0.05); border: 1px solid var(--glass-border);
    border-radius: 50px; color: var(--accent-color); font-size: 0.9rem; font-weight: 500;
}
.status-box:hover { background: rgba(56, 189, 248, 0.1); border-color: var(--accent-color); transform: translateY(-2px); }

.pulse-dot { position: relative; width: 10px; height: 10px; background-color: var(--accent-color); border-radius: 50%; }
.pulse-dot::before {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 10px; height: 10px; background-color: var(--accent-color); border-radius: 50%; opacity: 0.7;
    animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring { 0% { opacity: 0.7; transform: scale(1) translate(-50%,-50%); } 100% { opacity: 0; transform: scale(3) translate(-50%,-50%); } }

/* Education Timeline */
.education-section { margin-top: 3rem; }
.timeline { border-left: 2px solid var(--glass-border); margin-left: 10px; padding-left: 30px; position: relative; }
.timeline-item { position: relative; margin-bottom: 2.5rem; }
.timeline-dot {
    position: absolute; left: -37px; top: 5px; width: 14px; height: 14px;
    background: var(--accent-color); border-radius: 50%; box-shadow: 0 0 10px var(--accent-color);
}
.timeline-date { font-size: 0.9rem; color: var(--accent-color); font-weight: 600; margin-bottom: 5px; }
.timeline-content h4 { font-size: 1.1rem; color: var(--text-main); margin-bottom: 5px; }
.timeline-content p { color: var(--text-secondary); font-size: 0.95rem; }
.loc { font-size: 0.85rem; color: var(--text-secondary); font-style: italic; opacity: 0.7; }

/* Projects Grid */
.projects-list { display: grid; gap: 2rem; }
.project-item { padding-bottom: 2rem; border-bottom: 1px solid var(--glass-border); }
.project-item:last-child { border: none; }
.project-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 10px; }
.project-top h3 { color: var(--accent-color); font-size: 1.5rem; }
.badge { background: var(--glass-border); padding: 5px 15px; border-radius: 20px; font-size: 0.85rem; }
.tags { display: flex; gap: 10px; margin: 1rem 0; flex-wrap: wrap; }
.tags span { background: var(--tag-bg); color: var(--accent-color); padding: 5px 12px; border-radius: 8px; font-size: 0.9rem; }
.project-actions { display: flex; gap: 15px; }
.btn-sm { 
    padding: 8px 20px; border-radius: 8px; font-weight: 600; 
    display: flex; align-items: center; gap: 8px; font-size: 0.9rem; 
}
.btn-solid { background: var(--accent-color); color: var(--bg-body); }
.btn-outline { border: 1px solid var(--glass-border); color: var(--text-main); }
.btn-outline:hover { border-color: var(--accent-color); color: var(--accent-color); }

/* Skills Grid */
.skills-wrapper { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 1.5rem; }
.skill-box {
    aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.02); border: 1px solid var(--glass-border); border-radius: 20px; transition: 0.3s;
}
.skill-box:hover { background: var(--tag-bg); border-color: var(--accent-color); transform: translateY(-5px); }
.skill-box i { font-size: 3rem; margin-bottom: 10px; }
[data-theme="dark"] .inverted-icon { filter: invert(1); }

/* Forms */
.form-group { margin-bottom: 1.5rem; }
input, textarea { 
    width: 100%; padding: 1rem; background: rgba(0,0,0,0.2); 
    border: 1px solid var(--glass-border); border-radius: 12px; 
    color: var(--text-main); outline: none; 
}
input:focus, textarea:focus { border-color: var(--accent-color); }
.full-width { width: 100%; }

/* =========================================
   7. RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    body { overflow: auto; display: block; height: auto; }
    .layout-container { display: flex; flex-direction: column; height: auto; width: 90%; margin: 2rem auto; }
    .sidebar-profile { height: auto; overflow: visible; }
    .nav-links { gap: 1rem; font-size: 0.9rem; }
    .nav-container { display: flex; flex-direction: column; gap: 1rem; }
    .right-panel { height: auto; }
    .main-content { overflow: visible; height: auto; padding: 2rem; }
}