/* QueryCraft - Styles communs */

/* Jetons de design partagés (introduits pour la page configuration, réutilisés
   depuis par toute page voulant le même look "moderne" : cartes, en-têtes de
   section en dégradé, contrôles de formulaire...). */
:root {
    --qc-accent: #667eea;
    --qc-accent-2: #764ba2;
    --qc-accent-soft: #eef0fe;
    --qc-accent-ring: rgba(102, 126, 234, .18);
    --qc-border: #e4e2f0;
    --qc-border-strong: #d3d0e6;
    --qc-ink: #211f2f;
    --qc-ink-soft: #615f76;
    --qc-ink-faint: #8b8998;
    --qc-surface: #ffffff;
    --qc-surface-2: #faf9ff;
    --qc-ok: #12734f;
    --qc-ok-soft: #e3f6ec;
    --qc-ok-border: #b7e4cc;
    --qc-warn: #8a5a06;
    --qc-warn-soft: #fdf2da;
    --qc-warn-border: #f0d99a;
    --qc-danger: #ad2b23;
    --qc-danger-soft: #fbe9e6;
    --qc-danger-border: #f0c1ba;
    --qc-radius-lg: 16px;
    --qc-radius-md: 12px;
    --qc-radius-sm: 8px;
    --qc-shadow-card: 0 1px 2px rgba(33, 31, 47, .04), 0 8px 24px -12px rgba(33, 31, 47, .12);
    --qc-shadow-pop: 0 20px 50px -20px rgba(33, 31, 47, .35);
}

/* Police Atkinson Hyperlegible Next */
@font-face {
    font-family: "Atkinson Hyperlegible Next";
    src: url('../css/font/AtkinsonHyperlegibleNext/AtkinsonHyperlegibleNext-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Atkinson Hyperlegible Next";
    src: url('../css/font/AtkinsonHyperlegibleNext/AtkinsonHyperlegibleNext-Bold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}

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

body {
    font-family: "Atkinson Hyperlegible Next", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Conteneur principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* En-tête */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.header-icon {
    height: 6em;
    width: auto;
    flex-shrink: 0;
}

.header-text {
    text-align: left;
}

.header-text h1:empty {
    display: none;
}

.header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Boutons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #d9d2f7;
    color: #3d2f91;
    border: 1.5px solid #8879d6;
}

.btn-secondary:hover {
    background: #c7bdf2;
    border-color: #6c5ac9;
}

.btn-secondary:disabled {
    background: #f3f4f6;
    color: #9aa0a8;
    border-color: #e5e7eb;
}

/* Annuler / réinitialiser : discarde une saisie ou un état en cours (formulaire,
   filtres, résultat affiché). Teinte rouge douce — plus discrète que
   .btn-danger (suppression définitive), mais dans la même famille de couleur
   pour signaler qu'on perd quelque chose, contrairement aux actions
   utilitaires neutres qui restent en .btn-secondary. */
.btn-cancel {
    background: #fbdede;
    color: #9c2b2b;
    border: 1.5px solid #eab0b0;
}

.btn-cancel:hover {
    background: #f6c6c6;
    border-color: #dd8f8f;
}

.btn-cancel:disabled {
    background: #f3f4f6;
    color: #9aa0a8;
    border-color: #e5e7eb;
}

/* Navigation : changer de page (accueil, config, exercices, traces...). Ton
   bleu-gris volontairement distinct de la famille violette (primary/secondary)
   pour signaler "vous quittez cette page" plutôt qu'une action sur la page. */
.btn-nav {
    background: #e3ebf5;
    color: #2c4a6e;
    border: 1.5px solid #a9c0d9;
}

.btn-nav:hover {
    background: #cfe0f0;
    border-color: #7fa3c9;
}

.btn-nav:disabled {
    background: #f3f4f6;
    color: #9aa0a8;
    border-color: #e5e7eb;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Alertes et messages */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.info {
    background: #e8f0ff;
    color: #152c57;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #667eea;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.alert.show {
    display: block;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #664d03;
    border-left: 4px solid #ffc107;
}

/* Loading spinner */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 0.9em;
    border-top: 1px solid #dee2e6;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
}

/* Navigation commune (header) */
.nav-buttons {
    margin-top: 15px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    margin: 0 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Badge version dans le header */
.header .version {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    margin-top: 15px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
}

/* Sections-carte (crédits, didapro11) */
.section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.section h2 {
    color: #667eea;
    font-size: 1.8em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section h3 {
    color: #333;
    font-size: 1.3em;
    margin-top: 20px;
    margin-bottom: 10px;
}

.section p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.section ul {
    color: #555;
    line-height: 1.8;
    margin-left: 20px;
}

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