/* Composants UI réutilisables pour la documentation */

.nav-tabs {
    display: flex;
    background: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: var(--box-shadow);
    flex-wrap: nowrap;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    padding: 0;
    margin: 0 auto;
    max-width: 100%;
}

/* Style pour les scrollbars webkit */
.nav-tabs::-webkit-scrollbar {
    height: 4px;
}

.nav-tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.nav-tabs::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.nav-tabs::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.tab {
    flex: 0 0 auto;
    padding: 12px 16px;
    text-align: center;
    cursor: pointer;
    background: var(--light-color);
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    min-width: 140px;
    max-width: 180px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    outline: none;
}

.tab.active {
    background: var(--primary-color);
    color: white;

    .tab:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
        box-shadow: 0 0 0 2px var(--secondary-color);
        z-index: 2;
    }
}

.tab:hover {
    background: #5a6fd8;
    color: white;
}

.tab-content {
    background: white;
    padding: 40px;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--box-shadow);
    min-height: 600px;
    margin: 0 auto;
    width: 100%;
    overflow-x: auto;
}

/* Container pour les onglets avec indicateurs de scroll */
.tabs-container {
    position: relative;
    margin: 20px 0;
    --show-help: block;
}

.tabs-container::before {
    content: "← Faites défiler pour voir tous les onglets →";
    display: var(--show-help, block);
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

/* Boutons de navigation pour le scroll */
.nav-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tabs-container.scrollable .nav-controls {
    opacity: 1;
}

.nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    outline: none;
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--secondary-color);
}

.nav-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.nav-btn:active {
    transform: translateY(0);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Indicateurs de scroll */
.nav-tabs::before,
.nav-tabs::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 4px;
    /* Laisser de la place pour la scrollbar */
    width: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.nav-tabs::before {
    left: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.9) 0%, transparent 100%);
}

.nav-tabs::after {
    right: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.9) 0%, transparent 100%);
}

.nav-tabs.scrollable::before,
.nav-tabs.scrollable::after {
    opacity: 1;
}

/* Animation pour indiquer le scroll disponible */
.nav-tabs.scrollable {
    animation: pulse-scroll 2s ease-in-out infinite;
}

@keyframes pulse-scroll {

    0%,
    100% {
        box-shadow: var(--box-shadow);
    }

    50% {
        box-shadow: var(--box-shadow), 0 0 0 2px rgba(102, 126, 234, 0.3);
    }
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    margin: 15px 0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: pre-wrap;
    line-height: 1.5;
    word-wrap: break-word;
}

.code-block:hover {
    background: #4a5568;
}

.code-block::before {
    content: "📋 Cliquer pour copier";
    display: block;
    font-size: 0.7rem;
    color: #a0aec0;
    margin-bottom: 10px;
    font-family: 'Segoe UI', sans-serif;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    margin: 5px 5px 5px 0;
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

.badge.info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge.warning {
    background: #fff3cd;
    color: #856404;
}

.badge.danger {
    background: #f8d7da;
    color: #721c24;
}

.component-card {
    background: var(--light-color);
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    transition: var(--transition);
}

.component-card:hover {
    box-shadow: var(--box-shadow);
    transform: translateX(5px);
}

.endpoint {
    background: var(--light-color);
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--transition);
}

.endpoint:hover {
    box-shadow: var(--box-shadow);
}

.endpoint-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.method {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
}

