/* ===== STYLES DE BASE ===== */

* { 
    box-sizing: border-box; 
    font-family: 'Open Sans', sans-serif; 
}
 
body { 
    margin: 0 auto; 
    padding: 20px; 
    background-color: #fff; 
    max-width: 100%;
    font-weight: lighter;
}
/* dans home : container principal compense le bandeau fixe */
body:has(#top-bar) .container {
    margin-top: 60px; 
}
@keyframes rotate-bg-color {
    0% { background-color: #f0f8ff; }
    50% { background-color: #333; }
    100% { background-color: #f0f8ff; }
}
h1 { 
    text-align: left;
    width: 100%;
    color: #000; 
    font-size: 28px; /* titres home */
}

h2 { 
    color: #a9a9a9; 
    font-size: 24px; /* titres section */
}

h3 { 
    color: #333; 
    font-size: 18px; /* autres titres */
}

.couleur { 
    background-color: #f9f9f9; /* la couleur ! #f0f8ff */
}

a { 
    color: #555; 
}

div { 
    font-size: 14px; 
}

p { 
    font-size: 14px; 
}

.hidden { 
    display: none; 
}

.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ===== STRUCTURE PRINCIPALE ===== */

.container { 
    max-width: 770px; 
    width: 100%;
    margin: 22px auto;
    background: white; 
    padding: 22px; 
    /* border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); */
}

.form-group { 
    margin-bottom: 15px; 
}

/* ===== BOUTONS ===== */

.btn { 
    padding: 10px 15px;
    cursor: pointer; 
    font-size: 16px; 
    text-decoration: none; 
}

.minibtn {
  padding: 3px 8px 4px 8px;
}

.btn, .minibtn {
  color: #fff;
  border: none; 
  background-color: #333;
  border-radius: 7px;
}

.btn:hover { 
    background-color: #45a049; 
}

.btn-danger { 
    background-color: #333; 
}

.btn-danger:hover { 
    background-color: #d32f2f; 
}

.btn-secondary { 
    background-color: #333; 
}

.btn-secondary:hover { 
    background-color: #0b7dda; 
}

.btn-export { 
    background-color: #6c757d; 
}

.btn-export:hover { 
    background-color: #5a6268; 
}

.btn-group { 
    display: flex; 
    gap: 10px; 
    margin-top: 10px; 
}

/* ===== ICONES ===== */

.view-home-btn, .view-close-btn {
    position: fixed;
    top: 15px;
    background: #333;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.view-home-btn {
    left: 15px;
}

.view-close-btn {
    right: 15px;
}

.home-icon {
    width: 28px;
    height: 28px;
    color: #ffffff;
}
.favoris-section {
    margin-bottom: 20px;
    padding: 0px 22px 11px 22px; 
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ===== FORMULAIRES ET CHAMPS ===== */

label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: bold; 
}

label:after {
    content: "" !important;
}

/* champs et types d'input */
input[type="text"], 
input[type="number"], 
input[type="password"], 
input[type="date"], 
input[type="datetime-local"],
input[type="time"], 
input[type="email"], 
input[type="url"], 
input[type="tel"],
input[data-type="postal-code"],
textarea, 
select {
    width: 100%; 
    padding: 11px; 
    border: 1px solid #ddd; 
    border-radius: 7px; 
    font-size: 16px;
}

input::file-selector-button {
  color: #fff;
  padding: 0.5em;
  background-color: #333;
  border-radius: 7px;
}
input[type="number"] { 
    text-align: right; 
}

input[data-type="postal-code"] {
    text-transform: uppercase;
}

textarea { 
    min-height: 100px; 
}

.radio-group, .checkbox-group { 
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
}

.radio-option, .checkbox-option { 
    display: flex; 
    align-items: center; 
}

.radio-option input, .checkbox-option input { 
    margin-right: 8px; 
}

input[type="range"] {
    -webkit-appearance: none;
    height: 8px;
    background: #ddd;
    border-radius: 7px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #333;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #333;
    border-radius: 50%;
    cursor: pointer;
}

.range-value-btn {
    font-family: monospace;
    font-weight: bold;
    cursor: default;
    user-select: none;
}
#favorites-panel {
    transition: all 0.3s ease;
    border: 1px solid #ddd;
}
.favorite-btn {
    transition: background-color 0.3s ease;
}
/* liste ordonnancement */
.sortable-list-container {
    margin: 10px 0;
}

.sortable-list {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    background: #f9f9f9;
    min-height: 100px;
}

.sortable-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin: 5px 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: move;
    transition: all 0.2s ease;
}

.sortable-item:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.sortable-item.sortable-ghost {
    opacity: 0.4;
    background: #e3f2fd;
}

.drag-handle {
    cursor: grab;
    user-select: none;
    font-size: 16px;
}

.drag-handle:active {
    cursor: grabbing;
}

.item-text {
    flex: 1;
    user-select: none;
}

.remove-item-btn {
    background: #333;
    color: white;
    border: none;
    border-radius: 7px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-item-btn:hover {
    background: #cc0000;
    transform: scale(1.1);
}

.sortable-stats {
    margin-top: 8px;
    text-align: right;
    color: #666;
    font-size: 0.9em;
}

/* ===== SIGNATURE ===== */

.signature-container {
    margin-bottom: 15px;
}

.signature-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

canvas {
    background-color: #f0f8ff;
    cursor: crosshair;
}

.signature-preview img {
    width: 240px;
    max-width: 310px;
    max-height: 180px;
    margin-bottom: 10px;
}

.signature-container.hide-canvas canvas {
    display: none;
}

.signature-container.hide-canvas .save-btn {
    display: none;
}

/* ===== GESTION DES FICHIERS ===== */

.file-drop-area {
    border: 2px dashed #ddd;
    padding: 20px;
    text-align: center;
    margin-bottom: 10px;
}

.file-preview {
    margin-top: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.file-item a {
    margin-right: 10px;
}

.remove-file {
    background: none;
    border: none;
    color: red;
    cursor: pointer;
}

/* ===== CARTES FICHIERS EN LIGNE ===== */

.file-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.file-item {
    text-align: center;
    max-width: 120px;
    flex: 0 0 auto; /* Empêche le redimensionnement */
}

.document-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.document-card {
    background-color: #333;
    color: white;
    padding: 15px;
    border-radius: 7px;
    text-align: center;
    min-width: 120px;
    max-width: 150px;
    margin: 5px 0;
    flex: 0 0 auto; /* Important pour rester en ligne */
    transition: all 0.3s ease;
    cursor: pointer;
}

.document-card:hover {
    background-color: #45a049 !important;
    transform: translateY(-2px);
}

.file-item .thumbnail {
    max-width: 100px;
    max-height: 100px;
    border: 1px solid #ddd;
    margin-bottom: 5px;
}

.file-name {
    word-break: break-word;
    font-size: 12px;
}

.audio-player, .video-player {
    margin: 10px 0;
}


/* ===== LECTEURS AUDIO ===== */

audio {
    width: 100%;
    background: #333 !important;
    border-radius: 7px;
    filter: none !important; /* Supprime les filtres précédents */
}

audio::-webkit-media-controls-panel {
    background: #333 !important;
    border-radius: 7px;
}

audio::-webkit-media-controls-play-button,
audio::-webkit-media-controls-volume-slider,
audio::-webkit-media-controls-timeline,
audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display,
audio::-webkit-media-controls-mute-button {
    filter: invert(1) brightness(2) !important; /* Rend les contrôles blancs */
}

/* Pour Firefox */
audio::-moz-range-track {
    background: #555;
}

audio::-moz-range-thumb {
    background: white;
}

/* Style général pour tous les lecteurs multimédias */
.audio-player, .video-player {
    margin: 10px 0;
    background: #333;
    border-radius: 7px;
    padding: 5px;
}
/* ===== TABLEAU ET DONNEES ===== */

.table-container { 
    max-width: 770px;
    overflow-x: auto; 
    margin-top: 20px; 
    max-height: 70vh;
    overflow-y: auto;
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    min-width: 600px; 
    table-layout: auto; 
}

th, td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid #ddd; 
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: auto; 
    position: relative;
}

th { 
    background-color: #f2f2f2; 
    cursor: pointer; 
    position: relative; 
}

th:hover { 
    background-color: #e6e6e6; 
}

th.sorted-asc::after { 
    content: " ↑"; 
}

th.sorted-desc::after { 
    content: " ↓"; 
}

tr:hover { 
    background-color: #f5f5f5; 
}

tr.row-active {
    background-color: #f0f7ff !important;
}

thead th {
    position: sticky;
    top: 0;
    background-color: #f2f2f2;
    z-index: 10;
}

.number-cell, .formula-cell { 
    text-align: right; 
    font-family: monospace; 
}

.formula-cell {
    background-color: #f0f8ff;
}

.edit-btn {
    display: none; 
}

.edit-mode .edit-btn {
    display: table-cell;
}

/* ===== RECHERCHE ===== */

#live-search {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 15px;
    width: 100%;
    max-width: 400px;
}

/* ===== FILTRES ===== */

.filters-section {
    margin-bottom: 20px;
    padding: 4px 22px 4px 22px; 
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.filters-section select[multiple] {
    min-height: 11px;
    padding: 7px;
}

.filters-section .form-group {
    margin-bottom: 10px;
}

.incremental-select-container select[multiple] {
    width: 100%;
    min-height: 14px;
    padding: 5px;
}

.incremental-select-container input[type="text"] {
    width: calc(100% - 100px);
    padding: 8px;
    margin-right: 10px;
}

.incremental-select-container button {
    padding: 8px 12px;
}

.column-filter {
    width: 100%;
    padding: 5px;
    font-size: 12px;
}

.period-filter-group {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 10px;
    margin-bottom: 15px;
}

.period-filter-group h4 {
    margin-top: 0;
    color: #007bff;
}

/* ===== VUE DETAILLEE ===== */

#detail-mode, #view-mode {
    max-width: 770px;
    margin: 0 auto;
    padding: 0px;
    position: relative;
}

.detail-view {
    display: flex;
    padding: 22px;
    flex-direction: column;
    gap: 25px;
    margin: 20px 0;
}

.detail-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}
/* labels titre */
.detail-item h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
    font-weight: bold;
}

