﻿:root {
    --btn-violet: #6f42c1;
    --btn-blue: #0b5ed7;
    --app-accent: #ff9854;
    --app-background-gradient-light: radial-gradient(circle at 90% 92%, rgba(255, 152, 84, 0.28) 0%, rgba(255, 152, 84, 0) 72%);
    --app-background-gradient-dark: radial-gradient(circle at 90% 92%, rgba(255, 152, 84, 0.24) 0%, rgba(255, 152, 84, 0) 68%);
    --app-background-image-position: right 0rem bottom 0rem;
    --app-sidebar-current-category-border: rgba(33, 37, 41, 0.2);
    --sidebar-tool-button-size: 2.75rem;
    --sidebar-tool-gap: 0.5rem;
}

.btn-blue {
    background-color: var(--btn-blue);
    border-color: rgba(0, 0, 0, 0.08);
    color: white;
}

.btn-violet {
    background-color: var(--btn-blue);
    border-color: rgba(0, 0, 0, 0.08);
    color: white;
}

.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link {
    width: auto;
}

[data-bs-theme="dark"] {
    --app-sidebar-current-category-border: rgba(248, 249, 250, 0.25);
}

[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-color: var(--bs-primary-text-emphasis);
    --bs-btn-border-color: var(--bs-primary-text-emphasis);
    --bs-btn-hover-color: var(--bs-black);
    --bs-btn-hover-bg: var(--bs-primary-text-emphasis);
    --bs-btn-hover-border-color: var(--bs-primary-text-emphasis);
    --bs-btn-active-color: var(--bs-black);
    --bs-btn-active-bg: var(--bs-primary-text-emphasis);
    --bs-btn-active-border-color: var(--bs-primary-text-emphasis);
    --bs-btn-disabled-color: var(--bs-primary-border-subtle);
    --bs-btn-disabled-border-color: var(--bs-primary-border-subtle);
    --bs-btn-focus-shadow-rgb: 110, 168, 254;
}

[data-bs-theme="light"] body {
    background-image: var(--app-background-gradient-light), radial-gradient(circle at 90% 92%, rgba(35, 45, 60, 0.2) 0%, rgba(35, 45, 60, 0) 58%), url('/images/bg.svg');
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position: var(--app-background-image-position), var(--app-background-image-position), var(--app-background-image-position);
    background-size: 120rem auto, 108rem auto, min(84vw, 64rem) auto;
    background-attachment: fixed, fixed, fixed;
}

[data-bs-theme="dark"] body {
    background-image: var(--app-background-gradient-dark), url('/images/bg.svg');
    background-repeat: no-repeat, no-repeat;
    background-position: var(--app-background-image-position), var(--app-background-image-position);
    background-size: 112rem auto, min(84vw, 64rem) auto;
    background-attachment: fixed, fixed;
    background-blend-mode: screen;
}

@media (max-width: 992px) {
    .app-sidebar,
    .app-sidebar .sidebar-wrapper {
        background-color: var(--bs-light);
    }

    [data-bs-theme="dark"] .app-sidebar,
    [data-bs-theme="dark"] .app-sidebar .sidebar-wrapper {
        background-color: var(--bs-dark);
    }
}

.small {
    font-size: 0.75em;
}

.text-azure {
    color: #4d8aff;
}

.bg-azure {
    background-color: #4d8aff;
}

.sidebar-footer-info {
    min-height: 5px;
    padding: 5px;
}

.sidebar-wrapper .nav-treeview > .nav-item > .nav-link.active {
    background-color: var(--app-accent) !important;
    color: #000 !important;
}

.sidebar-wrapper .sidebar-menu > .nav-item.menu-open {
    border: 1px solid var(--app-sidebar-current-category-border);
    border-radius: 0.5rem;
}

    .sidebar-wrapper .nav-treeview > .nav-item > .nav-link:hover,
    .sidebar-wrapper .sidebar-menu > .nav-item.menu-open > .nav-link,
    .sidebar-wrapper .sidebar-menu > .nav-item.menu-open .nav-treeview > .nav-item > .nav-link.active {
        border-radius: 0 !important;
    }

::selection {
    background-color: var(--app-accent);
}

::-moz-selection {
    background-color: var(--app-accent);
}

