/* VigiCrécy Glossaire - Frontend CSS */

/* Navigation alphabétique */
.vcg-letter-nav {
    margin: 30px 0;
    padding: 20px;
    background: #f5f5f5; /* Sera overridé par le CSS dynamique */
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
}

.vcg-letter-nav a {
    display: inline-block;
    padding: 8px 11px; /* Légèrement réduit de 12px à 11px */
    margin: 3px 2px; /* Marge horizontale légèrement réduite */
    color: #0073aa; /* Sera overridé */
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.vcg-letter-nav a:hover {
    background: #0073aa; /* Sera overridé */
    color: #fff; /* Sera overridé */
}

.vcg-letter-nav span.disabled {
    display: inline-block;
    padding: 8px 11px; /* Légèrement réduit de 12px à 11px */
    margin: 3px 2px; /* Marge horizontale légèrement réduite */
    color: #ccc;
}

/* Sections par lettre */
.vcg-letter-section {
    margin: 40px 0;
    scroll-margin-top: 100px; /* Pour le scroll vers les ancres */
}

.vcg-letter-title {
    font-size: 32px;
    font-weight: bold;
    color: #333; /* Sera overridé */
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #0073aa; /* Sera overridé */
}

/* Entrée de terme */
.vcg-terme-entry {
    margin: 25px 0 25px 20px;
    padding: 15px;
    background: #fff;
    border-left: 4px solid #0073aa; /* Sera overridé */
}

.vcg-terme-title {
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #333;
}

.vcg-abbreviation {
    font-weight: normal;
    color: #666;
    font-size: 0.9em;
}

.vcg-terme-content {
    line-height: 1.8;
    color: #555;
}

.vcg-terme-content p:last-child {
    margin-bottom: 0;
}

.vcg-source {
    margin-top: 10px;
    font-size: 0.85em;
    color: #888;
}

.vcg-back-to-top {
    text-align: right;
    margin: 15px 0;
}

.vcg-back-to-top a {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
}

.vcg-back-to-top a:hover {
    text-decoration: underline;
}

/* Termes détectés automatiquement */
.vcg-term {
    position: relative;
    border-bottom: 2px dotted #0073aa;
    cursor: help;
    color: #0073aa;
}

.vcg-term-link {
    border-bottom: 1px dotted #0073aa;
    text-decoration: none;
}

/* Tooltip */
.vcg-tooltip {
    position: absolute !important;
    background: #ffffff !important;
    color: #333333 !important;
    padding: 16px 18px !important;
    border: 2px solid #0073aa !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    line-height: 1.8 !important;
    max-width: 600px !important;
    max-height: none !important; /* CHANGÉ : pas de limite ! */
    min-width: 250px !important;
    min-height: 100px !important; /* Augmenté de 80 à 100px */
    height: auto !important;
    width: auto !important;
    z-index: 50 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 115, 170, 0.1) !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: auto !important; /* CHANGÉ : permettre interaction avec scrollbar */
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    text-align: left !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    box-sizing: border-box !important;
    /* overflow géré par JavaScript selon option */
}
}

/* Quand visible, garder les pointer-events */
.vcg-tooltip[style*="opacity: 1"] {
    pointer-events: auto !important;
}

/* IMPORTANT: Forcer l'affichage du contenu complet */
.vcg-tooltip * {
    white-space: normal !important;
    word-wrap: break-word !important;
}

/* Scrollbar stylée pour le tooltip */
.vcg-tooltip::-webkit-scrollbar {
    width: 8px;
}

.vcg-tooltip::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.vcg-tooltip::-webkit-scrollbar-thumb {
    background: rgba(0, 115, 170, 0.5);
    border-radius: 4px;
}

.vcg-tooltip::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 115, 170, 0.8);
}

/* Ajustement pour mobile */
@media (max-width: 768px) {
    .vcg-tooltip {
        max-width: calc(100vw - 40px) !important;
        min-width: 200px;
        font-size: 13px;
    }
}

/* Variante avec fond sombre (si activée via options) */
.vcg-tooltip.dark-mode {
    background: #2c3e50;
    color: #ffffff;
    border-color: #3498db;
}


.vcg-tooltip::before {
    content: '';
    position: absolute;
    border: 6px solid transparent;
}

/* Position top */
.vcg-tooltip.top {
    /* Position calculée dynamiquement par JavaScript */
}

.vcg-tooltip.top::before {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #333;
}

/* Position bottom */
.vcg-tooltip.bottom {
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    margin-top: 8px;
}

.vcg-tooltip.bottom::before {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: #333;
}

/* Position left */
.vcg-tooltip.left {
    right: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-8px);
    margin-right: 8px;
}

.vcg-tooltip.left::before {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: #333;
}

/* Position right */
.vcg-tooltip.right {
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    margin-left: 8px;
}

.vcg-tooltip.right::before {
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .vcg-letter-nav {
        font-size: 14px;
    }
    
    .vcg-letter-nav a,
    .vcg-letter-nav span.disabled {
        padding: 6px 8px;
        margin: 2px;
    }
    
    .vcg-letter-title {
        font-size: 24px;
    }
    
    .vcg-tooltip {
        max-width: 250px;
        font-size: 13px;
    }
}