.detail-label {
    font-weight: bold;
    color: #555;
    width: 200px; 
    min-width: 200px;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word; 
}

.detail-value {
    font-size: 16px;
    line-height: 1.5;
    word-break: break-word;
}

.detail-view > div.detail-value:empty {
    display: none;
}

.detail-view > div.detail-label:has(+ div.detail-value:empty) {
    display: none;
}

.detail-view .thumbnail {
    max-width: 100px;
    max-height: 100px;
    margin: 5px;
}

/* ===== STATISTIQUES ET ANALYSE ===== */

.stats-container { 
    margin-bottom: 20px; 
    padding: 4px 22px 4px 22px; 
    background-color: #fff; 
    border-radius: 7px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stats-row { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 20px; 
    margin-bottom: 10px; 
}

.stat-item { 
    font-size: 14px; 
    margin-bottom: 15px;
}

.stat-value {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
}

.progress-container {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 7px;
    margin: 5px 0;
    overflow: hidden;
}

.progress-bar {
    height: 20px;
    border-radius: 7px;
    text-align: right;
    padding-right: 5px;
    line-height: 20px;
    color: white;
    font-weight: bold;
    font-size: 12px;
    transition: width 0.7s ease;
}

/* ===== ELEMENTS INTERACTIFS ===== */

.field-item { 
    padding: 15px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    margin-bottom: 10px; 
    background-color: #f9f9f9; 
}

.field-actions { 
    display: flex; 
    gap: 5px; 
    margin-top: 10px; 
}

.clickable-value {
    color: #555;
    font-size: 0.9em;
    text-decoration: none;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
}

.clickable-value:hover {
    background-color: #e3f2fd;
}

.copy-ref { 
    cursor: pointer; 
    color: #2196F3; 
    text-decoration: underline; 
}

.confirm-dialog { 
    background-color: #fff3cd; 
    padding: 15px; 
    border-radius: 4px; 
    margin-top: 10px; 
    border: 1px solid #ffeeba; 
}

.replace-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff3cd;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ffeeba;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 80%;
    text-align: center;
}

