:root {
    /* Couleurs principales */
    --duke-blue: #1B1B3A;
    --murrey: #8A1C7C;
    --folly: #FF0A54;
    --orange-pantone: #FF6B35;
    --amber: #FFBE0B;
    
    /* Couleurs de fond */
    --bg-primary: var(--duke-blue);
    --bg-secondary: #2A2A4A;
    --bg-tertiary: #3A3A5A;
    
    /* Couleurs de texte */
    --text-primary: #FFFFFF;
    --text-secondary: #CCCCCC;
    --text-muted: #888888;
    
    /* Espacement */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Bordures */
    --border-radius: 8px;
    --border-color: var(--murrey);
    
    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

code {
    font-family: 'Fira Code', monospace;
}

/* Navigation */
header {
    background-color: var(--bg-secondary);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-md);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--amber);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

/* Contenu principal */
main {
    max-width: 1200px;
    margin: var(--spacing-xl) auto;
    padding: 0 var(--spacing-md);
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

/* Formulaires */
.form-group {
    margin-bottom: var(--spacing-lg);
}

label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: var(--spacing-sm);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: inherit;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Éditeur Markdown */
.editor-container {
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #fff;
}

.editor-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.toolbar-btn {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.toolbar-btn i {
    font-size: 14px;
}

.toolbar-separator {
    color: #ddd;
    margin: 0 4px;
    align-self: center;
}

.editor-content {
    min-height: 300px;
    padding: 16px;
    background: white;
    color: #333;
    border: none;
    font-size: 1rem;
}

#html-editor {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.5;
    border: none;
    resize: vertical;
    background: white;
    color: #333;
}

#html-editor:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.hidden {
    display: none !important;
}

/* Boutons */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--folly);
    color: var(--text-primary);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-danger {
    background-color: #dc3545;
    color: var(--text-primary);
}

.btn-primary:hover {
    background-color: var(--orange-pantone);
}

.btn-secondary:hover {
    background-color: var(--murrey);
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Section Export */
.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.import-section {
    margin-bottom: var(--spacing-xl);
}

#preview-container {
    background-color: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-top: var(--spacing-lg);
}

#json-preview {
    font-family: 'Fira Code', monospace;
    white-space: pre-wrap;
    overflow-x: auto;
}

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

/* Responsive */
@media (max-width: 768px) {
    .editor-container {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        display: none;
    }
    
    .export-options {
        grid-template-columns: 1fr;
    }
}

/* Utilitaires */
.hidden {
    display: none !important;
}

/* Contenu */
#contenu-type {
    margin-bottom: var(--spacing-lg);
}

#exemples-container {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.exemple {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius);
}

.exemple:last-child {
    margin-bottom: 0;
}

/* Styles généraux */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Header et Navigation */
header {
    background-color: #2c3e50;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

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

.nav-links a.active {
    background-color: #3498db;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Page d'accueil */
.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
}

.welcome-section h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.intro {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.feature-card ul {
    list-style-position: inside;
    margin: 1rem 0;
    text-align: left;
}

.feature-card li {
    margin-bottom: 0.5rem;
    color: #666;
}

.getting-started {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: left;
}

.getting-started h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.getting-started ol {
    margin-left: 1.5rem;
}

.getting-started li {
    margin-bottom: 0.5rem;
    color: #666;
}

/* Boutons */
.btn-primary {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-section h1 {
        font-size: 2rem;
    }
}

/* Styles pour les autres pages */
.content-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.editor-container {
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #fff;
}

.markdown-editor,
.markdown-preview {
    min-height: 300px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.markdown-preview {
    background-color: #f8f9fa;
    overflow-y: auto;
}

.hidden {
    display: none;
}

/* Styles pour les quiz */
.question {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.reponses-container {
    margin: 1rem 0;
}

.reponse {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

/* Styles pour l'export */
.export-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.import-section {
    margin-bottom: 2rem;
}

#preview-container {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

#json-preview {
    font-family: 'Fira Code', monospace;
    white-space: pre-wrap;
}

/* Éditeur riche */
.editor-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.editor-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.toolbar-btn {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.toolbar-btn i {
    font-size: 14px;
}

.toolbar-separator {
    color: #ddd;
    margin: 0 4px;
    align-self: center;
}

.editor-content {
    min-height: 300px;
    padding: 16px;
    background: white;
    color: #333;
}

#html-editor {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.5;
    border: none;
    resize: vertical;
    background: white;
    color: #333;
}

#html-editor:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.hidden {
    display: none !important;
}

/* Modales */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    min-width: 400px;
    max-width: 90%;
}

.modal-content h3 {
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

/* Styles de l'éditeur */
.editor-wrapper {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.editor-toolbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.toolbar-section {
    display: flex;
    gap: 0.25rem;
    padding: 0 0.5rem;
    border-right: 1px solid #ddd;
}

.toolbar-section:last-child {
    border-right: none;
}

.toolbar-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: #333;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
}

.toolbar-btn:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.toolbar-btn.active {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.editor-content {
    min-height: 300px;
    padding: 1rem;
    background-color: white;
    overflow-y: auto;
    line-height: 1.6;
}

.editor-content:focus {
    outline: none;
}

.editor-content h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.editor-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.editor-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.editor-content p {
    margin-bottom: 1rem;
}

.editor-content ul, .editor-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.editor-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

.editor-content pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.editor-content code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

.editor-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.editor-content th, .editor-content td {
    border: 1px solid #dee2e6;
    padding: 0.5rem;
}

.editor-content th {
    background-color: #f8f9fa;
}

/* Modales */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

/* Menu contextuel */
.context-menu {
    position: fixed;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 1rem;
    min-width: 300px;
    display: none;
    border: 1px solid #ddd;
}

.context-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.close-button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.2rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: #333;
}

.context-menu:not(.hidden) {
    display: block !important;
}

.context-menu-content {
    background-color: white;
    border-radius: 8px;
}

.context-menu h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
}

.context-menu .form-group {
    margin-bottom: 1rem;
}

.context-menu input,
.context-menu select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 0.25rem;
}

.context-menu .modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Styles pour les médias dans l'éditeur */
.editor-content img,
.editor-content .video-container {
    cursor: pointer;
    transition: outline 0.2s ease;
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

.editor-content img:hover,
.editor-content .video-container:hover {
    outline: 2px solid #3498db;
} 