/* =======================================================================
   1. STYLES DU BOUTON DE GENERATION AVEC LE LLM
   Les styles sont principalement gérés par .generation-button-group dans style.css
   Ce fichier conserve les styles spécifiques au dropdown.
   ======================================================================= */

/* =======================================================================
   2. SÉLECTEUR DE MODÈLE (DROPDOWN)
   ======================================================================= */
:root {
    --llm-selector-max-height: 70vh;
}
/* Dropdown sizing and wrapping (moved from style.css) */
.model-selector-dropdown {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 22rem;
    width: clamp(22rem, 32vw, 30rem);
    max-width: 90vw;
    word-wrap: break-word;
    box-shadow: 0 0.5rem 1rem 0 rgba(0,0,0,0.2);
    z-index: 10;
    list-style: none;
    padding: 0.25rem 0;
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    top: 100%;
    right: 0;
    font-size: 0.95rem;
    line-height: 1.35;
    max-height: var(--llm-selector-max-height, 70vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-top: 8px;
}

.model-selector-dropdown.show {
    display: block;
}

#module-sidebar .llm-selector-group {
    position: relative;
    flex-direction: column;
    gap: 0.5rem;
}

#module-sidebar .llm-buttons-row {
    display: flex;
    width: 100%;
    gap: 0;
}

#module-sidebar .llm-buttons-row .main-action-button {
    flex: 1 1 auto;
    min-width: 0;
}

#module-sidebar .llm-buttons-row .main-action-button .action-btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

#module-sidebar .llm-buttons-row .more-actions-button {
    position: relative;
    display: flex;
    margin-left: -1px;
}

#module-sidebar .llm-buttons-row .more-actions-button .dropdown-toggle {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

@media (max-width: 768px) {
    #module-sidebar .llm-selector-group {
        gap: 0;
    }

    #module-sidebar .llm-buttons-row {
        flex-wrap: nowrap;
    }

    #module-sidebar .llm-selector-group .model-selector-dropdown {
        position: static;
        transform: none;
        top: auto;
        right: auto;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        margin-top: 0.5rem;
        margin-bottom: 0;
        box-shadow: none;
        border-radius: 1rem;
        border: 1px solid #ddd;
        max-height: var(--llm-selector-max-height, 70vh);
        z-index: 1;
    }

    #module-sidebar .llm-selector-group .model-selector-dropdown.force-wide {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }
}

.model-selector-dropdown li {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
}

.model-selector-dropdown li:last-child {
    border-bottom: none;
}

.model-selector-dropdown li:hover {
    background-color: #ddd;
}

.model-selector-dropdown li.selected {
    background-color: #e9e9e9;
    font-weight: bold;
}

.model-selector-dropdown li.selected::before {
    content: '✔ ';
    color: #007bff;
    margin-right: 5px;
}

.model-selector-dropdown li strong {
    font-weight: bold;
}

.model-selector-dropdown li small {
    color: #555;
}

.model-selector-dropdown.force-wide {
    min-width: 26rem;
    width: clamp(26rem, 50vw, 42rem);
    max-width: 95vw;
}

/* =======================================================================
   3. STYLES DES "PILULES" D'INFORMATION
   ======================================================================= */
.model-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.model-pills {
    display: inline-flex;
    align-items: center;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 1px 0px;
    font-size: 0.65em;
    overflow: hidden;
}

.model-pills .pill-label {
    background-color: #e0e0e0;
    padding: 1px 5px;
    font-weight: bold;
    border-right: 1px solid #ccc;
}

.model-pills .pill-value {
    padding: 1px 5px;
    color: #333;
}

/* =======================================================================
   4. ÉTAT DÉSACTIVÉ
   ======================================================================= */
.greyed-out {
    filter: grayscale(90%);
    opacity: 1;
}
