/* AF Cohag - Frontend Styles (basé sur le HTML fourni) */

.af-cohag-sitemap {
    max-width: 1300px;
    margin: 2rem auto;
    padding: 0 1.5rem 2.5rem;
}

.af-cohag-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 2rem;
}

@media (max-width: 768px) {
    .af-cohag-header {
        flex-direction: column;
        gap: 1rem;
    }
}

.af-cohag-title-block {
    flex: 1;
}

.af-cohag-title {
    font-size: 1.9rem;
    font-weight: 650;
    margin: 0 0 0.2rem;
    color: #111827;
}

.af-cohag-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
}

/* Stats Header */
.af-cohag-stats-header {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-badge {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 20px;
    text-align: center;
    min-width: 100px;
}

.stat-badge-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #2563eb;
}

.stat-badge-primary .stat-number,
.stat-badge-primary .stat-label {
    color: #fff;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    color: #111827;
}

.stat-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

/* Progress Bar */
.af-cohag-progress-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1.75rem;
    position: relative;
}

.af-cohag-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.af-cohag-progress-bar .progress-text {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Layout */
.af-cohag-layout {
    display: grid;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    gap: 1.75rem;
    align-items: flex-start;
}

@media (max-width: 800px) {
    .af-cohag-layout {
        grid-template-columns: 1fr;
    }
    
    .af-cohag-sidebar {
        position: static !important;
        max-height: none !important;
    }
}

/* Sidebar */
.af-cohag-sidebar {
    position: sticky;
    top: 1.5rem;
    background: #ffffff;
    border-radius: 14px;
    padding: 1rem 1.25rem 1.2rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
    border: 1px solid #e5e7eb;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #4b5563;
    margin-bottom: 0.6rem;
}

.sidebar-intro {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

/* TOC (Table of Contents) */
.toc {
    list-style: none;
    margin: 0;
    padding-left: 0;
    font-size: 0.86rem;
}

.toc ul {
    list-style: none;
    margin: 0.1rem 0 0.1rem 0.9rem;
    padding-left: 0;
}

.toc li {
    margin: 0.12rem 0;
}

.toc a {
    text-decoration: none;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.35rem;
    border-radius: 999px;
    transition: background 0.12s ease, color 0.12s ease;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.toc a:hover {
    background: #e5f2ff;
    color: #1d4ed8;
    cursor: pointer;
}

.toc-checkbox {
    flex-shrink: 0;
    cursor: pointer;
}

.toc-text {
    flex: 1;
}

/* Hiérarchie des niveaux */
.nav-silo {
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid #e5e7eb;
}

.nav-silo > a {
    font-weight: 700;
    padding-left: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nav-pilier > a {
    font-weight: 600;
    padding-left: 0.6rem;
}

.nav-page > a {
    padding-left: 1rem;
    font-size: 0.85rem;
}

.nav-subpage > a {
    padding-left: 1.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

/* Items done (cochés) */
.toc-item-done > a {
    background: #d1fae5;
    color: #065f46;
}

.toc-item-done.nav-subpage > a {
    background: #ecfdf5;
    color: #047857;
}

.toc-item-done a::after {
    content: "✔";
    font-size: 0.75rem;
    margin-left: auto;
    opacity: 0.9;
}

/* Content Area */
.af-cohag-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.6rem 1.9rem 1.7rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    border: 1px solid #e5e7eb;
    min-height: 400px;
}

@media (max-width: 640px) {
    .af-cohag-content {
        padding: 1.2rem 1.3rem 1.3rem;
    }
}

.content-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.content-placeholder p {
    margin: 0.5rem 0;
}

.content-placeholder .description {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* Content Details */
.content-details {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.content-header h2 {
    margin: 0;
    font-size: 1.6rem;
    color: #111827;
}

.item-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.type-silo {
    background: #dbeafe;
    color: #1e40af;
}

.type-pilier {
    background: #fce7f3;
    color: #be185d;
}

.type-page {
    background: #fef3c7;
    color: #92400e;
}

.type-subpage {
    background: #f3e8ff;
    color: #6b21a8;
}

.content-info {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.info-row {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    align-items: center;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
}

.info-row strong {
    min-width: 80px;
    color: #6b7280;
    font-size: 0.9rem;
}

.info-row code {
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #1e40af;
    border: 1px solid #e5e7eb;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-done {
    background: #d1fae5;
    color: #065f46;
}

.status-todo {
    background: #fee2e2;
    color: #991b1b;
}

.content-actions {
    margin-bottom: 1.5rem;
}

.status-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-toggle:hover {
    background: #f3f4f6;
    border-color: #3b82f6;
}

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

.status-toggle span {
    font-weight: 500;
    color: #374151;
}

.content-description {
    padding: 1rem;
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    border-radius: 4px;
}

.content-description p {
    margin: 0;
    color: #1e40af;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Scrollbar personnalisé pour la sidebar */
.af-cohag-sidebar::-webkit-scrollbar {
    width: 6px;
}

.af-cohag-sidebar::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.af-cohag-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.af-cohag-sidebar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Error state */
.af-cohag-error,
.af-cohag-empty {
    padding: 40px 20px;
    text-align: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #6b7280;
}

.af-cohag-error {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fee2e2;
}