.endpoint-body {
    padding: 20px;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(var(--primary-color), 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .nav-tabs {
        flex-direction: column;
    }

    .tab-content {
        padding: 20px;
    }
}

/* Styles spécifiques pour les tests */
.info-card.critical {
    border-left: 4px solid #e53e3e;
    background: linear-gradient(135deg, #fed7d7 0%, #fbb6ce 100%);
}

.info-card.performance {
    border-left: 4px solid #d69e2e;
    background: linear-gradient(135deg, #faf089 0%, #f6e05e 100%);
}

.info-card.robustness {
    border-left: 4px solid #38a169;
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
}

.percentage {
    font-size: 0.9rem;
    font-weight: bold;
    text-align: right;
    margin-top: 10px;
    opacity: 0.8;
}

.accordion {
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid #e2e8f0;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    background: #f7fafc;
    padding: 15px 20px;
    margin: 0;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    user-select: none;
}

.accordion-header:hover {
    background: #edf2f7;
}

.accordion-content {
    padding: 20px;
    display: none;
    background: white;
}

.accordion-item.active .accordion-content {
    display: block;
}

.utils-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.utils-category h5 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.utils-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.utils-category li {
    padding: 2px 0;
    font-size: 0.85rem;
}

.roadmap {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.roadmap-item {
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid #e2e8f0;
}

.roadmap-item.completed {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    border-left-color: #38a169;
}

.roadmap-item.next {
    background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
    border-left-color: #3182ce;
}

.roadmap-item.future {
    background: linear-gradient(135deg, #faf089 0%, #f6e05e 100%);
    border-left-color: #d69e2e;
}

.roadmap-item h3 {
    margin-top: 0;
    color: #2d3748;
}

.best-practices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.practice-category {
    padding: 20px;
    background: #f7fafc;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
}

.practice-category h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.troubleshooting {
    margin-top: 20px;
}

.problem-solution {
    margin-bottom: 15px;
    padding: 15px;
    background: #fffaf0;
    border-left: 3px solid #d69e2e;
    border-radius: var(--border-radius);
}

.problem-solution h4 {
    margin-top: 0;
    color: #c53030;
}

.problem-solution p {
    margin-bottom: 0;
}

/* 🚀 Performance Components */
.performance-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.metric-card {
    text-align: center;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-card.excellent {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.metric-card.good {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
}

.metric-card.average {
    background: linear-gradient(135deg, #ed8936, #d69e2e);
    color: white;
}

.metric-card.poor {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.metric-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bundle-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.bundle-table th,
.bundle-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.bundle-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.bundle-table tr:hover {
    background: #f7fafc;
}

.size-excellent {
    color: #38a169;
    font-weight: 600;
}

.size-good {
    color: #3182ce;
    font-weight: 600;
}

.size-average {
    color: #d69e2e;
    font-weight: 600;
}

.size-poor {
    color: #e53e3e;
    font-weight: 600;
}

.compression-excellent {
    background: #c6f6d5;
    color: #22543d;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.compression-good {
    background: #bee3f8;
    color: #2a4365;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.metric-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.metric-icon {
    font-size: 1.5rem;
    margin-right: 10px;
}

.threshold-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.threshold-table th,
.threshold-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.threshold-table th {
    background: #f7fafc;
    font-weight: 600;
}

.status-excellent {
    color: #38a169;
}

.status-good {
    color: #3182ce;
}

.status-average {
    color: #d69e2e;
}

.status-poor {
    color: #e53e3e;
}

.success-metrics {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.success-item {
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 5px solid #38a169;
    background: #f0fff4;
}

.success-item.achieved {
    border-left-color: #38a169;
    background: #f0fff4;
}

.success-metric {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 15px;
    align-items: center;
}

.success-label {
    font-weight: 600;
    color: #2d3748;
}

.success-target {
    color: #4a5568;
    font-size: 0.9rem;
}

.success-actual {
    color: #38a169;
    font-weight: 600;
}

.success-status {
    background: #c6f6d5;
    color: #22543d;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.benefit-list {
    list-style: none;
    padding: 0;
}

.benefit-list li {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.benefit-list li:last-child {
    border-bottom: none;
}

.future-list {
    list-style: none;
    padding: 0;
}

.future-list li {
    padding: 8px 0;
    position: relative;
    padding-left: 20px;
}

.future-list li::before {
    content: "🎯";
    position: absolute;
    left: 0;
    top: 8px;
}

/* Developer Guide Styles */
.developer-cards {
    margin: 20px 0;
}

.doc-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.doc-card .card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.doc-card h4 {
    color: white;
    margin: 10px 0;
    font-size: 1.8rem;
}

.doc-card .card-content {
    margin-top: 20px;
}

.doc-card .card-content ul {
    list-style: none;
    padding-left: 0;
}

.doc-card .card-content li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.doc-card .card-content li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #a3f7bf;
    font-weight: bold;
}

.doc-card .card-actions {
    margin-top: 25px;
}

.btn-primary {
    background: white;
    color: #667eea;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.link-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.link-card .link-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.link-card h4 {
    color: #2d3748;
    margin: 10px 0;
}

.link-card p {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.link-btn {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.link-btn:hover {
    color: #764ba2;
}

.status-section {
    margin: 30px 0;
}

.status-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
}

.progress-grid {
    margin: 20px 0;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
}

.progress-label {
    min-width: 150px;
    font-weight: 600;
    color: #2d3748;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    transition: width 0.3s ease;
}

.progress-value {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: #38a169;
}

.rules-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.rule-card {
    border-radius: 12px;
    padding: 25px;
}

.rule-card.success {
    background: #f0fff4;
    border: 2px solid #48bb78;
}

.rule-card.danger {
    background: #fff5f5;
    border: 2px solid #f56565;
}

.rule-card .rule-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.rule-card h4 {
    margin: 10px 0;
}

.rule-card.success h4 {
    color: #22543d;
}

.rule-card.danger h4 {
    color: #742a2a;
}

.rule-card ul {
    list-style: none;
    padding-left: 0;
}

.rule-card.success li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #22543d;
}

.rule-card.success li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #48bb78;
    font-weight: bold;
}

.rule-card.danger li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #742a2a;
}

.rule-card.danger li::before {
    content: "✗";
    position: absolute;
    left: 0;
    color: #f56565;
    font-weight: bold;
}

.architecture-overview {
    margin: 20px 0;
}

.architecture-note {
    background: #fef5e7;
    border-left: 4px solid #f39c12;
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
}

.architecture-note p {
    margin: 10px 0;
    color: #7d6608;
}

.architecture-note strong {
    color: #7d6608;
}

.naming-conventions {
    margin: 20px 0;
}

.commands-section {
    margin: 20px 0;
}

.command-group {
    margin: 25px 0;
}

.command-group h4 {
    color: #2d3748;
    margin-bottom: 15px;
}

.code-block.mini {
    padding: 10px 15px;
    font-size: 0.9rem;
}

.project-structure {
    margin: 20px 0;
}

.contribution-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.step-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    color: #2d3748;
    margin: 0 0 10px 0;
}

.step-content p {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

.support-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.support-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.support-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.support-card h4 {
    color: #2d3748;
    margin: 10px 0;
}

.support-card p {
    color: #718096;
    font-size: 0.9rem;
}

.checklist-section {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.2s;
}

.checklist-item:hover {
    background: #f7fafc;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checklist-item span {
    color: #2d3748;
    font-size: 1rem;
}

.checklist-item input[type="checkbox"]:checked + span {
    color: #48bb78;
    text-decoration: line-through;
}

.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin: 30px 0;
}

.cta-section h4 {
    color: white;
    font-size: 2rem;
    margin-bottom: 15px;
}

.cta-section p {
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover {
    background: white;
    color: #667eea;
}