.replace-options {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.replace-options button {
    padding: 5px 10px;
    cursor: pointer;
}

/* ===== REQUETES SAUVEGARDEES ===== */

.saved-queries-section {
    transition: all 0.3s ease;
}

.saved-queries-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.saved-query-item {
    margin-bottom: 12px;
    padding: 12px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 7px;
    transition: all 0.2s ease;
}

.saved-query-item:hover {
    background-color: #f0f7ff;
    border-color: #d0e3ff;
}

.query-name-container {
    margin-bottom: 8px;
}

.query-load-form {
    display: block;
    width: 100%;
}

.query-name-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 8px 10px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.query-name-btn:hover {
    background-color: #e9ecef;
    color: #000;
}

.query-name-btn::before {
    content: "→";
    color: #333;
    font-weight: bold;
}

.query-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-left: 10px;
    border-top: 1px solid #eee;
    padding-top: 8px;
    margin-top: 4px;
}

.query-action-form {
    margin: 0;
}

.query-actions .minibtn {
    padding: 4px 8px;
    font-size: 13px;
    border-radius: 5px;
    min-width: 30px;
    text-align: center;
}

.query-actions .favorite-btn {
    background-color: #ddd !important;
    color: #333;
}

.query-actions .favorite-btn:hover {
    background-color: #ffd700 !important;
    color: #333;
}

