/*============================================================+
// File name   : doc.css
// Description : Styles spécifiques pour la documentation
// Author      : Raoul Mengis
// Version     : 2026.02.07
//============================================================+*/

/* Container principal */
.doc-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header de la doc */
.doc-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px var(--shadow-color);
    position: relative;
}

.doc-header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.doc-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 25px;
}

.doc-icon-large {
    font-size: 3rem;
    color: var(--accent-color);
}

/* Boutons d'action */
.doc-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 25px;
}

.btn-print {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.btn-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.5);
}

.btn-back-top {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-back-top:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
}

/* Sommaire */
.sommaire-section {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px var(--shadow-color);
    padding: 35px;
    margin-bottom: 40px;
    position: relative;
}

.sommaire-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
    border-radius: 20px 20px 0 0;
}

.sommaire-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sommaire-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.sommaire-list li {
    position: relative;
}

.sommaire-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sommaire-list a:hover {
    background: var(--accent-color);
    color: white;
    transform: translateX(8px);
    border-color: var(--accent-color);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.3);
}

.sommaire-list a i {
    color: var(--accent-color);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.sommaire-list a:hover i {
    color: white;
}

.sommaire-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sommaire-list a:hover .sommaire-number {
    background: white;
    color: var(--accent-color);
}

/* Sections de contenu */
.doc-section {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px var(--shadow-color);
    padding: 40px;
    margin-bottom: 40px;
    scroll-margin-top: 100px;
    position: relative;
}

.doc-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-color), var(--accent-hover));
    border-radius: 20px 0 0 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
}

.section-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.section-number {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-top:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.doc-content {
    color: var(--text-secondary);
    line-height: 1.9;
    font-size: 1.05rem;
}

.doc-content h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-top: 30px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-content h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 2px;
}

.doc-content p {
    margin-bottom: 20px;
}

.doc-content ul, .doc-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.doc-content li {
    margin-bottom: 12px;
    position: relative;
}

.doc-content ul li::marker {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.doc-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.doc-content code {
    background: var(--bg-secondary);
    padding: 3px 8px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent-color);
}

.doc-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-muted);
}

.doc-content .note {
    background: rgba(52, 152, 219, 0.1);
    border-left: 4px solid var(--accent-color);
    padding: 20px;
    border-radius: 0 10px 10px 0;
    margin: 25px 0;
}

.doc-content .note-title {
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-content .warning {
    background: rgba(243, 156, 18, 0.1);
    border-left: 4px solid #f39c12;
    padding: 20px;
    border-radius: 0 10px 10px 0;
    margin: 25px 0;
}

.doc-content .warning-title {
    font-weight: 600;
    color: #f39c12;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Table des matières fixe */
.toc-fixed {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 250px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px var(--shadow-color);
    z-index: 100;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.toc-fixed h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.toc-fixed ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-fixed li {
    margin-bottom: 8px;
}

.toc-fixed a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    transition: all 0.3s ease;
}

.toc-fixed a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.toc-fixed a.active {
    color: var(--accent-color);
    font-weight: 600;
}

/* Animations */
.doc-section {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.doc-section:nth-child(1) { animation-delay: 0.1s; }
.doc-section:nth-child(2) { animation-delay: 0.2s; }
.doc-section:nth-child(3) { animation-delay: 0.3s; }
.doc-section:nth-child(4) { animation-delay: 0.4s; }
.doc-section:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Impression */
@media print {
    .theme-toggle,
    .btn-back-top,
    .btn-top,
    .toc-fixed,
    .footer,
    .btn-print {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .doc-container {
        max-width: 100%;
        padding: 0;
    }

    .doc-header,
    .sommaire-section,
    .doc-section {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }

    .doc-section::before {
        display: none;
    }

    a {
        text-decoration: none !important;
        color: black !important;
    }

    .doc-content {
        color: #333 !important;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .toc-fixed {
        display: none;
    }
}

@media (max-width: 768px) {
    .doc-header h1 {
        font-size: 1.8rem;
        flex-direction: column;
    }

    .doc-icon-large {
        font-size: 2.5rem;
    }

    .sommaire-list {
        grid-template-columns: 1fr;
    }

    .doc-section {
        padding: 25px;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .doc-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn-print,
    .btn-back-top {
        width: 100%;
        justify-content: center;
    }
}
