/* Thème amélioré et professionnel */
:root {
    --primary: #4b6cb7;
    --secondary: #182848;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --gray: #6c757d;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    color: #333;
}

header {
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

nav h1 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1 0 auto;
}

.intro {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.intro h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 2.2rem;
}

.intro p {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 0;
}

h1, h2 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 2rem;
}

/* Cartes modernes */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Styles des boutons de matière améliorés */
.subjects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.subject-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    min-height: 80px;
    position: relative;
    overflow: hidden;
}

.subject-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0.05));
}

.subject-btn:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.subject-icon {
    font-size: 1.8rem;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.subject-name {
    font-size: 1.3rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.subject-btn:nth-child(1) { background: linear-gradient(135deg,#e74c3c,#c0392b); }
.subject-btn:nth-child(2) { background: linear-gradient(135deg,#3498db,#2980b9); }
.subject-btn:nth-child(3) { background: linear-gradient(135deg,#2ecc71,#27ae60); }
.subject-btn:nth-child(4) { background: linear-gradient(135deg,#9b59b6,#8e44ad); }
.subject-btn:nth-child(5) { background: linear-gradient(135deg,#f39c12,#d35400); }
.subject-btn:nth-child(6) { background: linear-gradient(135deg,#1abc9c,#16a085); }
.subject-btn:nth-child(7) { background: linear-gradient(135deg,#34495e,#2c3e50); }

/* --- Panneau de catégories avec effet de glissement --- */
.subjects-container {
    display: flex;
    position: relative;
    width: 100%;
    overflow: hidden;
    transition: all 0.6s ease;
}

/* Panneau de droite (catégories) */
.categories-panel {
    position: absolute;
    top: 0;
    right: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    border-radius: 16px 0 0 16px;
    padding: 2rem;
    transition: right 0.6s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.categories-panel.active {
    right: 0;
    animation: slideInFromRight 0.5s ease-out;
}

.panel-title {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 2rem;
    text-align: center;
}

.categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-height: 80px;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.category-icon {
    font-size: 1.8rem;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.category-name {
    font-size: 1.3rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Quand le panneau est ouvert → les matières glissent à gauche */
.subjects-container.shifted #subjects {
    transform: translateX(-30%);
    filter: blur(1px);
    opacity: 0.9;
}

.close-panel {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-panel:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Grille de questions */
.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.question-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--primary);
}

.question-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.question-number {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.card-content {
    line-height: 1.6;
}

.question-text, .answer-text {
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

.answer-text {
    border-left-color: #2ecc71;
    background: #f0fff4;
}

/* En-têtes de section */
.game-header, .scores-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.game-stats, .scores-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--gray);
}

/* Contrôles de jeu */
.game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.btn, #newGameBtn {
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, #3a559d 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover, #newGameBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(74, 108, 183, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #1e7e34 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #bd2130 100%);
}

/* Actions du jeu */
.game-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Fil d'Ariane */
.breadcrumb {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    padding: 0.8rem 1.2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.breadcrumb a {
    color: #4b6cb7;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb span {
    color: #6c757d;
}

/* Formulaire de gestion */
#addForm {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#addForm input {
    padding: 0.8rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#addForm input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.2);
}

#addForm button {
    padding: 0.8rem 1.5rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

#addForm button:hover {
    background: #218838;
    transform: translateY(-2px);
}

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

footer a {
    color: #fff;
    text-decoration: underline;
}

/* Tableau des scores */
.score-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.score-table th, .score-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.score-table th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-weight: 600;
}

.score-table tr:last-child td {
    border-bottom: none;
}

.score-table tr:hover {
    background: #f8f9fa;
}

/* Score display amélioré */
.score-display {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.score-value {
    font-weight: 600;
    min-width: 60px;
}

.score-bar-container {
    flex: 1;
    max-width: 200px;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.score-bar {
    height: 100%;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--success) 0%, #5cb85c 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-text {
    color: white;
    font-weight: bold;
    font-size: 0.75rem;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

/* Badge de matière */
.subject-badge {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    background: var(--primary);
    color: white;
}

/* Timbre */
.stamp {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 15px;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 5px;
    transform: rotate(15deg);
    opacity: 0.8;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background: white;
    z-index: 10;
}

/* Page des scores */
.scores-page {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.scores-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-select {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #ced4da;
    background: white;
}

/* Conteneurs vides */
.empty-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    background: white;
    border-radius: 16px;
    border: 2px dashed #dee2e6;
    padding: 3rem;
    text-align: center;
}

.empty-message {
    color: #6c757d;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Styles pour la gestion des paires */
.pair-list {
    margin-top: 2rem;
}

.no-pairs {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    color: #6c757d;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pair-item {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.pair-item:hover {
    transform: translateY(-3px);
}

.pair-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pair-text {
    font-size: 1.1rem;
    flex-grow: 1;
    font-weight: 500;
}

.pair-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-btn, .delete-btn, .save-btn, .cancel-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.edit-btn {
    background: var(--warning);
    color: #212529;
}

.edit-btn:hover {
    background: #e0a800;
}

.delete-btn {
    background: var(--danger);
    color: white;
}

.delete-btn:hover {
    background: #c82333;
}

.save-btn {
    background: var(--success);
    color: white;
}

.save-btn:hover {
    background: #218838;
}

.cancel-btn {
    background: var(--gray);
    color: white;
}

.cancel-btn:hover {
    background: #5a6268;
}

.edit-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
}

.edit-form input {
    padding: 0.8rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
}

/* Améliorations pour la gestion */
.styled-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.styled-table th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-weight: 600;
    padding: 1.2rem;
    text-align: left;
}

.styled-table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #eee;
}

.styled-table tr:last-child td {
    border-bottom: none;
}

.styled-table tr:hover {
    background: #f8f9fa;
}

.add-category-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

.add-category-form h3 {
    margin-top: 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-category-form input {
    padding: 0.8rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    flex: 1;
}

.add-category-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.1);
    outline: none;
}

.add-category-form form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.add-category-form button {
    padding: 0.8rem 1.5rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.add-category-form button:hover {
    background: #218838;
    transform: translateY(-2px);
}

.filter-form {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-form label {
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.filter-form select {
    padding: 0.6rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-form select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.1);
}

/* Indicateur de chargement */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    gap: 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utilitaires */
.text-center {
    text-align: center;
}

.error {
    color: var(--danger);
    font-weight: 500;
    background: #f8d7da;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

/* Animations */
@keyframes fadeInMove {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInMove 0.4s forwards ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Effet de ripple pour les étiquettes */
.label::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.label:hover::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 1;
    }
    20% {
        transform: scale(25, 25);
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Badges et indicateurs */
.badge {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: #212529;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

/* Responsive */
@media (max-width: 992px) {
    .game-container {
        flex-direction: column;
    }
    
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav h1 {
        margin-top: 1rem;
    }
    
    .categories-panel {
        width: 100%;
        border-radius: 16px 16px 0 0;
        height: 80%;
        bottom: -100%;
        top: auto;
        right: 0;
        transition: bottom 0.6s ease;
    }

    .categories-panel.active {
        bottom: 0;
    }

    .subjects-container.shifted #subjects {
        transform: scale(0.95);
        filter: blur(2px);
    }
}

@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    #addForm {
        grid-template-columns: 1fr;
    }
    
    .subjects {
        grid-template-columns: 1fr;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .pair-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .edit-form {
        grid-template-columns: 1fr;
    }
    
    .scores-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .questions-grid {
        grid-template-columns: 1fr;
    }
    
    .subject-btn, .category-btn {
        padding: 1.2rem 1.5rem;
        min-height: 70px;
    }
    
    .subject-name, .category-name {
        font-size: 1.1rem;
    }
    
    .categories-list {
        grid-template-columns: 1fr;
    }
    
    .game-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .score-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .score-bar-container {
        max-width: 100%;
        width: 100%;
    }
    
    .add-category-form form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .add-category-form input,
    .add-category-form button {
        width: 100%;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .styled-table {
        font-size: 0.9rem;
    }
}
/* Styles spécifiques à la gestion */
.management-card {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 2rem;
}

.management-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
}

.management-header h2 {
    color: white;
    margin-bottom: 1rem;
}

.management-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0;
}

.management-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.categories-column,
.questions-column {
    min-height: 600px;
}

.section-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.section-header h3 {
    margin: 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-form-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--success);
}

.add-form-card h4 {
    margin: 0 0 1rem 0;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-form {
    margin: 0;
}

.input-group {
    display: flex;
    gap: 1rem;
}

.input-group input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}

.input-group input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.form-group textarea {
    padding: 0.8rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.1);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Liste des catégories */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.category-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-item.active {
    border-color: var(--primary);
    background: #f0f7ff;
}

.category-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--dark);
}

.question-count {
    font-size: 0.9rem;
    color: var(--gray);
}

.category-actions {
    display: flex;
    gap: 0.5rem;
}

/* Liste des questions */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.question-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.question-content {
    flex: 1;
}

.question-text, .answer-text {
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

.answer-text {
    border-left-color: #2ecc71;
    background: #f0fff4;
}

.question-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.delete-form {
    margin: 0;
}

/* Carte de bienvenue */
.welcome-card {
    text-align: center;
    padding: 3rem;
}

.welcome-content {
    max-width: 500px;
    margin: 0 auto;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.feature-list {
    text-align: left;
    max-width: 300px;
    margin: 2rem auto;
}

.feature-list li {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}

/* États vides */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Alertes */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--success);
    color: #155724;
}

/* Filtre */
.filter-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: #f8f9fa;
    color: var(--dark);
}

.modal form {
    padding: 2rem;
}

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

/* Navigation active */
.nav-links a.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1200px) {
    .management-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .categories-column,
    .questions-column {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .management-card {
        padding: 1rem;
        margin: 1rem;
    }
    
    .section-card {
        padding: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .category-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .category-actions {
        align-self: stretch;
        justify-content: space-between;
    }
    
    .question-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .question-actions {
        align-self: stretch;
        justify-content: space-between;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}