/* === SYSTÈME D'AIDE ET DOCUMENTATION === */

/* Styles pour la page de documentation */
.documentation-content {
    padding: 20px 0;
}

.help-search {
    margin-bottom: 30px;
}

.help-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.help-search input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* Catégories d'aide */
.help-categories {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.help-category {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

.help-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Header du modal fullscreen - Version compacte */
.help-fullscreen-header {
    padding: 12px 20px !important;
    background: #2c3e50;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.help-fullscreen-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.help-fullscreen-header h2 i {
    margin-right: 8px;
}

/* Couleurs standardisées pour chaque catégorie - Version fullscreen */
.help-category-fullscreen {
    display: block;
    height: auto !important;
    min-height: unset !important;
    background: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.help-category-fullscreen .help-articles-fullscreen {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: auto !important;
    min-height: 0 !important;
}

/* Layout colonnes - empilement automatique comme des modales */
#help-categories-fullscreen {
    column-count: 3 !important;
    column-gap: 15px !important;
    column-fill: balance !important;
    display: block !important;
}

/* Chaque carte comme une mini-modale qui s'empile */
.help-category-fullscreen {
    break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
    height: auto;
    margin-bottom: 15px;
    vertical-align: top;
    border: 2px solid #000000 !important;
    border-radius: 8px;
}

/* Responsive : ajustement du nombre de colonnes */
@media (max-width: 1024px) {
    #help-categories-fullscreen {
        column-count: 2 !important;
    }
}

@media (max-width: 768px) {
    #help-categories-fullscreen {
        column-count: 1 !important;
    }
}

/* Force 3 colonnes sur écrans larges */
@media (min-width: 1025px) {
    #help-categories-fullscreen {
        column-count: 3 !important;
    }
}

.help-category-fullscreen .help-category-header-fullscreen {
    border-bottom: 1px solid #dee2e6 !important;
    padding-bottom: 10px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px 15px;
    border-radius: 6px;
    margin: -15px -15px 15px -15px;
}

.help-category-fullscreen .help-category-header-fullscreen i {
    color: #2d3748 !important;
    font-size: 16px;
}