/* Responsive */
@media (max-width: 600px) {
    .saved-query-item {
        padding: 10px;
    }
    
    .query-name-btn {
        padding: 6px 8px;
        font-size: 14px;
    }
    
    .query-actions {
        gap: 6px;
    }
    
    .query-actions .minibtn {
        padding: 3px 6px;
        font-size: 12px;
        min-width: 26px;
    }
}

@media (max-width: 400px) {
    .query-actions {
        justify-content: center;
    }
}

/* ===== MODES AFFICHAGE ===== */

.edit-only { 
    display: none; 
}

.edit-mode .edit-only { 
    display: block; 
}

.edit-mode .view-only { 
    display: none; 
}

.edit-mode .stats-container,
.edit-mode .chart-container,
.edit-mode .saved-queries-section,
.edit-mode .datex {
    display: none !important;
}

.hide-stats .stats-container {
    display: none;
}

.hide-filters .filters-section,
.hide-filters .datex,
.hide-filters .saved-queries-section {
    display: none;
}

.hide-results .table-container,
.hide-results #live-search,
.hide-results .btn-group:has(.btn-export) {
    display: none;
}

.hide-form-settings #toggle-form {
    display: none;
}

.hide-fields-management #toggle-fields {
    display: none;
}

/* ===== BOUTONS DE TOGGLE ===== */

#toggle-form-btn, 
#toggle-fields-btn, 
#toggle-stats, 
#toggle-results, 
.toggle-recents {
    margin-bottom: 15px;
    background-color: #6c757d;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s ease;
}

#toggle-form-btn:hover, 
#toggle-fields-btn:hover, 
#toggle-stats:hover, 
#toggle-results:hover, 
.toggle-recents:hover {
    background-color: #5a6268;
}

.edit-mode #toggle-results {
    background-color: #333;
}

