/* Module voix : CSS extrait d'argon-app.css (scripts/extract_module_css.py). Feuille du module : editer ici, avec les variables de static/css/app/tokens.css. */
/* =========================================================================
   Voice Gallery — galerie de voix avec filtres, preview et description.
   ========================================================================= */

.voice-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.voice-gallery-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fc;
    border: 1px solid var(--mv-gray-200);
    border-radius: 0.5rem;
}

/* Toolbar version inline : tout sur une seule ligne quand la place le permet */
.voice-gallery-toolbar-inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
}

.voice-gallery-toolbar-inline .voice-gallery-search {
    flex: 1 1 240px;
    min-width: 200px;
}

.voice-gallery-toolbar-inline .voice-gallery-chips {
    flex-shrink: 0;
}

.voice-gallery-toolbar-inline .voice-gallery-langue-select {
    width: auto;
    min-width: 170px;
    flex-shrink: 0;
}

.voice-gallery-toolbar-inline .voice-gallery-toggle {
    flex-shrink: 0;
    white-space: nowrap;
}

.voice-gallery-search {
    position: relative;
}

.voice-gallery-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.85rem;
    pointer-events: none;
}

.voice-gallery-search-input {
    padding-left: 2.25rem;
}

.voice-gallery-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.voice-gallery-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    background: #fff;
    border: 1px solid var(--mv-gray-200);
    border-radius: 999px;
    padding: 0.25rem;
}

.voice-gallery-chip {
    border: none;
    background: transparent;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.voice-gallery-chip:hover {
    background: #edf2f7;
}

.voice-gallery-chip.active {
    background: var(--mv-primary);
    color: #fff;
}

.voice-gallery-langue-select {
    max-width: 240px;
}

.voice-gallery-filter-row-compact {
    padding-top: 0.15rem;
}

.voice-gallery-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.voice-gallery-toggle .form-check-input {
    margin: 0;
    cursor: pointer;
}

.voice-gallery-toggle-icon {
    color: #f59e0b;
    font-size: 0.85rem;
}

.voice-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.85rem;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.25rem;
}

.voice-gallery-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--mv-gray-500);
}

.voice-gallery-empty-icon {
    font-size: 2rem;
    color: #cbd5e0;
    display: block;
    margin-bottom: 0.5rem;
}

.voice-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.9rem;
    background: #fff;
    border: 1px solid var(--mv-gray-200);
    border-radius: 0.65rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.voice-card:hover {
    border-color: #c4cfe5;
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.08);
}

.voice-card:focus-visible {
    outline: 2px solid var(--mv-primary);
    outline-offset: 2px;
}

.voice-card-selected {
    border-color: var(--mv-primary);
    box-shadow: 0 0 0 2px rgba(0, 85, 255, 0.25);
}

.voice-card-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.voice-card-identity {
    min-width: 0;
    flex: 1;
}

.voice-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.25rem;
}

.voice-card-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    background: #edf2f7;
    color: #4a5568;
    line-height: 1.4;
}

.voice-card-badge i {
    font-size: 0.6rem;
}

.voice-card-badge-genre-F {
    background: #fce7f3;
    color: #be185d;
}

.voice-card-badge-genre-M {
    background: var(--mv-primary-100);
    color: var(--mv-primary-hover);
}

.voice-card-badge-genre-N {
    background: #f3f4f6;
    color: #4b5563;
}

.voice-card-badge-base {
    background: #fef3c7;
    color: #92400e;
}

.voice-card-badge-type-classic {
    background: #e0f2fe;
    color: #0369a1;
}

.voice-card-badge-type-exp {
    background: #f3e8ff;
    color: #7e22ce;
}

.voice-card-name {
    flex-shrink: 1;
    min-width: 0;
}

.voice-card-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    line-height: 1;
}

.voice-card-icon {
    font-size: 0.82rem;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
}

