/* Input */

.n4v-text-input, .n4v-textarea-input {
    flex: auto 1;
}

/* Search */

.n4v-inactive-dependency {
    opacity: 0.6;
    position: relative;
}

.n4v-inactive-dependency::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.01);
    pointer-events: none;
}

/*rouge pour le moment, faire un truc grisé*/
.n4v-inactive-dependency {
    border: 1px solid #ff6b6b !important;
    border-radius: 4px;
    padding: 2px;
}


/* --- PRIORITÉ 1 : Dépendances non satisfaites (ROUGE) --- */
.n4v-search-border-deps {
    border: 2px solid #ff6b6b !important;  /* Rouge */
    border-radius: 4px;
    position: relative;
}

/* --- PRIORITÉ 2 : Indicateurs de mode (seulement si pas de dep issue) --- */
.n4v-search-border-std {
    border: 2px solid #28a745 !important;  /* Vert */
    border-radius: 4px;
    position: relative;
}

.n4v-search-border-adv {
    border: 2px solid #007bff !important;  /* Bleu */
    border-radius: 4px;
    position: relative;
}

/* --- Badge de mode --- */
.n4v-search-mode-badge {
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: uppercase;
    z-index: 20; /* Au-dessus de la bordure */
    pointer-events: none;
}

.n4v-search-mode-badge.n4v-badge-std {
    background-color: #28a745;
    color: white;
}

.n4v-search-mode-badge.n4v-badge-adv {
    background-color: #007bff;
    color: white;
}

/* --- Tooltip pour dépendances --- */
.n4v-search-dep-tooltip {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 12px;
    height: 12px;
    background: #ff6b6b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    cursor: help;
    z-index: 25;
}

.n4v-search-dep-tooltip::after {
    content: "!";
    font-weight: bold;
}

.accordion-button {
    color: rgba(51,51,51) !important;
    font-size: 14px;
    font-weight: normal;
    padding-left: 2.5rem;
    padding-right: 1rem;
}
.accordion-button::after {
    position: absolute;
    left: 1rem;
    right: auto;
    transform: rotate(-90deg);
}
.accordion-button:not(.collapsed) {
    color: initial !important;
}

.accordion-button:focus {
    color: initial !important;
    border: 1px dashed #acacac !important;
}
.accordion-button:not(.collapsed)::after {
    transform: rotate(0deg); /* flèche vers le bas (état ouvert) */
}

.form-control {
    border: 1px solid rgba(191,191,191) !important;
    border-radius: 0 !important;
  }
  

  .accordion-body > [data-id] {
    margin-left: 16px;
}

.n4vset-block{
    margin: 2px 5px 5px 5px;
}

/* Appliquer un layout flex aux conteneurs de propriété */
.n4vset-block[data-id] {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

/* Aligner label + input/select/pickr sur une ligne avec le lock à droite */
.n4vset-block[data-id] > .form-label,
.n4vset-block[data-id] > .form-check,
.n4vset-block[data-id] > .btn-group,
.n4vset-block[data-id] > select,
.n4vset-block[data-id] > input[type="text"],
.n4vset-block[data-id] > input[type="number"],
.n4vset-block[data-id] > div[id] { /* pour Pickr */
    /*order: 1;*/
}

.n4vset-block[data-id] > input[type="number"]{
    padding-left: 5px;
}

.n4vset-block[data-id] > small.form-text {
    order: 2;
    margin-top: 4px;
}


.n4vset-block[data-id] > .lock-toggle {    
    z-index: 1;
}

.n4vset-block-lib{
    display: flex;
    margin-right: 5px;
    /*in-width: 40%;*/
    align-items: center;
}

fieldset[data-id] legend {
    position: relative;
    display: flex;
    padding: 0px 0px 5px 0px;
}


.n4vset-block[data-id],
fieldset[data-id] {
    position: relative;
}

.pcr-result{
    flex: 1 1 15em !important;
}

.n4vset-block-font .n4vset-block[data-id$="_color"] > div {
    min-width: 1px;
    min-height: 1px;
}


#ceInteractBtn{
	width: 30px;
	height: 30px;
	border-radius: 4px;
    border: #ccc 1px solid;
    position: fixed;
    right: 5px;
    top: 42px;
}

#ceInteractBtn:hover{
	background-color: #29292933;
}

#ceInteractBtn.active{
	background-color: #346187;
    color: #fff;
}

.n4v-custom-tooltip {
    position: fixed;
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    max-width: 300px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.n4v-custom-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

.n4v-custom-tooltip .tooltip-title {
    font-weight: bold;
    margin-bottom: 4px;
    display: block;
}

.n4v-inactive-dependency {
    position: relative;
}

.n4v-inactive-dependency::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    z-index: 1;
    pointer-events: none;
    border: 1px dashed #ff4444;
    border-radius: 3px;
}

/* ==================================================================== */
/* RICHTEXT */
/* ==================================================================== */

/* Conteneur parent pour ancrer le positionnement absolu */
.n4v-richtext-wrapper {
    position: relative;
    width: 100%;
    /* min-height: 100px; 
    padding-top: 68px; */
}

/* Toolbar flottante */
.n4v-richtext-toolbar {
    position: absolute;
    top: -64px;
    right: 0;
    z-index: 100;
    font-size: 12px;
    font-family: '72';    
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    /* white-space: nowrap RETIRÉ pour permettre le retour à la ligne */
}

/* S'assure que l'éditeur prend toute la largeur disponible */
.n4v-richtext-editor {
    font-family: initial !important;
    color: #000000 !important;
    font-size: 12px !important;
    font-weight: normal !important;
    font-style: normal !important;
    text-decoration: none !important;
    line-height: normal !important;
    letter-spacing: normal !important;
    text-align: left !important;
    text-transform: none !important;
    white-space: normal !important;

    width: 100%;
    min-height: 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    box-sizing: border-box;
    background-color: #ffffff;
}

/* Style des boutons de la toolbar */
.n4v-richtext-toolbar button {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
}

.n4v-richtext-toolbar button.active {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.n4v-richtext-toolbar input[type="color"] {
    border: none;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    cursor: pointer;
}

/* Groupes dans la toolbar pour espacer les éléments */
.n4v-rt-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.n4v-rt-divider {
    display: inline-block;
    width: 1px;
    height: 20px;
    background-color: #ddd;
    margin: 0 6px;
    vertical-align: middle;
}

/* Style des selects dans la toolbar */
.n4v-rt-select {
    height: 28px;
    padding: 2px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #fff;
    cursor: pointer;
    outline: none;
    width: stretch;
}

.n4v-rt-select:hover {
    border-color: #999;
}

.n4v-rt-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

/* ===== AJOUTS POUR LE LAYOUT 2 LIGNES ===== */
.n4v-rt-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.n4v-rt-row + .n4v-rt-row {
    margin-top: 4px;
}

.n4v-richtext-editor[contenteditable="true"] {
    word-break: break-word;
    hyphens: auto;
}