/**
 * Custom CSS
 */

* {
    transition: all .3s ease-in-out;
}

a {
    text-decoration: none;
}

.cursor-pointer {
    cursor: pointer;
}

/**
 * Plasma
 */
body {
    background: url("../images/shapes/body-shape-bg.png") repeat fixed var(--bs-body-bg-html);
    background-size: contain;
}

.plasma-body {
    background: url("../images/shapes/plasma-body-shape-bg.png") repeat fixed;
    background-size: cover;
}

.plasma-body.station {
    background: url("../images/shapes/plasma-body-station-shape-bg.png") repeat fixed;
    background-size: cover;
}

.preserve-whitespace {
    white-space: pre-wrap;
    font-family: monospace;
}


/**
 * Header
 */
.plasma-header {
    fill: #424242;
}

[data-bs-theme="dark"] .plasma-header {
    fill: #BDBDBD;
}

/**
 * Media cover
 */
.media-cover {
    height: 50vh;
    overflow: hidden;
    position: relative;
    width: 100%;
    z-index: auto;
}

.media-cover > div {
    align-items: center;
    background-size: cover;
    background-position: center center;
    display: flex;
    height: 100%;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.media-cover > div > img {
    height: 100%;
    object-fit: cover;
    position: absolute;
    width: 100%;
}

/* Navigation */
.nav-link.link-body-emphasis:hover {
    color: var(--bs-primary) !important;
    background-color: var(--bs-secondary-bg);
}

/* Tom Select */
/* stylelint-disable no-descending-specificity */
.ts-control {
    border: none;
    padding: 2px 8px;
}

.ts-control .item {
    font-size: 16px !important;
}

.ts-wrapper input {
    font-size: 16px !important;
}

[data-bs-theme="dark"] .ts-control {
    color: var(--bs-gray-500);
}

[data-bs-theme="dark"] .ts-wrapper .ts-control {
    color: var(--bs-gray-500);
}

[data-bs-theme="dark"] .ts-control input {
    color: var(--bs-gray-500);
}

[data-bs-theme="dark"] .ts-dropdown {
    color: var(--bs-gray-500);
}

[data-bs-theme="light"] .ts-control {
    color: var(--bs-gray-500);
}

[data-bs-theme="light"] .ts-wrapper .ts-control {
    color: var(--bs-gray-500);
}

[data-bs-theme="light"] .ts-control input {
    color: var(--bs-gray-500);
}

[data-bs-theme="light"] .ts-dropdown {
    color: var(--bs-gray-500);
}

.ts-wrapper.multi.has-items .ts-control {
    border: none;
    padding: 2px 8px;
}
/* stylelint-enable no-descending-specificity */

/* 🧾 Textarea - numéros de ligne (style IDE)
 *
 * 📝 Utilisé par `public/js/apps.js` (wrapper .o-textarea-ln-wrap).
 * ⚠️ Numérotation basée sur les lignes logiques (\n), pas sur le wrap visuel.
 */
.o-textarea-ln-wrap {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    overflow: hidden;
    background: var(--bs-body-bg);
}

.o-textarea-ln-wrap textarea {
    flex: 1 1 auto;
    min-width: 0;
    border: 0 !important;
    outline: 0;
    box-shadow: none !important;
    border-radius: 0 !important;
    resize: vertical;
    font-family: var(--bs-font-monospace);
}

.o-textarea-ln-gutter {
    user-select: none;
    flex: 0 0 auto;
    min-width: 3.2rem;
    padding: .375rem .5rem;
    background: var(--bs-tertiary-bg);
    border-right: 1px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
    font-size: 1rem;
    line-height: 1.5;
    text-align: right;
    overflow: hidden;
}

.o-textarea-ln-gutter div {
    height: 1.5rem;
}

/* Form Search */
.search-form form {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Styles pour les tableaux imbriqués */
.nested-array {
    margin-bottom: 10px;
}

.nested-array > div {
    padding: 5px 0;
}

.table-responsive {
    margin-bottom: 15px;
}

.table-responsive:last-child {
    margin-bottom: 0;
}

.search-form form .mb-3 {
    margin-bottom: 0 !important;
}

.search-form form > div.search {
    flex: 1 1 40%;
}

.search-form form > div {
    flex: 1 1 20%;
}

.search-form form label {
    display: none;
}

.search-form form > div:first-child {
    margin-right: 0;
}

/* Form required */
label.required:not(.disabled) {
    position: relative;
}

label.required:not(.disabled)::before {
    color: #F44336;
    content: "*";
    font-size: 1rem;
    line-height: 1;
    margin-right: 0.1em;
    position: absolute;
    right: -.75rem;
    top: 0;
}

/**
 * Bouton Top Page
 */
.back-to-top {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: none;
    z-index: 1000;
}

/**
 * Article
 */
.card-body {
    background: url("../images/shapes/card-shape-bg.png") no-repeat center center;
    background-size: cover;
    overflow: auto;
    text-wrap: wrap;
    max-height: 50vh;
}

form .card-body {
    max-height: none;
    overflow: unset;
}

.col-6 .card-body {
    max-width: 50vw;
}

.text-bg-my,
.text-bg-other {
    color: var(--bs-white);
}

.text-bg-my .text-muted,
.text-bg-other .text-muted {
    color: var(--bs-white) !important;
}

.text-bg-my:nth-child(even) {
    background-color: rgb(var(--bs-blue-500-rgb), .8);
    background-size: cover;

    --bs-border-color: rgb(var(--bs-blue-500-rgb), .9);
}

.text-bg-my:nth-child(odd) {
    background-color: rgb(var(--bs-blue-500-rgb), .7);
    background-size: cover;

    --bs-border-color:rgb(var(--bs-blue-500-rgb), .8);
}

.text-bg-my.badge {
    background-color: rgb(var(--bs-blue-500-rgb), 1);
}

.text-bg-other:nth-child(even) {
    background-color: rgb(var(--bs-deep-purple-500-rgb), .8);
    background-size: cover;

    --bs-border-color: rgb(var(--bs-deep-purple-500-rgb), .9);
}

.text-bg-other:nth-child(odd) {
    background-color: rgb(var(--bs-deep-purple-500-rgb), .7);
    background-size: cover;

    --bs-border-color: rgb(var(--bs-deep-purple-500-rgb), .8);
}

.text-bg-other.badge {
    background-color: rgb(var(--bs-deep-purple-500-rgb), 1);
}

.text-bg-my a,
.text-bg-other a {
    color: var(--bs-yellow-300);
}

/**
 * Fleche pour les tableaux
 */
i.bi.bi-caret-right::before {
    transition: all .3s ease-in-out;
}

i.bi.bi-caret-right.rotated::before {
    transform: rotate(90deg);
}

/**
 * Schema D3
 */

.schema-d3 * {
    transition: none;
}

.schema-d3 .link {
    stroke: var(--bs-emphasis-color);
}

.schema-d3 .node {
    fill: var(--bs-secondary-color);
    cursor: pointer;
}

.schema-d3 text {
    font-size: 14px;
    fill: var(--bs-emphasis-color);
}

[data-bs-theme="light"] .schema-d3 text {
    text-shadow: 2px 2px 4px white, -2px -2px 4px white;
}

[data-bs-theme="dark"] .schema-d3 text {
    text-shadow: 2px 2px 4px black, -2px -2px 4px black;
}

/**
 * Tableau
 */

.table-scrollable {
    max-height: 75vh;
    overflow: auto;
}

.table-scrollable .table {
    width: 100%;
}

.table-scrollable th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.table-stripedfix > tbody > tr.table-line:nth-of-type(4n+1) > * {
    --bs-table-color-type: var(--bs-table-striped-color);
    --bs-table-bg-type: var(--bs-table-striped-bg);
}

.table-hover > tbody > tr.table-line {
    vertical-align: middle;
}

.table td {
    max-width: 15vw; /* Largeur fixe */
    white-space: nowrap; /* Pas de retour à la ligne */
    overflow: hidden; /* Cache le texte qui déborde */
    text-overflow: ellipsis; /* Ajoute les points de suspension */
}

/**
 * HtmX Animation
 */
#hx-body.htmx-added,
#hx-main.htmx-added,
#hx-card.htmx-added,
#hx-body.htmx-settling,
#hx-main.htmx-settling,
#hx-card.htmx-settling {
    opacity: 0;
}

.htmx-indicator {
    opacity: 0;
}

.htmx-request .htmx-indicator {
    opacity: 1;
    transition: opacity 200ms ease-in;
}

.htmx-request.htmx-indicator {
    opacity: 1;
    transition: opacity 200ms ease-in;
}

#hx-body,
#hx-main,
#hx-card {
    opacity: 1;
}

.ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 50vw;
}

/**
 * Blackscreen animation for loading
 */
.blackscreen {
    animation: blackscreen 10s ease-in-out;
    animation-fill-mode: forwards;
    background-color: transparent;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
}

@keyframes blackscreen {
    from {
        background-color: transparent;
    }

    to {
        background-color: black;
    }
}

/**
 * Permet de cacher les articles dans la page d'inventaire
 */
.inventory-one .articles {
    display: none;
}

/**
* fonts
*/
.font-bs-monospace {
    font-family: var(--bs-font-monospace);
}

.tooltip-wide {
    --bs-tooltip-max-width: 50vw;
}


