/*
 * Widget d'évaluation ICF pour AI Engine - CSS v4.4 (minimaliste)
 * 
 * CHANGELOG v4.4 :
 * - Version minimaliste : suppression des règles de positionnement excessives
 * - Fix : Breakpoint responsive abaissé à 500px (sélecteurs côte à côte sur tablettes)
 * - Le widget est inséré dans le <div> enfant de .mwai-reply (préserve avatar à gauche)
 */

/* Conteneur du message : prend toute la largeur disponible à côté de l'avatar car dès qu'on met un widget dans le message, le message prend toute la largeur disponible. il ne le fait plus*/
.mwai-reply.mwai-ai>div:has(.icf-evaluation-widget) {
    flex-grow: 1;
}

/* Container principal du widget */
.icf-evaluation-widget {
    display: block;
    width: auto;
    flex-grow: 1;
    /* Allows it to grow */
    margin: 12px 0;
    text-align: center;
}

/* Zone de sélection - flex horizontal avec wrap */
.icf-selection-zone {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin: 6px auto;
}

/* Container des 2 selects côte à côte */
.icf-selects-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 36px;
    flex-wrap: nowrap;
}

/* Groupe label + select */
.icf-selection-zone .icf-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

/* Labels */
.icf-selection-zone label {
    /*min-width: 100px;*/
    font-size: 15px;
    text-align: right;
    padding-right: 8px;
    font-weight: 600;
}

/* Selects */
.icf-selection-zone select {
    width: 120px;
    padding: 6px 10px;
    border: 1.8px solid #28a745;
    border-radius: 4px;
    background: white;
    color: #28a745;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    height: 36px;
    transition: border 0.15s, color 0.15s;
}

/* Couleurs par type */
.icf-group.icf-worst select {
    border-color: #dc3545;
    color: #dc3545;
}

.icf-group.icf-best select {
    border-color: #28a745;
    color: #28a745;
}

/* Bouton */
.icf-evaluation-widget .icf-selection-zone button {
    display: inline-block;
    margin-left: 45px;
    min-width: 140px;
    padding: 8px 20px;
    height: 36px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

/* Zone de feedback */
.icf-feedback {
    display: block;
    width: 100%;
    margin: 16px 0;
    padding: 12px;
    text-align: center;
    border-radius: 6px;
}

/* Responsive : passe en colonne sur petits écrans (< 500px) */
@media (max-width: 500px) {

    .icf-selection-zone {
        flex-direction: column;
        gap: 16px;
    }

    .icf-selection-zone .icf-selects-row {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .icf-selection-zone .icf-selects-row .icf-group {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }

    .icf-selection-zone .icf-selects-row label {
        width: 100px;
    }


    .icf-evaluation-widget .icf-selection-zone button {
        margin: 8px auto 0 auto;
        width: auto;
        min-width: 140px;
    }
}

/* ========================================
   BADGES DE TEMPS DE RÉPONSE
   ======================================== */

.icf-time-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 4px;
    white-space: nowrap;
}

/* 🟢 Rapide : < 60s */
.icf-time-badge.icf-time-fast {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 🟡 OK : 60-90s */
.icf-time-badge.icf-time-ok {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* 🔴 Lent : > 90s */
.icf-time-badge.icf-time-slow {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Animation pulse */
.icf-time-badge.icf-time-slow {
    animation: pulse-slow 2s ease-in-out infinite;
}

@keyframes pulse-slow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}
