/* Styles personnalisé */
body,
h1,
h2,
h3,
h4 {
    font-weight: 300;
}

body {
    overflow: auto;
}

#bg-fixed {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url("../images/pau-place-royale-OsRoj1a.jpg");
    background-size: cover;
    background-position: center top;
    filter: grayscale(100%);
    opacity: 0.5;
}

#wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */

.header-connexion {
    height: 67px;
    background-color: var(--pau-blue);
}

.header-connexion #logo-header {
    height: 60%;
    width: auto;
}

/* Main centré verticalement */
#wrapper main {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card formulaire */
.content-login {
    border-radius: 4px;
    opacity: 0.95;
}

.content-login.card .btn {
    background-color: var(--pau-blue);
    border-color: var(--pau-blue);
}

h1 {
    color: var(--pau-blue);
}

/* Toggle password */
.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--pau-blue);
    line-height: 1;
}

.btn-toggle-password:focus {
    outline: none;
    box-shadow: none;
}

/* GLOBAL LAYOUT */
#admin-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 240px;
    background: white;
    /* color: #1f2d3d; */
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    transition: width 0.3s;
}

/* TOP LOGO */
.sidebar-top {
    height: 60px;
    min-height: 60px;
    flex-shrink: 0;
    background: #2f55d4;
}

.logo-full {
    height: 40px;
}

.logo-mini {
    display: none;
    height: 30px;
}

/* MENU */
.sidebar-menu {
    flex-grow: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.sidebar-menu ul {
    padding: 10px 0 10px;
}

.sidebar-menu ul .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    color: #1f2d3d;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-menu ul .menu-item:hover {
    background: #f1f1f1;
}

.menu-item i {
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
}

/* MAIN */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh
}

/* HEADER */
.admin-header {
    height: 60px;
    min-height: 60px;
    background: #2f55d4;
    width: 100%;
    z-index: 1020;
}

/* CONTENT */
.content {
    flex-grow: 1;
    background: #f4f6f9;
    overflow-y: auto;
    position: relative;
    /* scroll-padding-top: 60px; */
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

/* COLLAPSED MODE */
#admin-layout.collapsed .sidebar {
    width: 70px;
}

#admin-layout.collapsed .menu-item span {
    display: none;
}

#admin-layout.collapsed .logo-full {
    display: none;
}

#admin-layout.collapsed .logo-mini {
    display: block;
}

/* Align icons center when collapsed */
#admin-layout.collapsed .menu-item {
    justify-content: center;
}

/* FOOTER */
footer {
    margin-top: auto;
    background: white;
    border-top: 1px solid #dee2e6;
    font-size: 0.9rem;
    color: #888;
}

/* DATATABLE */

/* Cache le tableau tant qu'il n'est pas initialisé par Stimulus */
[data-controller="datatables"]:not(.dt-installed) {
    opacity: 0.3;
    pointer-events: none;
}

/* Optionnel : Ajouter un spinner au-dessus du tableau */
.table-loading-container {
    position: relative;
}

.table-loading-container .spinner-border {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 10;
    display: none;
}

.table-loading-container:not(.loaded) .spinner-border {
    display: block;
}

/* Table liste utilisateur */
#table-profiles tbody tr {
    transition: all 0.5s ease;
}

/* L'état d'animation déclenché par Stimulus */
tr.fade-out {
    opacity: 0;
    transform: translateX(30px);
    /* Léger décalage vers la droite */
    background-color: #f8d7da !important;
    /* Rouge clair (Bootstrap danger-subtle) */
    pointer-events: none;
    /* Empêche d'autres clics pendant l'animation */
}

/* Optionnel : Lisser la réduction de hauteur on ne rafraîchi pas tout le tableau */
tr.fade-out td {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    transition: all 0.5s ease;
}

/* Icones */
.bi.bi-info-circle {
    cursor: help;
}

/* Documentation Styles */
.doc-container {
    max-width: 90%;
    margin: 0 auto;
}

.doc-card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 2rem;
    background: #fff;
}

.doc-card .card-header {
    background-color: #fff;
    border-bottom: 1px solid #edf2f7;
    padding: 1.25rem;
}

.doc-card .card-header h3 {
    margin-bottom: 0;
    font-size: 1.25rem;
    color: var(--pau-blue);
    font-weight: 600;
}

.doc-section-title {
    color: var(--pau-blue);
    border-left: 4px solid var(--pau-light-blue);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

/* Badge pour les méthodes HTTP */
.badge-method {
    font-family: monospace;
    padding: 0.4em 0.6em;
    border-radius: 4px;
}

.bg-post {
    background-color: #49cc90;
    color: white;
}

.bg-get {
    background-color: #61affe;
    color: white;
}

/* Blocs de Code */
pre {
    background: #282c34;
    color: #abb2bf;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.9rem;
    border: 1px solid #181a1f;
}

code {
    color: #e06c75;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

/* Sommaire interne (Sticky) */
.doc-nav {
    position: sticky;
    top: 20px;
}

.doc-nav .nav-link {
    color: #6c757d;
    border-left: 2px solid #dee2e6;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.doc-nav .nav-link:hover,
.doc-nav .nav-link.active {
    color: var(--pau-blue);
    border-left: 2px solid var(--pau-blue);
    background: rgba(19, 66, 132, 0.1);
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

/* Dual list-box : amélioration visuelle des listes de transfert */
.dual-listbox-container select option {
    padding: 8px 12px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
}

.dual-listbox-container select option:hover {
    background-color: #e9ecef;
}

.dual-listbox-container select:focus option:checked {
    background: #0dcaf0 linear-gradient(0deg, #0dcaf0 0%, #0dcaf0 100%);
}

/* inline edit field */
.editable-cell {
    cursor: text;
    position: relative;
}

.editable-cell:hover {
    background-color: #0dcaf0;
}

.fade-out {
    transition: background-color 0.4s ease;
}