.toggle-recents {
    background-color: #6c757d !important;
}
.recent-entries {
    transition: all 0.3s ease;
    border-top: 0px solid #ddd;
    padding-top: 10px;
    padding-bottom: 22px;
    border-radius: 7px;
    max-height: 330px;
    overflow-y: auto;
    margin: -10px 0px 22px 0px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* boutons alternatifs on/off formulaire */
.toggle-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.toggle-button {
    padding: 4px 7px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.1s ease;
    font-size: 14px;
}

.toggle-button-active {
    background: #333;
    color: white;
    border-color: #333;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 800px) {
    .container {
        margin: 10px auto;
        padding: 15px;
    }
    
    #top-bar {
        padding: 10px 15px;
    }
    
    #top-bar > div {
        padding: 0 10px;
    }
    
    .message-container {
        margin-top: 60px;
        padding: 0 10px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 10px;
        margin: 5px auto;
    }
    
    .btn-group, .field-actions { 
        flex-direction: column; 
    }
    
    .stats-row { 
        flex-direction: column; 
        gap: 5px; 
    }
    
    .detail-view {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .detail-label {
        width: 100%;
        min-width: auto;
    }
    
    .incremental-select-container input[type="text"] {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* ===== MESSAGES ET ALERTES ===== */

.message-container {
    max-width: 770px;
    margin: 20px auto; /* Marge normale pour toutes les pages */
    padding: 0 15px;
}

.session-message {
    background: #555; 
    color: #eee; 
    padding: 10px; 
    margin: 10px 0; 
    border-radius: 7px;
    border: 1px solid #c3e6cb;
}

.session-error {
    background: #f8d7da; 
    color: #721c24; 
    padding: 10px; 
    margin: 10px 0; 
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

/* ===== CARTES UNIVERS ===== */

.univers-card {
    margin-bottom: 14px;
    padding: 10px 10px 20px 10px;
    border: 1px solid #ddd;
    border-radius: 7px;
    background-color: #f0f8ff;
    position: relative;
    overflow: visible;
    min-height: 80px;
}

/* Cartes AVEC image */
.univers-card.with-image {
    margin-bottom: 47px;
    background: none;
    border: none;
    padding: 0;
    border-radius: 11px;
    min-height: 160px;
    overflow: visible;
}

/* Image de fond */
.univers-image-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 11px;
    overflow: hidden;
    z-index: 1;
}

/* Overlay sombre pour meilleure lisibilité */
.univers-image-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 11px;
}

/* Animation image de fond */
.univers-card.with-image .univers-image-background {
    animation: floatBackground 28s ease-in-out infinite;
    background-size: cover;
    background-position: center;
}

@keyframes floatBackground {
    0% {
        background-position: center center;
        background-size: 100% auto;
    }
    16% {
        background-position: 90% 10%;
        background-size: 110% auto;
    }
    32% {
        background-position: 90% 90%;
        background-size: 104% auto;
    }
    48% {
        background-position: 10% 90%;
        background-size: 122% auto;
    }
    64% {
        background-position: 10% 10%;
        background-size: 108
        7% auto;
    }
    80% {
        background-position: 50% 30%;
        background-size: 111% auto;
    }
    100% {
        background-position: center center;
        background-size: 100% auto;
    }
}

/* Titre des cartes */
.univers-title {
    position: relative;
    z-index: 2;
    text-align: center;
    border-radius: 11px 11px 0 0;
}

/* Titre pour cartes AVEC image */
.univers-card.with-image .univers-title {
    padding: 20px 15px 70px 15px;
    min-height: 120px;
}

.univers-card.with-image .univers-title h3 {
    color: white;
    margin-top: 11px;
    font-size: 1.4em;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Titre pour cartes SANS image */
.univers-card:not(.with-image) .univers-title {
    padding: 0 0 10px 0;
    text-align: left;
    min-height: auto;
}

.univers-card:not(.with-image) .univers-title h3 {
    color: #333;
    text-shadow: none;
    font-size: 1.1em;
}

/* Conteneur des boutons d'actions */
.univers-actions {
    position: absolute;
    z-index: 11;
    background: white;
    padding: 8px 12px;
    border-radius: 11px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: inline-block;
    white-space: nowrap;
    width: auto;
    min-width: min-content;
    
    /* Positionnement au centre en bas */
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
}

/* Espacement entre les boutons pour cartes AVEC image */
.univers-card.with-image .univers-actions > * {
    display: inline-block;
    margin-right: 5px;
}

.univers-card.with-image .univers-actions > *:last-child {
    margin-right: 0;
}

/* Actions pour cartes SANS image */
.univers-card:not(.with-image) .univers-actions {
    position: relative;
    margin: 10px 0 0 0;
    padding: 0;
    background: none;
    box-shadow: none;
    text-align: left;
    display: block;
    width: 100%;
    min-width: auto;
    bottom: auto;
    left: auto;
    transform: none;
    white-space: normal;
}

/* Style spécifique pour les titres en mode results */
.title-card .univers-title {
    padding: 40px 20px;
    text-align: center;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.title-card .univers-actions {
    display: none;
}

/* Ajustement pour le mode edit */
.edit-mode .title-card {
    margin-top: 20px;
}

/* ===== GÉNÉRATEUR DE CHAMPS ===== */

.generator-field-item {
    margin-bottom: 14px;
    border: 1px solid #ddd;
    border-radius: 7px;
    background-color: #f0f8ff;
    overflow: hidden;
    position: relative;
}

.generator-field-header {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.generator-field-header:hover {
    background: #e9ecef;
}

.generator-field-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: normal;
}

.generator-field-header h4 small {
    color: #666;
    font-size: 14px;
    margin-left: 8px;
    font-weight: normal;
}

.generator-toggle-arrow {
    font-size: 12px;
    color: #333;
    transition: transform 0.3s ease;
}

.generator-field-actions {
    padding: 15px;
    background: #fff;
    display: none;
}

.generator-field-options {
    margin-bottom: 15px;
    padding: 10px;
    background: #f1f8ff;
    border-radius: 7px;
    border-left: 3px solid #333;
    font-size: 13px;
}

.generator-field-options strong {
    color: #333;
}

.generator-option-tag {
    display: inline-block;
    background: #333;
    color: white;
    padding: 2px 8px;
    border-radius: 7px;
    margin: 0 5px;
    font-size: 11px;
}

.generator-field-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.generator-inline-form {
    margin: 0;
}

.generator-field-buttons .btn {
    padding: 8px 15px;
    font-size: 14px;
    border-radius: 7px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    background-color: #333;
    color: #fff;
}

.generator-field-buttons .btn:hover {
    background-color: #45a049;
}

.generator-field-buttons .btn:disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Animation pour l'ouverture/fermeture */
@keyframes generatorSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.generator-field-actions[style*="display: block"] {
    animation: generatorSlideDown 0.3s ease forwards;
}