/* ====== VARIABLES ET CONFIGURATION ====== */
:root {
    --bg-main: #f0f2f5;
    --bg-card: rgba(255, 255, 255, 0.7);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --accent: #6366f1; /* Indigo moderne */
    --accent-hover: #4f46e5;
    --border: rgba(226, 232, 240, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --radius: 16px;
    --font-code: 'Fira Code', 'Hack', monospace;
}

body.dark-mode {
    --bg-main: #0f172a; /* Bleu nuit profond */
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #10b981; /* Vert Emeraude */
    --accent-hover: #34d399;
    --border: rgba(51, 65, 85, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* ====== RESET ET BASE ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    transition: all 0.3s ease;
}

/* ====== GLASSMORPHISM CARDS ====== */
.project, .writeup-item, .platform-section, main, .writeup-content {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ====== HEADER ====== */
header {
    text-align: center;
    padding: 60px 0 40px;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    margin-bottom: 10px;
}

/* ====== BOUTON THEME (FLOTTANT MODERNE) ====== */
#theme-toggle {
    position: fixed;
    top: 25px;
    right: 25px;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--accent);
    border-radius: 12px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    box-shadow: var(--glass-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 1000;
}

#theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

/* ====== ACCORDEONS & WRITEUPS ====== */
.platform-section {
    padding: 25px;
    margin-bottom: 30px;
}

.writeup-item {
    margin: 15px 0;
    border: 1px solid transparent;
}

.writeup-item:hover {
    border-color: var(--accent);
}

.clickable {
    padding: 15px 20px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
}

.clickable::after {
    content: '→';
    font-family: serif;
    transition: transform 0.3s ease;
    color: var(--accent);
}

.clickable.open::after {
    transform: rotate(90deg);
}

/* ====== CODE BLOCKS (STYLE TERMINAL) ====== */
pre, code {
    font-family: var(--font-code);
    font-size: 0.95rem;
}

pre {
    background: #0f172a !important; /* Toujours sombre pour le code */
    color: #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #334155;
    margin: 20px 0;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
}

/* Petit indicateur de terminal */
pre::before {
    content: "•••";
    position: absolute;
    top: 8px;
    left: 15px;
    color: #334155;
    letter-spacing: 2px;
}

/* ====== SKILLS & BADGES ====== */
.skills, .competences p {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.skills li, .competences span, .diff-badge {
    background: var(--accent);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* ====== LIENS ====== */
a {
    color: var(--accent);
    text-decoration: none;
    position: relative;
    transition: 0.3s;
}

a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s;
}

a:hover::after {
    width: 100%;
}

/* ====== ANIMATIONS ====== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.project, .platform-section {
    animation: fadeIn 0.5s ease forwards;
}

/* ====== MOBILE ====== */
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    body { padding: 15px; }
    #theme-toggle { top: 15px; right: 15px; }
}

/* Footer */
footer {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