/* Par dÃ©faut : afficher le grand logo (expanded) et cacher le petit (collapsed) */
.sidebar-wrapper .sidebar-logo .app-logo.app-logo-expanded {
    display: inline-flex !important;
}

.sidebar-wrapper .sidebar-logo .app-logo.app-logo-collapsed {
    display: none !important;
}

/* Quand la sidebar est rÃ©duite (body.sidebar-collapse) : inverser l'affichage */
body.sidebar-collapse .sidebar-wrapper .sidebar-logo .app-logo.app-logo-expanded {
    display: none !important;
}

body.sidebar-collapse .sidebar-wrapper .sidebar-logo .app-logo.app-logo-collapsed {
    display: inline-flex !important;
}

/* Par dÃ©faut, masquer toutes les images de logo pour Ã©viter les doublons */
.sidebar-wrapper .sidebar-logo img.theme-logo-light,
.sidebar-wrapper .sidebar-logo img.theme-logo-dark {
    display: none !important;
}

/* Afficher uniquement la variante adaptÃ©e au thÃ¨me (sur les images) */
[data-bs-theme="dark"] .sidebar-wrapper .sidebar-logo img.theme-logo-dark {
    display: inline-block !important;
}

[data-bs-theme="dark"] .sidebar-wrapper .sidebar-logo img.theme-logo-light {
    display: none !important;
}

[data-bs-theme="light"] .sidebar-wrapper .sidebar-logo img.theme-logo-light {
    display: inline-block !important;
}

[data-bs-theme="light"] .sidebar-wrapper .sidebar-logo img.theme-logo-dark {
    display: none !important;
}

/* Tailles fixes pour les SVG des logos */
.sidebar-wrapper .sidebar-logo img.app-logo-image-large {
    height: 120px !important;
    width: auto !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

.sidebar-wrapper .sidebar-logo img.app-logo-image-small {
    height: 53px !important;
    width: auto !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* SÃ©curitÃ© : s'assurer que dans le container expanded on cache les petites images et inversement */
.sidebar-wrapper .sidebar-logo .app-logo.app-logo-expanded img.app-logo-image-small {
    display: none !important;
}

.sidebar-wrapper .sidebar-logo .app-logo.app-logo-collapsed img.app-logo-image-large {
    display: none !important;
}

/* Centrer les logos horizontalement et verticalement dans leur conteneur */
.sidebar-wrapper .sidebar-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.4rem 0 !important;
}

    /* Le lien englobe et centre l'image (meilleur comportement en sidebar rÃ©duite) */
    .sidebar-wrapper .sidebar-logo .sidebar-logo-link {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100%;
        padding: 0 !important;
    }

    /* Assurer que les images sont des blocs centrÃ©s et ne provoquent pas de dÃ©calage */
    .sidebar-wrapper .sidebar-logo img {
        display: block !important;
        margin: 0 auto !important;
        line-height: 1 !important;
    }

/* Forcer le layout de la sidebar pour garantir que les Ã©lÃ©ments avec margin-top:auto
   (ex: .theme-bottom-centered) restent collÃ©s en bas du panneau */
.app-sidebar .sidebar-wrapper {
    display: flex !important;
    flex-direction: column !important;
}

    .app-sidebar .sidebar-wrapper > .sidebar-tools {
        margin-top: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--sidebar-tool-gap);
        width: 100%;
        padding: 0 0.5rem 1rem;
        flex-shrink: 0;
        overflow: visible;
    }

        .app-sidebar .sidebar-wrapper > .sidebar-tools > theme-manager-island {
            display: block;
            width: var(--sidebar-tool-button-size) !important;
            min-width: var(--sidebar-tool-button-size);
            --theme-manager-padding: 0;
            margin: 0;
            flex-shrink: 0;
            overflow: visible;
        }

        .app-sidebar .sidebar-wrapper > .sidebar-tools > wikit-island {
            display: flex;
            align-items: center;
            justify-content: center;
            padding-bottom: 0.5rem;
            flex-shrink: 0;
        }

    .app-sidebar .sidebar-wrapper .sidebar-footer-info {
        margin-top: 0;
        flex-shrink: 0;
    }

/* Firefox: Ã©vite un micro overflow vertical dans le layout fixed (scrollbar de quelques px) */
.layout-fixed .app-main {
    min-height: 0;
}

