:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --bg: #f4f6f7;
    --text: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    direction: rtl; /* Force l'affichage de droite à gauche */
    text-align: right;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1, h2, h3 { color: var(--primary); }
h1 { text-align: center; margin-bottom: 40px; }

/* Styles de l'accordéon */
details {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

summary {
    background: #eee;
    padding: 15px;
    cursor: pointer;
    font-weight: bold;
    list-style: none; /* Cache la flèche par défaut */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

summary::after {
    content: '+'; 
    font-size: 1.5em;
    color: var(--secondary);
}

details[open] summary::after {
    content: '-';
}

.content {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #ddd;
    line-height: 1.6;
}

/* Admin Styles */
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-weight: bold; }
input, textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
button {
    background: var(--secondary);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}
button:hover { background: #2980b9; }
.message { padding: 10px; margin-bottom: 20px; border-radius: 4px; }
.success { background: #d4edda; color: #155724; }
.sub-header { border-bottom: 2px solid var(--secondary); margin-top: 30px; padding-bottom: 5px;}
/* Accordéon Frontend */
details { margin-bottom: 10px; border: 1px solid #e9ecef; border-radius: 5px; overflow: hidden; }
summary { background: #fff; padding: 15px; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary:hover { background: #f1f1f1; }
summary::after { content: '+'; font-size: 1.2em; color: var(--secondary); }
details[open] summary::after { content: '-'; }
.content { padding: 20px; background: #fff; border-top: 1px solid #e9ecef; color: #555; line-height: 1.6; }

/* Admin Interface */
.admin-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #eee; padding-bottom: 20px; margin-bottom: 20px; }
.btn { padding: 8px 15px; border: none; border-radius: 4px; cursor: pointer; color: white; text-decoration: none; font-size: 0.9em; display: inline-block;}
.btn-primary { background: var(--secondary); }
.btn-danger { background: var(--danger); }
.btn-warning { background: var(--warning); color: white; }
.btn-sm { padding: 4px 8px; font-size: 0.8em; margin-left: 5px; }

/* Formulaires Admin */
.editor-panel { background: #f1f4f6; padding: 20px; border-radius: 8px; margin-bottom: 30px; border: 1px solid #ddd; }
input, textarea, select { width: 100%; padding: 10px; margin-top: 5px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
label { font-weight: bold; font-size: 0.9em; color: var(--primary); }

/* Arborescence Admin */
.tree-item { padding: 10px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.tree-cat { background: #eaf2f8; font-weight: bold; margin-top: 15px; border-radius: 4px; }
.tree-sub { margin-right: 20px; background: #fff; border-left: 3px solid var(--secondary); }
.tree-q { margin-right: 40px; color: #666; font-size: 0.95em; }
.actions { display: flex; gap: 5px; }

/* Navigation du Site */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav-link {
    text-decoration: none;
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #f0f0f0;
}

.nav-link.active {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}
/* Styles pour la page Qualification */
.profile-selector {
    margin-bottom: 30px;
    text-align: center;
    background: #eaf2f8;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #d6eaf8;
}

.profile-selector select {
    font-size: 1.1em;
    padding: 10px;
    width: 100%;
    max-width: 400px;
    border: 2px solid var(--secondary);
    border-radius: 5px;
    background: white;
}

.script-container {
    display: none; /* Caché par défaut */
    animation: fadeIn 0.5s;
}

.script-container.active {
    display: block; /* Affiché si actif */
}

.script-step {
    background: #fff;
    border-right: 4px solid var(--secondary);
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.step-label {
    font-weight: bold;
    color: var(--secondary);
    font-size: 0.9em;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
    letter-spacing: 1px;
}

.step-question {
    font-size: 1.1em;
    margin: 5px 0;
    color: #333;
}

.step-alt {
    color: #777;
    font-size: 0.95em;
    border-top: 1px dashed #eee;
    padding-top: 5px;
    margin-top: 5px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}