/* Reset et variables */
:root {
    --primary-bg: #ffffff;
    --secondary-bg: #f8f9fa;
    --tertiary-bg: #f1f3f5;
    --border-color: #e9ecef;
    --primary-text: #212529;
    --secondary-text: #6c757d;
    --accent-color: #10b981;
    --accent-hover: #059669;
    --code-bg: #f8f9fa;
    --sidebar-width: 280px;
    --header-height: 64px;
}

[data-theme="dark"] {
    --primary-bg: #1a1a1a;
    --secondary-bg: #242424;
    --tertiary-bg: #2d2d2d;
    --border-color: #3a3a3a;
    --primary-text: #e9ecef;
    --secondary-text: #adb5bd;
    --accent-color: #10b981;
    --accent-hover: #34d399;
    --code-bg: #2d2d2d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--primary-bg);
    color: var(--primary-text);
    line-height: 1.6;
    transition: background 0.2s, color 0.2s;
}

/* Header */
.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary-text);
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
    height: 32px;
}

.logo-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 3px;
    display: block;
    flex-shrink: 0;
    vertical-align: middle;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
}

.docs-label {
    color: var(--secondary-text);
    font-size: 14px;
    font-weight: 500;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
    width: 240px;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--primary-bg);
    color: var(--primary-text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--accent-color);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-text);
    pointer-events: none;
}

.theme-toggle {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--secondary-text);
    font-size: 14px;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--secondary-bg);
    color: var(--primary-text);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--primary-text);
    cursor: pointer;
    padding: 8px;
}

/* Sidebar */
.docs-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--secondary-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 24px 0;
    z-index: 50;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    color: var(--primary-text);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.nav-links {
    list-style: none;
}

.nav-link {
    display: block;
    padding: 8px 24px 8px 52px;
    color: var(--secondary-text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-text);
    background: var(--tertiary-bg);
}

.nav-link.active {
    color: var(--accent-color);
    font-weight: 500;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Content */
.docs-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 48px;
    max-width: 900px;
}

.content-header {
    margin-bottom: 32px;
}

.content-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-text);
}

.content-description {
    font-size: 18px;
    color: var(--secondary-text);
    line-height: 1.6;
}

.content-body h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 40px 0 16px;
    color: var(--primary-text);
}

.content-body h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 32px 0 12px;
    color: var(--primary-text);
}

.content-body p {
    margin-bottom: 16px;
    color: var(--primary-text);
    line-height: 1.7;
}

.content-body ul,
.content-body ol {
    margin-bottom: 16px;
    padding-left: 24px;
    color: var(--primary-text);
}

.content-body li {
    margin-bottom: 8px;
}

.content-body a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

.content-body a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Code blocks */
.content-body code {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 14px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    color: var(--accent-color);
}

.content-body pre {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.content-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary-text);
}

/* Cards */
.card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

/* Offset pour les ancres avec header fixe */
.card[id] {
    scroll-margin-top: calc(var(--header-height) + 24px);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 16px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-text);
}

.card-text {
    color: var(--secondary-text);
    font-size: 14px;
    line-height: 1.6;
}

/* Alerts */
.alert {
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border-left: 4px solid;
}

.alert-info {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-color);
    color: var(--primary-text);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: var(--primary-text);
}

/* Footer */
.docs-footer {
    margin-left: var(--sidebar-width);
    padding: 32px 48px;
    border-top: 1px solid var(--border-color);
    color: var(--secondary-text);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .docs-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .docs-content,
    .docs-footer {
        margin-left: 0;
        padding: 24px;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .search-box {
        display: none;
    }
    
    .content-title {
        font-size: 28px;
    }
}

/* Icon inline */
.icon-inline {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 8px;
}

.icon-inline-sm {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 6px;
}

/* FAQ Section */
.faq-section {
    margin: 2rem 0;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.faq-item h3 {
    margin: 0 0 0.75rem 0;
    color: var(--primary-text);
    font-size: 1.1rem;
    font-weight: 600;
}

.faq-item p {
    margin: 0;
    color: var(--secondary-text);
    line-height: 1.6;
}

.requirements-grid {
    display: grid;
    gap: 20px;
    margin: 24px 0 32px;
}

@media (min-width: 768px) {
    .requirements-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .requirements-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.requirement-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 12px;
    padding: 18px 22px;
}

[data-theme="dark"] .requirement-card {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.32);
}

.requirement-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-bg);
    border: 1px solid rgba(16, 185, 129, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    flex-shrink: 0;
}

.requirement-card h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    color: var(--primary-text);
}

.requirement-card p {
    margin: 0;
    color: var(--secondary-text);
    font-size: 14px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-text);
}