/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Main container */
.container {
    display: flex;
    min-height: 50vh;
}

/* Sidebar (Table of Contents) */
.sidebar {
    width: 280px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Police pour le sidebar */
}

.sidebar h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 8px;
}

.sidebar a {
    color: #ecf0f1;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 0.9rem;
    cursor: pointer;
}

.sidebar a:hover {
    background-color: #34495e;
}

.sidebar .submenu {
    margin-left: 15px;
    margin-top: 5px;
}

.sidebar .submenu a {
    font-size: 0.85rem;
    padding-left: 20px;
}

.sidebar .subsubmenu {
    margin-left: 15px;
}

.sidebar .subsubmenu a {
    font-size: 0.8rem;
    padding-left: 25px;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 30px;
    max-width: 1000px;
    font-family: Arial, sans-serif; /* Police Arial pour le contenu */
}

.home-content {
    flex: 1;
    padding: 30px;
    max-width: 1000px;
    font-family: Arial, sans-serif;
}

.main-content h1,
.home-content h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.main-content h2,
.home-content h2 {
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #3498db;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.main-content h3,
.home-content h3 {
    font-size: 1.2rem;
    margin-top: 20px;
    color: #2980b9;
}

.main-content h4,
.home-content h4 {
    font-size: 1.1rem;
    margin-top: 15px;
    color: #1a5276;
}

.main-content p,
.home-content p {
    margin-bottom: 15px;
}

.main-content ul,
.main-content ol,
.home-content ul,
.home-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.main-content li,
.home-content li {
    margin-bottom: 5px;
}

/* Special styles for theorems, examples, and equations */
.theorem, .example, .definition {
    background-color: #f0f8ff;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border-left: 4px solid #3498db;
}

.theorem {
    border-left-color: #e74c3c;
}

.theorem h4, .example h4, .definition h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

/* Equation styling */
.equation {
    text-align: center;
    margin: 20px 0;
    font-size: 1.1rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: #2c3e50;
    color: white;
    margin-top: auto;
}

/* Controls for interactive plots */
.controls {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    font-family: Arial, sans-serif;
}

.controls label {
    display: inline-block;
    width: 150px;
    font-weight: bold;
}

.controls input {
    width: 600px;
    margin-right: 10px;
}

/* Plot box styles */
.plot-box {
    flex: 1;
    min-width: 400px;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Chapter card styles for home page */
.chapter-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    font-family: Arial, sans-serif;
}

.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.chapter-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.chapter-card p {
    color: #666;
    margin-bottom: 15px;
}

.chapter-card a {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}

.chapter-card a:hover {
    background: #2980b9;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        background-color: #34495e;
    }

    .sidebar ul {
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
    }

    .sidebar li {
        margin: 5px 10px;
    }

    .sidebar .submenu, .sidebar .subsubmenu {
        display: none;
    }

    .main-content, .home-content {
        padding: 20px;
    }
}