/* En sidebar rÃ©duite, masquer les infos de footer */
body.sidebar-collapse .app-sidebar .sidebar-wrapper .sidebar-footer-info {
    display: none;
}

body.sidebar-collapse .app-sidebar .sidebar-wrapper > .sidebar-tools {
    flex-direction: column;
    align-items: center;
}

    body.sidebar-collapse .app-sidebar .sidebar-wrapper > .sidebar-tools > theme-manager-island {
        width: var(--sidebar-tool-button-size) !important;
        min-width: 0;
    }

    body.sidebar-collapse .app-sidebar .sidebar-wrapper > .sidebar-tools > wikit-island {
        padding-bottom: 0;
    }

/* En mode mini + hover d'ouverture, restaurer le layout "sidebar ouverte" pour les boutons */
body.sidebar-mini.sidebar-collapse:not(.sidebar-without-hover) .app-sidebar:hover .sidebar-wrapper > .sidebar-tools {
    flex-direction: row;
    align-items: center;
}

    body.sidebar-mini.sidebar-collapse:not(.sidebar-without-hover) .app-sidebar:hover .sidebar-wrapper > .sidebar-tools > theme-manager-island {
        width: calc(var(--sidebar-tool-button-size) * 2 + var(--sidebar-tool-gap)) !important;
        min-width: calc(var(--sidebar-tool-button-size) * 2 + var(--sidebar-tool-gap));
    }

    body.sidebar-mini.sidebar-collapse:not(.sidebar-without-hover) .app-sidebar:hover .sidebar-wrapper > .sidebar-tools > wikit-island {
        padding-bottom: 0;
    }

    body.sidebar-mini.sidebar-collapse:not(.sidebar-without-hover) .app-sidebar:hover .sidebar-wrapper > .sidebar-tools theme-manager-island .theme-switch {
        width: auto;
    }

body:not(.sidebar-collapse) .app-sidebar .sidebar-wrapper > .sidebar-tools {
    flex-direction: row;
    align-items: center;
}

    body:not(.sidebar-collapse) .app-sidebar .sidebar-wrapper > .sidebar-tools > theme-manager-island {
        width: calc(var(--sidebar-tool-button-size) * 2 + var(--sidebar-tool-gap)) !important;
        min-width: calc(var(--sidebar-tool-button-size) * 2 + var(--sidebar-tool-gap));
    }

    body:not(.sidebar-collapse) .app-sidebar .sidebar-wrapper > .sidebar-tools > wikit-island {
        padding-bottom: 0;
    }

/* Neutraliser le padding interne du ThemeManager dans cette zone,
   sinon la largeur utile devient trop faible et les 2 boutons passent en colonne. */
.app-sidebar .sidebar-wrapper > .sidebar-tools theme-manager-island .theme-bottom-centered {
    width: auto;
    margin-top: 0;
    padding: 0;
}

.app-sidebar .sidebar-wrapper > .sidebar-tools theme-manager-island .theme-switch {
    width: auto !important;
    max-width: none !important;
    --theme-button-size: var(--sidebar-tool-button-size);
    --theme-switch-gap: var(--sidebar-tool-gap);
}

body.sidebar-collapse .app-sidebar .sidebar-wrapper > .sidebar-tools theme-manager-island .theme-switch {
    width: var(--sidebar-tool-button-size) !important;
    max-width: var(--sidebar-tool-button-size) !important;
    grid-template-columns: var(--sidebar-tool-button-size) !important;
}

body:not(.sidebar-collapse) .app-sidebar .sidebar-wrapper > .sidebar-tools theme-manager-island .theme-switch,
body.sidebar-mini.sidebar-collapse:not(.sidebar-without-hover) .app-sidebar:hover .sidebar-wrapper > .sidebar-tools theme-manager-island .theme-switch {
    width: calc(var(--sidebar-tool-button-size) * 2 + var(--sidebar-tool-gap)) !important;
    max-width: calc(var(--sidebar-tool-button-size) * 2 + var(--sidebar-tool-gap)) !important;
    grid-template-columns: repeat(2, var(--sidebar-tool-button-size)) !important;
}

.app-sidebar .sidebar-wrapper > .sidebar-tools theme-manager-island .theme-switch .btn {
    margin-top: 0 !important;
}

