/* =========================================
   VARIABLES DE COULEURS & THÈMES
   ========================================= */
:root {
    --primary-blue: #4f46e5;
    --primary-violet: #9333ea;
    --accent-gradient: linear-gradient(135deg, var(--primary-blue), var(--primary-violet));
    
    /* Mode Sombre (Défaut) */
    --bg-color: #0b0f19;
    --card-bg: #131a26;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #1e293b;
    --hover-bg: rgba(79, 70, 229, 0.1);
    --shadow: rgba(0,0,0,0.3);
}

[data-theme="light"] {
    /* Mode Clair */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: #e2e8f0;
    --hover-bg: rgba(79, 70, 229, 0.05);
    --shadow: rgba(0,0,0,0.05);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; 
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
header {
    background-color: var(--card-bg);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

.nav-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

nav a:hover, nav a.active {
    color: var(--primary-blue);
    background-color: var(--hover-bg);
}

/* Bouton Toggle Thème */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--primary-violet);
    color: var(--primary-violet);
    transform: rotate(15deg);
}

/* =========================================
   STRUCTURE PRINCIPALE
   ========================================= */
main {
    margin-top: 100px;
    padding: 20px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - 180px);
}

.page { 
    display: none; 
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
}

.page.active { 
    display: block; 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   CARTES
   ========================================= */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 30px;
    margin-bottom: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gradient);
}

h1 { 
    font-size: 2.5rem; 
    margin-bottom: 5px; 
    letter-spacing: -0.5px; 
    background: var(--accent-gradient); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}

h2 { 
    font-size: 1.5rem; 
    color: var(--primary-blue); 
    margin-bottom: 20px; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

h3 { 
    font-size: 1.15rem; 
    margin-top: 15px; 
    margin-bottom: 8px; 
}

p { 
    color: var(--text-muted); 
    margin-bottom: 15px; 
}

strong { 
    color: var(--text-main); 
}

/* =========================================
   IMAGE DE PROFIL
   ========================================= */
.profile-photo-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    padding: 3px;
    background: var(--accent-gradient);
}

.profile-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--card-bg);
    border: 2px solid var(--bg-color);
}

/* =========================================
   BADGES DE COMPÉTENCES
   ========================================= */
.skills-list { 
    list-style: none; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    margin-top: 15px; 
}

.skills-list li {
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    color: var(--primary-blue);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.skills-list li:hover { 
    border-color: var(--primary-violet); 
    color: var(--primary-violet); 
}

/* =========================================
   TIMELINE STYLE "ROUTE"
   ========================================= */
.winding-timeline {
    position: relative;
    padding: 20px 0;
    margin-left: 20px;
}

.winding-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 24px;
    width: 4px;
    background: repeating-linear-gradient(to bottom, var(--primary-blue) 0, var(--primary-blue) 10px, transparent 10px, transparent 20px);
    opacity: 0.4;
    border-radius: 2px;
}

.wt-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 40px;
}

.wt-item:last-child { 
    margin-bottom: 0; 
}

.wt-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--primary-blue);
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    z-index: 2;
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.2);
    transition: all 0.3s;
}

.wt-item:hover .wt-number {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--primary-violet);
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(147, 51, 234, 0.4);
}

.wt-content {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: all 0.3s;
}

.wt-content:hover {
    border-color: var(--primary-blue);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.1);
}

.wt-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 18px;
    width: 16px;
    height: 16px;
    background: var(--bg-color);
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.wt-item:hover .wt-content::before { 
    border-color: var(--primary-blue); 
}

.wt-date {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--primary-violet);
    font-weight: bold;
    margin-bottom: 5px;
    display: inline-block;
    padding: 2px 8px;
    background: var(--hover-bg);
    border-radius: 4px;
}

/* =========================================
   BOUTONS
   ========================================= */
.btn-container { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; 
    margin-top: 20px; 
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary { 
    background: var(--accent-gradient); 
    color: white; 
    border: none; 
}

.btn-primary:hover { 
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.4); 
    transform: translateY(-2px); 
}

.btn-github:hover { 
    border-color: #fff; 
    background: rgba(0,0,0,0.05); 
}

.btn-discord:hover { 
    border-color: #5865F2; 
    background: rgba(88, 101, 242, 0.1); 
    color: #5865F2; 
}

.btn-linkedin {
    border-color: #0077b5;
    color: #0077b5;
}

.btn-linkedin:hover {
    background: rgba(0, 119, 181, 0.1);
}

/* =========================================
   WIDGETS API
   ========================================= */
.api-widget {
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.github-stats { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
    gap: 15px; 
    margin-top: 15px; 
}

.stat-box { 
    background: var(--bg-color); 
    padding: 12px; 
    border-radius: 6px; 
    text-align: center; 
    border: 1px solid var(--border-color); 
}

.stat-value { 
    font-size: 1.3rem; 
    font-weight: bold; 
    background: var(--accent-gradient); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    margin-top: 60px;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    nav { 
        flex-direction: column; 
        gap: 15px; 
    }
    
    .nav-links { 
        width: 100%; 
        justify-content: center; 
    }
    
    .theme-toggle { 
        position: absolute; 
        top: 1rem; 
        right: 1rem; 
    }
    
    .winding-timeline { 
        margin-left: 10px; 
    }
    
    .wt-item { 
        padding-left: 50px; 
    }
    
    .wt-number { 
        width: 40px; 
        height: 40px; 
        font-size: 1rem; 
    }
}