/**
 * Vetilog Documentation - Styles
 * Version: 1.0.0
 */

/* Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --sidebar-width: 220px;
    --header-height: 56px;
}

/* Base */
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.navbar-brand {
    font-size: 1.25rem;
}

.navbar .badge {
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    width: var(--sidebar-width);
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid #dee2e6;
}

.sidebar .nav-link {
    font-size: 0.9rem;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    margin: 0.1rem 0.5rem;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Main Content */
main {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
}

/* Content Styling */
main h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

main h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

main h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #444;
}

main h4 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #555;
}

/* Section anchors */
main section {
    scroll-margin-top: calc(var(--header-height) + 20px);
}

main section[id]::before {
    content: "";
    display: block;
    height: calc(var(--header-height) + 20px);
    margin-top: calc(-1 * (var(--header-height) + 20px));
    visibility: hidden;
    pointer-events: none;
}

/* Breadcrumb */
.breadcrumb {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin-bottom: 1.5rem;
}

.breadcrumb-item a {
    text-decoration: none;
}

/* Tables */
main table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

main table th,
main table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
}

main table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

main table tr:hover {
    background-color: #f8f9fa;
}

/* Code blocks */
main code {
    background-color: #f8f9fa;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: #e83e8c;
}

main pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

main pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

/* Alerts / Info boxes */
.info-box {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.info-box.info {
    background-color: #cff4fc;
    border-color: #0dcaf0;
}

.info-box.warning {
    background-color: #fff3cd;
    border-color: #ffc107;
}

.info-box.danger {
    background-color: #f8d7da;
    border-color: #dc3545;
}

.info-box.success {
    background-color: #d1e7dd;
    border-color: #198754;
}

/* Cards */
.doc-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s ease;
    position: relative;
}

.doc-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.doc-card h3 {
    margin-top: 0;
    color: var(--primary-color);
}

/* Feature list */
.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.feature-list li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    color: #198754;
}

/* Workflow diagram */
.workflow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.workflow-step {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.25rem;
    font-weight: 500;
}

.workflow-arrow {
    color: #6c757d;
}

/* Footer */
footer,
.footer {
    margin-top: auto;
    margin-left: var(--sidebar-width);
    position: relative;
    z-index: 101;
}

footer a,
.footer a {
    text-decoration: none;
}

footer a:hover,
.footer a:hover {
    text-decoration: underline;
}

/* Responsive - Tablet and below */
@media (max-width: 1199.98px) {
    .sidebar {
        position: fixed !important;
        top: var(--header-height) !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        background-color: #fff;
        overflow-x: auto;
        overflow-y: visible;
        z-index: 99;
    }

    .sidebar .position-sticky {
        position: static !important;
        padding-top: 0 !important;
    }

    .sidebar .nav,
    .sidebar .nav.flex-column,
    .sidebar ul.nav.flex-column {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        padding: 0.5rem;
        gap: 0.25rem;
    }

    .sidebar .nav-item {
        flex: 0 0 auto;
    }

    .sidebar .nav-link {
        padding: 0.4rem 0.75rem !important;
        margin: 0 !important;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .sidebar .sidebar-heading,
    .sidebar #page-toc {
        display: none !important;
    }

    /* Hide nested sub-menus in horizontal mode */
    .sidebar .nav .nav {
        display: none !important;
    }

    main,
    main.col-md-9,
    main.col-lg-10,
    .container-fluid main {
        margin-left: 0 !important;
        margin-top: calc(var(--header-height) + 50px) !important;
        padding-top: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    footer,
    .footer {
        margin-left: 0;
    }
}

/* Mobile specific */
@media (max-width: 575.98px) {
    main {
        padding: 1rem;
    }

    main h1 {
        font-size: 1.5rem;
    }

    /* Sous-titres plus petits sur mobile */
    .plyr__captions {
        font-size: 0.75rem !important;
    }

    .plyr__caption {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    .footer {
        display: none !important;
    }

    main {
        margin-left: 0;
        padding: 0;
    }

    main h1 {
        page-break-before: always;
    }

    main h2, main h3 {
        page-break-after: avoid;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scroll to top button */
#scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
}

#scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

#scroll-top:hover {
    background-color: #0b5ed7;
}

/* Footer Links */
.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #ffffff;
    text-decoration: none;
}

/* Trust Badges */
.trust-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.trust-badge i {
    color: var(--primary-color);
}

/* Footer social buttons */
footer .btn-outline-light.rounded-circle {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50% !important;
}

footer .btn-outline-light.rounded-circle:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Video Player */
.video-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.video-wrapper {
    max-width: 100%;
}

.video-wrapper video,
.video-wrapper .plyr {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
}

.video-title {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.video-container .ratio {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Plyr custom styling */
.plyr {
    --plyr-color-main: var(--primary-color);
    --plyr-font-size-large: 32px;
}

/* Sous-titres plus grands */
.plyr__captions {
    font-size: 1.5rem !important;
}

.plyr__caption {
    font-size: 1.5rem !important;
    padding: 0.5rem 1rem !important;
}

/* Transcript accordion */
.video-container .accordion-button {
    background-color: #fff;
    color: #333;
    font-weight: 500;
}

.video-container .accordion-button:not(.collapsed) {
    background-color: #e7f1ff;
    color: var(--primary-color);
}

.transcript-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #555;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}