/* Titre des cartes fullscreen */
.help-category-fullscreen .help-category-header-fullscreen h3 {
    color: #1a365d !important;
    font-weight: 700;
    margin: 0;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.help-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.help-category-header i {
    font-size: 28px;
    color: #0d6efd;
    padding: 8px;
    border-radius: 10px;
    background: rgba(13, 110, 253, 0.08);
    transition: all 0.3s ease;
}

.help-category-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.help-articles {
    display: grid;
    gap: 15px;
}

.help-article {
    background: white;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    border-top: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.help-article::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--article-color, #0d6efd), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.help-article:hover {
    background: #fafbfc;
    border-left-color: var(--article-color, #0d6efd);
    transform: translateX(8px);
    box-shadow: 4px 0 12px rgba(13, 110, 253, 0.08);
}

.help-article:hover::before {
    opacity: 1;
}

.help-article h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-article h4::before {
    content: '▶';
    font-size: 10px;
    color: var(--article-color, #0d6efd);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.help-article:hover h4::before {
    opacity: 0.5;
}

.help-article p {
    margin: 0;
    color: #5a6c7d;
    font-size: 14px;
    line-height: 1.6;
}

/* Mini-fenêtres pour chaque article - Version fullscreen */
.help-article-fullscreen {
    --article-color: #0d6efd;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.help-article-fullscreen:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: var(--article-color);
}

.help-article-fullscreen:nth-child(1) {
    --article-color: #ff8787;
    border-left: 4px solid #ff8787;
}

.help-article-fullscreen:nth-child(2) {
    --article-color: #ffa94d;
    border-left: 4px solid #ffa94d;
}

.help-article-fullscreen:nth-child(3) {
    --article-color: #ffd43b;
    border-left: 4px solid #ffd43b;
}

.help-article-fullscreen:nth-child(4) {
    --article-color: #51cf66;
    border-left: 4px solid #51cf66;
}

.help-article-fullscreen:nth-child(5) {
    --article-color: #4dabf7;
    border-left: 4px solid #4dabf7;
}

.help-article-fullscreen:nth-child(6) {
    --article-color: #845ef7;
    border-left: 4px solid #845ef7;
}

.help-article-fullscreen h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-article-fullscreen p {
    margin: 0;
    color: #5a6c7d;
    font-size: 14px;
    line-height: 1.5;
}

/* Icône d'aide contextuelle */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #0d6efd;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.help-icon:hover {
    background: #0b5ed7;
    transform: scale(1.1);
}

.help-icon:active {
    transform: scale(0.95);
}

/* Styles pour les modales d'aide */
.help-modal-content {
    line-height: 1.6;
}

.help-modal-content h4 {
    color: #2c3e50;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
}

.help-modal-content h4:first-child {
    margin-top: 0;
}

.help-modal-content p {
    color: #495057;
    margin-bottom: 15px;
}

.help-modal-content ul {
    color: #495057;
    margin-bottom: 15px;
    padding-left: 20px;
}

.help-modal-content li {
    margin-bottom: 8px;
}

.help-modal-content .help-step {
    background: #f8f9fa;
    border-left: 4px solid #0d6efd;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
}

.help-modal-content .help-tip {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.help-modal-content .help-tip::before {
    content: "💡 ";
    font-size: 16px;
}

.help-modal-content .help-warning {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.help-modal-content .help-warning::before {
    content: "⚠️ ";
    font-size: 16px;
}

/* Styles pour les articles détaillés */
.help-article-content {
    line-height: 1.7;
}

.help-article-content h1 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: 700;
}

.help-article-content h2 {
    color: #2c3e50;
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.help-article-content h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-top: 25px;
    margin-bottom: 12px;
    font-weight: 600;
}

.help-article-content p {
    color: #495057;
    margin-bottom: 16px;
    font-size: 16px;
}

.help-article-content ul, .help-article-content ol {
    color: #495057;
    margin-bottom: 16px;
    padding-left: 25px;
}

.help-article-content li {
    margin-bottom: 8px;
}

.help-article-content code {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #e83e8c;
}

.help-article-content pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    overflow-x: auto;
    margin: 15px 0;
}

.help-article-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: #495057;
}

/* Navigation dans les articles */
.help-article-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.help-article-nav button {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.help-article-nav button:hover {
    background: #0b5ed7;
}

.help-article-nav button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Responsive design */
@media (max-width: 768px) {
    .help-categories {
        gap: 20px;
    }
    
    .help-category {
        padding: 15px;
    }
    
    .help-article {
        padding: 15px;
    }
    
    .help-article-content h1 {
        font-size: 24px;
    }
    
    .help-article-content h2 {
        font-size: 20px;
    }
    
    .help-article-content h3 {
        font-size: 16px;
    }
    
    .help-article-content p {
        font-size: 14px;
    }
}

/* Animation pour les icônes d'aide */
@keyframes helpPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.help-icon.help-pulse {
    animation: helpPulse 2s infinite;
}

/* Styles pour les tooltips d'aide */
.help-tooltip {
    position: relative;
    display: inline-block;
}

.help-tooltip .help-tooltip-content {
    visibility: hidden;
    width: 300px;
    background-color: #2c3e50;
    color: white;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.help-tooltip .help-tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2c3e50 transparent transparent transparent;
}

.help-tooltip:hover .help-tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Styles pour les sections d'aide dans les formulaires */
.help-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.help-section h4 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.help-section p {
    color: #6c757d;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Styles pour les boutons d'aide */
.help-button {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.help-button:hover {
    background: #0b5ed7;
}

.help-button i {
    font-size: 12px;
}

/* Badge de compteur de vues */
.article-views-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6c757d;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: normal;
    margin-left: 8px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.help-article-fullscreen:hover .article-views-badge {
    background: #e3f2fd;
    color: #1976d2;
    opacity: 1;
}
