/**
 * Styles pour les icônes d'aide avec tooltips
 * Support des thèmes clair et sombre avec contrastes WCAG AA
 */

/* Styles de base pour les icônes d'aide */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.375rem;
    vertical-align: middle;
    transition: color 0.2s ease, opacity 0.2s ease;
    opacity: 0.7;
}

.help-icon:hover,
.help-icon:focus {
    opacity: 1;
    outline: none;
}

.help-icon:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 50%;
}

/* Tailles d'icônes */
.help-icon-xs {
    font-size: 0.75rem;
    width: 0.875rem;
    height: 0.875rem;
}

.help-icon-sm {
    font-size: 0.875rem;
    width: 1rem;
    height: 1rem;
}

.help-icon-md {
    font-size: 1rem;
    width: 1.125rem;
    height: 1.125rem;
}

.help-icon-lg {
    font-size: 1.125rem;
    width: 1.25rem;
    height: 1.25rem;
}

/* Couleurs pour thème clair (par défaut) */
.help-icon {
    color: #6b7280; /* Gris foncé - contraste 4.5:1 sur blanc */
}

.help-icon:hover,
.help-icon:focus {
    color: #4b5563; /* Gris plus foncé au survol */
}

/* Couleurs pour thème sombre */
[data-theme="dark"] .help-icon,
body[data-theme="dark"] .help-icon,
.theme-dark .help-icon {
    color: #9ca3af; /* Gris clair - contraste 4.5:1 sur fond sombre */
}

[data-theme="dark"] .help-icon:hover,
[data-theme="dark"] .help-icon:focus,
body[data-theme="dark"] .help-icon:hover,
body[data-theme="dark"] .help-icon:focus,
.theme-dark .help-icon:hover,
.theme-dark .help-icon:focus {
    color: #d1d5db; /* Gris plus clair au survol */
}

/* Support pour les thèmes via classes body */
body.theme-dark .help-icon {
    color: #9ca3af;
}

body.theme-dark .help-icon:hover,
body.theme-dark .help-icon:focus {
    color: #d1d5db;
}

/* Styles pour les tooltips Bootstrap - amélioration du contraste */
.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
    border-top-color: var(--tooltip-bg, #212529);
}

.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
    border-bottom-color: var(--tooltip-bg, #212529);
}

.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
    border-left-color: var(--tooltip-bg, #212529);
}

.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
    border-right-color: var(--tooltip-bg, #212529);
}

/* Styles pour les tooltips sur thème sombre */
[data-theme="dark"] .tooltip .tooltip-inner,
body[data-theme="dark"] .tooltip .tooltip-inner,
.theme-dark .tooltip .tooltip-inner,
body.theme-dark .tooltip .tooltip-inner {
    background-color: #1e293b !important; /* Fond sombre pour le thème dark */
    color: #f1f5f9 !important; /* Texte clair pour contraste 4.5:1 */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tooltip .tooltip-arrow::before,
body[data-theme="dark"] .tooltip .tooltip-arrow::before,
.theme-dark .tooltip .tooltip-arrow::before,
body.theme-dark .tooltip .tooltip-arrow::before {
    border-color: #1e293b !important;
}

/* Styles pour les tooltips sur thème clair (par défaut) */
.tooltip .tooltip-inner {
    background-color: #212529 !important; /* Fond sombre par défaut Bootstrap */
    color: #ffffff !important; /* Texte blanc pour contraste */
}

/* Responsive - taille réduite sur mobile */
@media (max-width: 576px) {
    .help-icon-sm {
        font-size: 0.75rem;
        width: 0.875rem;
        height: 0.875rem;
    }

    .help-icon-md {
        font-size: 0.875rem;
        width: 1rem;
        height: 1rem;
    }

    .help-icon-lg {
        font-size: 1rem;
        width: 1.125rem;
        height: 1.125rem;
    }
}

/* Amélioration de l'accessibilité - indicateur visuel au focus clavier */
.help-icon:focus-visible {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

