
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --border-radius: 0.5rem;
    --box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-padding-top: 80px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 80px;
}

.layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 80px;
    bottom: 0;
    z-index: 90;
    padding-top: 1rem;
    box-shadow: 2px 0 12px rgba(0,0,0,0.05);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    max-width: calc(100% - 280px);
    overflow-x: hidden;
    margin-top: 0;
}

.header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    padding: 0.75rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: 80px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 100%;
    padding: 0 2rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: white;
}

.header-logo:hover {
    color: white;
    opacity: 0.9;
}

.header-logo img {
    height: 40px;
    filter: brightness(0) invert(1);
}

.header-title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.header-title .subtitle {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.sidebar-content {
    padding: 1.5rem;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 1rem;
    font-weight: 600;
}

.namespace-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.namespace-item {
    margin-bottom: 0.5rem;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.namespace-header {
    padding: 0.75rem 1rem;
    background: #f1f5f9;
    border: none;
    border-left: 3px solid var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    font-weight: 500;
    color: #334155;
    width: 100%;
    text-align: left;
}

.namespace-header:hover {
    background: #e2e8f0;
    transform: translateX(2px);
}

.namespace-header.active {
    background: var(--primary-color);
    color: white;
}

.namespace-header .icon {
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.namespace-header.active .icon {
    transform: rotate(90deg);
    opacity: 1;
}

.class-list {
    list-style: none;
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 0;
    background: #f8fafc;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    display: none;
}

.class-list.expanded {
    display: block;
    animation: slideDown 0.2s ease;
}

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

.class-item {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 0.375rem;
    transition: var(--transition);
}

.class-item:hover {
    background: #e2e8f0;
}

.class-item a {
    text-decoration: none;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.class-item a:hover {
    color: var(--primary-color);
}

.class-item.active {
    background: var(--primary-color);
}

.class-item.active a {
    color: white;
}

.class-item .badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 0.15em 0.5em;
}

.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 50rem;
}

.badge-namespace {
    background-color: #6f42c1;
    color: white;
}

.badge-stable { background-color: var(--success-color); color: white; }
.badge-beta { background-color: var(--warning-color); color: black; }
.badge-alpha { background-color: var(--danger-color); color: white; }
.badge-deprecated { background-color: var(--secondary-color); color: white; }
.badge-driver { background-color: #6610f2; color: white; }
.badge-config { background-color: #20c997; color: white; }
.badge-tool { background-color: #fd7e14; color: white; }
.badge-network { background-color: #17a2b8; color: white; }
.badge-system { background-color: #343a40; color: white; }

.content-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.class-header {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.class-title {
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
}

.class-namespace {
    color: #64748b;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.class-file {
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 1rem;
    display: inline-block;
}

.class-description {
    background: rgba(59, 130, 246, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 1.25rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin: 1.5rem 0;
    line-height: 1.7;
}

.class-description p {
    margin-bottom: 1rem;
}

.constants-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.constants-table th {
    background: #f1f5f9;
    color: #475569;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.constants-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.constants-table tr:last-child td {
    border-bottom: none;
}

.constants-table tr:hover {
    background-color: #f8fafc;
}

.constant-name {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #1e40af;
}

.constant-value {
    font-family: 'JetBrains Mono', monospace;
    color: #059669;
    font-weight: 500;
}

.constant-type {
    font-family: 'JetBrains Mono', monospace;
    color: #7c3aed;
    font-size: 0.9em;
    background: #f3f4f6;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
}

.namespace-section {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid #3b82f6;
}

.namespace-section h4 {
    color: #1e40af;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Architecture Diagram - CORRECTION IMPORTANTE */
.arch-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    overflow: auto;
}

.arch-wrapper {
    position: relative;
    display: block;
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: auto;
    height: auto;
}

.arch-overlay {
    position: absolute;
    border: 2px solid rgba(59, 130, 246, 0.7);
    background: rgba(59, 130, 246, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    z-index: 10;
}

.arch-overlay:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 1);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    transform: scale(1.02);
}

.arch-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    color: #64748b;
}

.arch-wrapper img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Correction pour que les overlays soient positionnés correctement */
.arch-wrapper {
    position: relative;
    line-height: 0;
}

.arch-wrapper img {
    display: block;
    width: 100%;
    height: auto;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
        max-width: calc(100% - 240px);
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    .header {
        height: 70px;
        padding: 0.5rem 0;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 70px;
        transition: left 0.3s ease;
        z-index: 1000;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 1rem;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .header-title h1 {
        font-size: 1.2rem;
    }
    
    .menu-toggle {
        display: block !important;
    }
    
    .layout {
        min-height: calc(100vh - 70px);
    }
    
    .constants-table {
        display: block;
        overflow-x: auto;
    }
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.method-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1rem 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.method-table th {
    background: #f1f5f9;
    color: #475569;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
}

.method-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.method-table tr:last-child td {
    border-bottom: none;
}

.method-table tr:hover {
    background-color: #f8fafc;
}

.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-block pre {
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-card .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: #1e293b;
}

.stat-card .label {
    color: #64748b;
    font-size: 0.9rem;
}

.breadcrumb {
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: #64748b;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: #1e293b;
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #94a3b8;
    margin: 0 0.5rem;
}

.param-name {
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary-color);
    font-weight: 600;
}

.method-signature {
    font-family: 'JetBrains Mono', monospace;
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: #475569;
}
