﻿/* ===============================
    Structure générale
=============================== */
.scenario-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

.step {
    display: none;
    flex-direction: column;
    width: 100%;
}

    .step.active {
        display: flex;
    }

.step-content {
    display: flex;
    gap: 32px;
    width: 100%;
    align-items: flex-start;
    box-sizing: border-box;
    flex-wrap: wrap;
    overflow: visible;
    min-height: 20vh;
    height: auto;
}

.step-box {
    border: 2px solid #b51217;
    border-radius: 14px;
    padding: 32px 28px;
    background-color: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    position: relative;
    transition: all 0.3s ease-in-out;
}
    .step-box:hover {
        box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    }

.step-title {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    padding: 4px 16px;
    border: 2px solid #b51217;
    border-radius: 20px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #b51217;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.step-card {
    border: 2px solid #b51217;
    border-radius: 10px;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}
/* ===============================
    Sous-sections du choix matière
=============================== */
.subsection {
    border: 1.5px solid #ccc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    background-color: #fafafa;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

    .subsection:hover {
        border-color: #b51217;
        box-shadow: inset 0 1px 4px rgba(181,18,23,0.15);
    }

.subsection-separator {
    border: 0;
    border-top: 2px dashed #bbb;
    margin: 32px 0;
}

.subsection-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #213864;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.placeholder {
    font-style: italic;
    color: #666;
}

/* ===============================
    Colonnes
=============================== */
.step-left {
    flex: 0 0 35%;
    position: relative;
}
    .step-left input.form-control,
    .step-right input.form-control {
        margin-bottom: 12px;
        padding: 10px 14px;
        border: 1.5px solid #ccc;
        border-radius: 6px;
        font-size: 0.95rem;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
        .step-left input.form-control:focus,
        .step-right input.form-control:focus {
            border-color: #b51217;
            box-shadow: 0 0 4px rgba(181, 18, 23, 0.3);
            outline: none;
        }

.step-right {
    flex: 0 0 55%;
    background-color: #f8f9fa;
    border: 2px solid #b51217;
    border-radius: 8px;
    padding: 16px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    opacity: 1;
    transform: translateX(0);
    transition: transform 0.4s ease, opacity 0.4s ease;
    word-wrap: break-word;
    overflow-x: auto;
    overflow-y: auto;
}
    .step-right.slide-in {
        transform: translateX(25px);
        opacity: 0;
    }

/* ===============================
    Boutons
=============================== */
.step-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.btn-step {
    background-color: #e0e0e0;
    color: #000;
    border: 2px solid #b51217;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: 20px;
}

    .btn-step.btn-prev::before {
        content: "←";
        margin-right: 6px;
        font-size: 1.1em;
        color: #b51217;
    }

    .btn-step.btn-next::after {
        content: "→";
        margin-left: 6px;
        font-size: 1.1em;
        color: #b51217;
    }

    .btn-step:hover {
        background-color: #c0c0c0;
        border-color: #999;
    }

/* ===============================
    Autocomplete
=============================== */
.autocomplete-input {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #ccc;
    border-radius: 6px 6px 0 0;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}
    .autocomplete-input:focus {
        border-color: #b51217;
        box-shadow: 0 0 4px rgba(181, 18, 23, 0.3);
        outline: none;
    }

.autocomplete-suggestions {
    border: 1.5px solid #b51217;
    border-top: none;
    background: #fff;
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-height: 14vh;
    overflow-y: auto;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-top: 0;
}
    .autocomplete-suggestions:empty {
        display: none;
    }
    .autocomplete-suggestions div {
        padding: 6px 10px;
        cursor: pointer;
        font-size: 0.9rem;
        color: #333;
        transition: background-color 0.15s ease;
    }
        .autocomplete-suggestions div:hover {
            background-color: #f0f0f0;
        }

/* ===============================
    Animation fade
=============================== */
.fade-target {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

    .fade-target.visible {
        opacity: 1;
    }

.right-col.slide-in {
    transform: translateX(20px);
    transition: transform 0.4s ease-in-out;
}

.right-col {
    transition: transform 0.4s ease-in-out;
}

/* ===============================
    Table de détails
=============================== */
.table.details-table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
}

    .table.details-table th,
    .table.details-table td {
        padding: 8px 10px;
        text-align: center;
        border: 2px solid #c0c0c0;
        /* Forcer la couleur de texte si besoin */
        color: inherit !important;
        background-color: inherit !important;
    }

    .table.details-table thead {
        background-color: #f1f1f1 !important;
        color: #213864 !important;
    }

/* Lignes sans groupe : alternance grise pour visibilité */
.details-table tr:not([class*="groupe-"]):nth-child(even) {
    background-color: #f2f2f2;
}

/* ===============================
    Popup (modal)
=============================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
    .modal-overlay.active {
        display: flex;
    }

.modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 20px 28px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    position: relative;
    text-align: center;
}

.modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

    .modal-header h5 {
        margin: 0;
        color: #b51217;
        font-weight: 600;
    }

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #666;
}
    .modal-close:hover {
        color: #b51217;
    }

.modal-footer {
    text-align: center;
    margin-top: 20px;
}

.btn-fermer {
    background-color: #b51217;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

    .btn-fermer:hover {
        background-color: #991016;
    }

/* Bloc principal du haut du modal */
.modal-header-section {
    text-align: center;
    margin-bottom: 10px;
}

/* Groupe : fond coloré + grand texte */
.modal-groupe {
    display: inline-block;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
}

/* Type : texte coloré selon le groupe, sans fond */
.modal-type {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 6px;
}

/* Style responsive pour le modal */
.modal-dialog-responsive {
    width: 100%;
    max-width: 100%;
    margin: 1rem auto;
}

.modal-body {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-height: none;
    overflow: visible;
}
    .modal-body .table-responsive {
        width: 100%;
        overflow-x: auto; 

    }
/* --- Colonne radio --- */
.table.details-table td:first-child,
.table.details-table th:first-child {
    width: 40px;
}

@media (max-width: 768px) {
    .step-content {
        gap: 16px;
        min-height: 30vh;
    }
}

@media (max-width: 576px) {
    .modal-content {
        padding: 16px 12px;
    }
    .modal-groupe {
        font-size: 1.5rem;
    }
    .modal-type {
        font-size: 1rem;
    }
    .modal-body button {
        min-width: 100px;
        font-size: 0.85rem;
    }

    .table-responsive .col-sous-groupe {
        min-width: 80px;
    }
}

@media (min-width: 576px) {
    .modal-dialog-responsive {
        max-width: 80%;
    }
}

@media (min-width: 768px) {
    .modal-dialog-responsive {
        width: 90%;
        max-width: 900px;
    }
}

@media (min-width: 992px) {
    .modal-dialog-responsive {
        width: 80%;
        max-width: 1000px;
    }
}

@media (min-width: 1200px) {
    .modal-dialog-responsive {
        max-width: 50%;
    }
}