.voice-card-icon-genre-F { color: #ec4899; }
.voice-card-icon-genre-M { color: var(--mv-primary); }
.voice-card-icon-exp     { color: #7e22ce; }

.voice-card-icon-exclusive {
    display: inline-block;
    width: 14px;
    height: 14px;
    object-fit: contain;
    border-radius: 3px;
}

.voice-card-recommended {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    font-size: 0.7rem;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.35);
}

.voice-card-recommended-bg {
    background: linear-gradient(180deg, #fffdf5, #ffffff);
    border-color: #fde68a;
}

.voice-card-recommended-bg:hover {
    border-color: #fbbf24;
}

.voice-card-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.voice-card-badge-exclusive {
    background: linear-gradient(135deg, #111827, #374151);
    color: #fde68a;
    border: 1px solid #fbbf24;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.25);
}

.voice-card-badge-exclusive i {
    color: #fbbf24;
}

.voice-card-exclusive {
    border-color: #d4a017;
    box-shadow: 0 2px 8px rgba(212, 160, 23, 0.18);
}

.voice-card-exclusive:hover {
    border-color: #b8860b;
    box-shadow: 0 4px 14px rgba(212, 160, 23, 0.28);
}

/* Bloc volume voix — slider + valeur numérique */
.voice-volume-block {
    background: #f8f9fc;
    border: 1px solid var(--mv-gray-200);
    border-radius: 0.6rem;
    padding: 0.85rem 1rem;
}

.voice-volume-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.voice-volume-header label {
    font-size: 0.88rem;
    color: #2d3748;
    font-weight: 600;
}

.voice-volume-hint {
    font-size: 0.72rem;
    color: var(--mv-gray-400);
    font-style: italic;
}

.voice-volume-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.voice-volume-icon-btn {
    border: 1px solid var(--mv-gray-200);
    background: #ffffff;
    color: var(--mv-gray-500);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.voice-volume-icon-btn:hover {
    background: var(--mv-primary);
    color: #fff;
    border-color: var(--mv-primary);
}

.voice-volume-range-wrap {
    flex: 1;
    min-width: 200px;
    position: relative;
    padding-bottom: 1.1rem;
}

.voice-volume-range {
    width: 100%;
    height: 0.4rem;
    accent-color: var(--mv-primary);
    margin: 0;
}

/* Coloration du fond du slider : zone "neutre" 0-100 sobre, zone "boost" 100-400 ambrée */
.voice-volume-range {
    background: linear-gradient(
        to right,
        var(--mv-gray-200) 0%,
        var(--mv-gray-200) 25%,
        #fde68a 25%,
        #f59e0b 100%
    );
    border-radius: 999px;
    -webkit-appearance: none;
    appearance: none;
}

.voice-volume-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    background: var(--mv-primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.25);
    cursor: pointer;
}

.voice-volume-range::-moz-range-thumb {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    background: var(--mv-primary);
    border: 2px solid #fff;
    cursor: pointer;
}

.voice-volume-scale {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 0.1rem;
    height: 0.85rem;
    pointer-events: none;
}

.voice-volume-scale span {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.62rem;
    color: var(--mv-gray-400);
    font-weight: 500;
    line-height: 1;
}

.voice-volume-scale-neutral {
    color: #16a34a !important;
    font-weight: 700 !important;
}

.voice-volume-icon-btn-boost {
    color: #f59e0b !important;
    border-color: #fde68a !important;
}

.voice-volume-icon-btn-boost:hover {
    background: #f59e0b !important;
    color: #fff !important;
    border-color: #f59e0b !important;
}

.voice-volume-number-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #fff;
    border: 1px solid var(--mv-gray-200);
    border-radius: 0.4rem;
    padding: 0.05rem 0.4rem 0.05rem 0.05rem;
    flex-shrink: 0;
}

.voice-volume-number {
    width: 3.4rem;
    text-align: center;
    border: none !important;
    box-shadow: none !important;
    padding: 0.25rem 0.15rem !important;
    background: transparent;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.85rem;
}

.voice-volume-number:focus {
    outline: none;
}

.voice-volume-percent {
    font-size: 0.78rem;
    color: var(--mv-gray-400);
    font-weight: 500;
}

@media (max-width: 576px) {
    .voice-volume-controls {
        flex-wrap: wrap;
    }
    .voice-volume-range {
        order: 3;
        flex-basis: 100%;
    }
}

/* Modale voice gallery élargie (au-delà de modal-xl Bootstrap = 1140px) */
@media (min-width: 1200px) {
    .voice-gallery-modal-dialog {
        max-width: 1320px;
    }
}

@media (min-width: 1500px) {
    .voice-gallery-modal-dialog {
        max-width: 1480px;
    }
}

/* Grille plus dense quand la modale est large */
.voice-gallery-modal-dialog .voice-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    max-height: 65vh;
}

.voice-card-play {
    flex-shrink: 0;
    margin-left: auto;
    padding: 0;
    width: 1.05rem;
    height: 1.05rem;
    border: none;
    background: transparent;
    color: var(--mv-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease, transform 0.15s ease;
}

.voice-card-play i {
    font-size: 0.82rem;
    line-height: 1;
}

.voice-card-play:hover {
    color: #3b4dc3;
    transform: scale(1.15);
}

.voice-card-play.playing {
    color: #16a34a;
    animation: voice-card-pulse 1.5s ease-in-out infinite;
}

@keyframes voice-card-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.voice-card-langues {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.voice-card-langue-chip {
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 0.25rem;
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 500;
}

.voice-card-langue-chip-more {
    background: var(--mv-gray-200);
    color: var(--mv-gray-600);
    cursor: help;
    font-weight: 600;
}

.voice-card-description {
    font-size: 0.8125rem;
    color: #4a5568;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.voice-card-description-empty {
    color: #a0aec0;
    font-style: italic;
}

.voice-card-tips {
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
    font-size: 0.78rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.4rem;
    padding: 0.4rem 0.55rem;
    line-height: 1.35;
}

.voice-card-tips-icon {
    color: #d97706;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.voice-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.voice-card-selected-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #16a34a;
}

.voice-card-select {
    margin: 0;
}

/* Resume panel (parametre_editor) */
.voice-summary-panel {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem;
    background: #fff;
    border: 1px solid var(--mv-gray-200);
    border-radius: 0.6rem;
}

.voice-summary-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mv-primary), #825ee4);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.voice-summary-body {
    flex: 1;
    min-width: 0;
}

.voice-summary-name {
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-summary-meta {
    font-size: 0.8rem;
    color: var(--mv-gray-500);
    margin-top: 0.15rem;
}

.voice-summary-empty {
    color: #a0aec0;
    font-style: italic;
}

@media (max-width: 576px) {
    .voice-gallery-grid {
        grid-template-columns: 1fr;
    }
    .voice-gallery-filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    .voice-gallery-langue-select {
        max-width: 100%;
    }
}
