:root {
    --bg-primary: #1a1d29;
    --bg-secondary: #242837;
    --bg-tertiary: #2d3142;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --accent-primary: #4f9eff;
    --accent-secondary: #7c3aed;
    --border-color: #3a3f51;
    --success: #10b981;
    --shadow: rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px var(--shadow);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.logo i {
    color: var(--accent-primary);
    font-size: 1.5rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.zoom-btn {
    background: transparent;
    color: var(--text-primary);
    border: none;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
}

.zoom-btn:hover {
    background: var(--accent-primary);
}

.zoom-level {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 250px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 2000;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    padding-left: 1.5rem;
}

.dropdown-menu a.active {
    background: var(--accent-primary);
    color: white;
}

.chevron-icon {
    font-size: 0.8em;
    margin-left: 0.3rem;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 1100;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
}

.close-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
}

.close-btn:hover {
    background: var(--bg-tertiary);
}

.toc-content {
    padding: 1rem;
}

.toc-content ul {
    list-style: none;
}

.toc-content li {
    margin: 0.5rem 0;
}

.toc-content a {
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: var(--transition);
}

.toc-content a:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.main-container {
    margin-top: 80px;
    padding: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.reading-progress {
    position: fixed;
    top: 80px;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    z-index: 999;
}

.content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 4px 20px var(--shadow);
}

.content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--accent-primary);
    padding-bottom: 0.75rem;
}

.content h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.content p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.content a {
    color: var(--accent-primary);
    text-decoration: none;
}

.content a[href$=".md"] {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin: 0.25rem;
    transition: var(--transition);
}

.content a[href$=".md"]:hover {
    background: var(--accent-primary);
    color: white;
}

.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
}

.content th {
    background: var(--bg-primary);
    padding: 1rem;
    text-align: left;
}

.content td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.content code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    color: var(--accent-primary);
}

.content pre {
    background: #282c34;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    max-width: 900px;
    max-height: 90vh;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 10px 40px var(--shadow);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.search-input {
    width: 100%;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.search-results {
    margin-top: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

/* ===== Mode Clair ===== */
body.light-mode {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8ecf1;
    --text-primary: #1a1d29;
    --text-secondary: #4a5568;
    --border-color: #d1d5db;
    --shadow: rgba(0, 0, 0, 0.1);
}

body.light-mode .header {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.light-mode .content pre {
    background: #2d3748;
}

body.light-mode .content code {
    background: #e8ecf1;
    color: #4f9eff;
}

body.light-mode .content tr:hover {
    background: rgba(79, 158, 255, 0.05);
}

/* ===== Animations pour notifications ===== */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