.app-sidebar .sidebar-wrapper > .sidebar-tools wikit-island .wikit-btn {
    width: var(--sidebar-tool-button-size);
    height: var(--sidebar-tool-button-size);
}

/* En mode mini + hover d'ouverture, rÃ©afficher le footer d'infos */
body.sidebar-mini.sidebar-collapse:not(.sidebar-without-hover) .app-sidebar:hover .sidebar-wrapper .sidebar-footer-info {
    display: block;
}

.sce-btn.wikit-trigger-hidden {
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

.cursor-pointer {
    cursor: pointer !important;
}

.app-header .it-toolbar-btn {
    --bs-btn-color: var(--bs-body-color);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-color: var(--bs-emphasis-color);
    --bs-btn-hover-bg: var(--bs-tertiary-bg);
    --bs-btn-hover-border-color: var(--bs-secondary-color);
    --bs-btn-active-color: var(--bs-emphasis-color);
    --bs-btn-active-bg: var(--bs-tertiary-bg);
    --bs-btn-active-border-color: var(--bs-secondary-color);
    min-width: 2rem;
}

.app-header .it-toolbar-search .input-group-text {
    color: var(--bs-secondary-color);
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

.app-header .it-toolbar-search .form-control {
    border-color: var(--bs-border-color);
}

.app-header .dropdown-menu {
    --bs-dropdown-bg: var(--bs-body-bg);
    --bs-dropdown-color: var(--bs-body-color);
    --bs-dropdown-border-color: var(--bs-border-color);
    --bs-dropdown-link-color: var(--bs-body-color);
    --bs-dropdown-link-hover-bg: var(--bs-tertiary-bg);
    --bs-dropdown-link-active-bg: var(--bs-primary);
}

input.main-header-filter-raspberry:valid {
    color: var(--bs-white);
    background: linear-gradient(to right, var(--bs-purple) 80%, transparent 100%);
}

input.main-header-filter-orange-brown:valid {
    color: var(--bs-white);
    background: linear-gradient(to right, var(--bs-orange) 80%, transparent 100%);
}

input.main-header-filter-gray:valid {
    color: var(--bs-white);
    background: linear-gradient(to right, var(--bs-secondary) 80%, transparent 100%);
}

.app-header .it-toolbar-toggle {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

    .app-header .it-toolbar-toggle.active,
    .app-header .it-toolbar-toggle[aria-pressed="true"] {
        color: var(--bs-white) !important;
        background-color: var(--bs-primary) !important;
        border-color: var(--bs-primary) !important;
        box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--bs-primary) 30%, transparent);
    }

        .app-header .it-toolbar-toggle.active i,
        .app-header .it-toolbar-toggle[aria-pressed="true"] i {
            color: var(--bs-white) !important;
        }

    .app-header .it-toolbar-toggle:not(.active):not([aria-pressed="true"]) i {
        opacity: 0.9;
    }

a.download-link-icon,
a.download-link-icon:hover,
a.download-link-icon:focus,
a.download-link-icon:active,
a.download-link-icon:visited {
    color: var(--bs-emphasis-color) !important;
    text-decoration: none !important;
}

    a.download-link-icon p,
    a.download-link-icon .app-name,
    a.download-link-icon .badge {
        text-decoration: none !important;
    }

.platform-icon {
    color: var(--bs-emphasis-color) !important;
}

#itrCaptchaRefreshButton {
    text-decoration: none !important;
}

#itrCaptchaRefreshButton::after {
        content: " *";
        color: red;
        text-decoration: none !important;
    }

.security-policy-editor-root {
    white-space: normal;
}

.toolbar-slider {
    width: 250px;
}

.toolbar-range {
    width: 250px;
    margin-bottom: .2rem;
    accent-color: var(--bs-primary);
    appearance: auto;
    -webkit-appearance: auto;
}

.toolbar-range.auth-range-safe {
    accent-color: var(--bs-success);
}

.toolbar-range.auth-range-medium {
    accent-color: var(--bs-warning);
}

.toolbar-range.auth-range-elevated {
    accent-color: var(--bs-orange);
}

.toolbar-range.auth-range-critical {
    accent-color: var(--bs-danger);
}

.auth-slider-value {
    min-width: 60px;
    color: var(--bs-secondary-color);
}
