/**
 * summaryStyles.css
 * Styles pour le résumé des questions du générateur de code GIFT
 */

/* Section de résumé */
.summary-section {
    background-color: #f0f8ff;
    border: 1px solid #cce5ff;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

/* En-tête du résumé */
.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.summary-header h3 {
    margin: 0;
    color: #005EB8;
}

.summary-toggle-icon {
    display: inline-block;
    margin-right: 5px;
    transition: transform 0.3s ease;
}

/* Contenu du résumé */
.summary-content {
    padding: 0 15px 15px;
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.summary-content.hidden {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

/* Table de résumé */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 0.9em; /* Police réduite pour afficher plus de contenu */
}

.summary-table th,
.summary-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.summary-table th {
    background-color: #005EB8;
    color: white;
    font-weight: bold;
}

.summary-table tr:last-child td {
    border-bottom: none;
}

.summary-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.summary-table tr:hover {
    background-color: #f0f7ff;
}

/* Colonnes spécifiques */
.summary-number {
    width: 40px;
    text-align: center;
}

.summary-id {
    width: 150px;
    font-family: monospace;
}

.summary-type {
    width: 100px;
}

.summary-text {
    min-width: 200px;
    word-break: break-word; /* Permet aux mots longs de se casser */
    max-width: 50vw; /* Limite la largeur maximale */
}

.summary-actions {
    width: 120px;
    text-align: center;
    white-space: nowrap;
}

/* Styles pour les ID auto-générés */
.auto-id {
    color: #888;
    font-style: italic;
    font-size: 0.9em;
}

/* Boutons d'action */
.summary-btn {
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.summary-btn:hover {
    background-color: #f0f7ff;
    border-color: #005EB8;
}

.goto-icon {
    font-size: 16px;
    color: #005EB8;
}

/* Flèches de déplacement dans le sommaire — v0.16.0 */
.summary-move-btn {
    padding: 4px 6px;
    margin: 0 1px;
}

.summary-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.summary-btn:disabled:hover {
    background-color: transparent;
    border-color: #ddd;
}

.move-icon {
    font-size: 13px;
    color: #005EB8;
}

/* Message quand il n'y a pas de questions */
.summary-empty-message {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Style pour le bouton d'ajout dans le message vide */
.small-btn {
    font-size: 14px;
    padding: 5px 10px;
    margin-top: 10px;
}

/* Style pour la mise en évidence de la question ciblée */
.highlight-question {
    animation: questionHighlight 2s ease;
}

@keyframes questionHighlight {
    0% {
        background-color: #ffff99;
    }
    100% {
        background-color: inherit;
    }
}

/* Boutons de navigation persistants */
.navigation-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #005EB8; /* Même bleu que les boutons */
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 18px; /* Boutons légèrement plus grands */
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    opacity: 0.8;
    font-size: 1.1em;
}

.nav-btn:hover {
    background-color: #004a93;
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.nav-btn.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
}

.nav-icon {
    margin-right: 6px;
    font-size: 1.2em; /* Flèche plus grande */
}

/* Responsive */
@media (max-width: 768px) {
    .summary-table {
        font-size: 0.85em;
    }
    
    .summary-id {
        width: 100px;
    }
    
    .summary-type {
        width: 80px;
    }
    
    .summary-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .summary-header button {
        margin-top: 10px;
    }
    
    .navigation-buttons {
        bottom: 15px;
        right: 15px;
    }
    
    .nav-btn {
        padding: 10px 15px;
        font-size: 1em;
    }
}

/* ── Regroupement par banque dans le sommaire (v0.21.0) ───────────────────── */

/* Ligne d'en-tête de groupe (banque ou « Sans banque ») — cliquable pour replier. */
.summary-group-row > .summary-group-cell {
    background: linear-gradient(0deg, #effaf8, #e3f6f0);
    border-top: 2px solid #00bcb4;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
}

.summary-group-toggle {
    display: inline-block;
    width: 1em;
    color: #2da288;
    font-size: 0.85rem;
}

.summary-group-badge {
    display: inline-block;
    background: #2da288;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    padding: 2px 7px;
    border-radius: 4px;
    margin: 0 8px;
}
.summary-group-badge.none {
    background: #9aa6a3;
}

.summary-group-name {
    font-weight: 600;
    color: #1c4f44;
}

.summary-group-count {
    color: #5a7a73;
    font-size: 0.8rem;
    margin-left: 8px;
}

/* Lignes de questions masquées quand leur groupe est replié. */
.summary-row-hidden {
    display: none;
}

/* Icône média dans le sommaire */
.summary-media-icon {
    display: inline-block;
    margin-left: 6px;
    font-size: 1em;
    vertical-align: middle;
    cursor: default;
}