/**
 * 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;
}


/**
 * Header
 */
.plasma-header {
    fill: #424242;
}

[data-bs-theme="dark"] .plasma-header {
    fill: #BDBDBD;
}

/**
 * Media cover
 */
.mediaCover {
    height: 50vh;
    overflow: hidden;
    position: relative;
    width: 100%;
    z-index: auto;
}

.mediaCover > div {
    align-items: center;
    background-size: cover;
    background-position: center center;
    display: flex;
    height: 100%;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.mediaCover > div > img {
    height: 100%;
    object-fit: cover;
    position: absolute;
    width: 100%;
}

/* Schema */
#tree.graph .node {
    cursor: pointer;
}

.graph .node .shape {
    fill: var(--bs-primary);
}

.graph .node:hover .shape {
    fill: var(--bs-primary-bg-subtle);
}

.graph .node .label {
    text-anchor: middle;
    pointer-events: none;
    fill: var(--bs-body-color);
}

.graph .node:hover .label {
    fill: var(--bs-primary-text-emphasis);
}


/* Navigation */
.nav-link.link-body-emphasis:hover {
    color: var(--bs-primary) !important;
    background-color: var(--bs-secondary-bg);
}

/* Tom Select */
.ts-control,
.ts-wrapper.multi.has-items .ts-control {
    border: none;
    padding: 2px 8px;
}

.ts-control .item {
    font-size: 16px !important;
}

.ts-wrapper input {
    font-size: 16px !important;
}

/* Form Search */
.searchForm form {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.searchForm form .mb-3 {
    margin-bottom: 0 !important;
}

.searchForm form > div.search {
    flex: 1 1 40%;
}

.searchForm form > div {
    flex: 1 1 20%;
}

.searchForm form > div:not(:last-child) {
}

.searchForm form label {
    display: none;
}

.searchForm 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;
}

.col-6 .card-body {
    max-width: 50vw;
}

form .card-body {
    max-height: none;
    overflow: unset;
}

.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: rgba(var(--bs-blue-500-rgb), .8);
    background-size: cover;
    --bs-border-color: rgba(var(--bs-blue-500-rgb), .9);
}

.text-bg-my:nth-child(odd) {
    background-color: rgba(var(--bs-blue-500-rgb), .7);
    background-size: cover;
    --bs-border-color:rgba(var(--bs-blue-500-rgb), .8);
}

.text-bg-my.badge {
    background-color: rgba(var(--bs-blue-500-rgb), 1);
}

.text-bg-other:nth-child(even) {

    background-color: rgba(var(--bs-deep-purple-500-rgb), .8);
    background-size: cover;
    --bs-border-color: rgba(var(--bs-deep-purple-500-rgb), .9);
}

.text-bg-other:nth-child(odd) {
    background-color: rgba(var(--bs-deep-purple-500-rgb), .7);
    background-size: cover;
    --bs-border-color: rgba(var(--bs-deep-purple-500-rgb), .8);
}

.text-bg-other.badge {
    background-color: rgba(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);
}

/**
 * Tableau
 */
/* CSS */
.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
 */
#hxBody.htmx-added,
#hxMain.htmx-added,
#hxCard.htmx-added,
#hxBody.htmx-settling,
#hxMain.htmx-settling,
#hxCard.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;
}

#hxBody,
#hxMain,
#hxCard {
    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;
}

/**
 * Surcharge de Tom Select
 */
[data-bs-theme="light"] .ts-control,
[data-bs-theme="light"] .ts-control input,
[data-bs-theme="light"] .ts-dropdown {
    color: var(--bs-gray-500);
}

[data-bs-theme="dark"] .ts-control,
[data-bs-theme="dark"] .ts-control input,
[data-bs-theme="dark"] .ts-dropdown {
    color: var(--bs-gray-500);
}

/**
 * Schema D3
 */

.schemaD3 * {
    transition: none;
}

.schemaD3 .link {
    stroke: var(--bs-emphasis-color);
}

.schemaD3 .node {
    fill: var(--bs-secondary-color);
    cursor: pointer;
}

.schemaD3 text {
    font-size: 14px;
    fill: var(--bs-emphasis-color);
}

[data-bs-theme="light"] text {
    text-shadow: 2px 2px 4px white, -2px -2px 4px white;
}

[data-bs-theme="dark"] text {
    text-shadow: 2px 2px 4px black, -2px -2px 4px black;
}
