/* ============================================================================
   Documentation Boxanet - Styles
   Author: GeoCodeTout - Frédéric Nauleau
   Date: 2026-02-05
   ============================================================================ */

:root {
    /* Couleurs principales */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #10b981;
    --accent: #f59e0b;
    
    /* Grises */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Thème clair */
    --bg-primary: #ffffff;
    --bg-secondary: var(--gray-50);
    --bg-sidebar: var(--gray-900);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-sidebar: var(--gray-300);
    --border: var(--gray-200);
    --code-bg: var(--gray-100);
    --shadow: rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --sidebar-width: 280px;
    --header-height: 60px;
    
    /* Transitions */
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg-primary: var(--gray-900);
    --bg-secondary: var(--gray-800);
    --bg-sidebar: #0a0e1a;
    --text-primary: var(--gray-100);
    --text-secondary: var(--gray-400);
    --text-sidebar: var(--gray-400);
    --border: var(--gray-700);
    --code-bg: var(--gray-800);
    --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    display: flex;
    min-height: 100vh;
}

/* ============================================================================
   Sidebar
   ============================================================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.sidebar-header .subtitle {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
}

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

.nav-section h3 {
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
}

.nav-link {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    color: var(--gray-500);
}

.sidebar-footer p {
    margin-bottom: 0.25rem;
}

.sidebar-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition);
}

.sidebar-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================================================
   Main Content
   ============================================================================ */

.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-header {
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.breadcrumb {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

#current-section {
    color: var(--text-primary);
    font-weight: 500;
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.25rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--border);
}

/* ============================================================================
   Article Content
   ============================================================================ */

.article {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

.doc-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.doc-section.active {
    display: block;
}

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

/* Typography */

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-primary);
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* ============================================================================
   Components
   ============================================================================ */

/* Info Boxes */

.info-box {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.info-box.info {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary);
    color: var(--text-primary);
}

.info-box.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--secondary);
    color: var(--text-primary);
}

.info-box.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--accent);
    color: var(--text-primary);
}

/* Code Blocks */

code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.875em;
    color: var(--primary);
}

pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

/* Code Examples */

.code-example {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

.code-good, .code-bad {
    border-radius: 0.5rem;
    overflow: hidden;
}

.code-good strong {
    display: block;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
    font-size: 0.875rem;
}

.code-bad strong {
    display: block;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 0.875rem;
}

.code-block strong {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--gray-700);
    color: white;
    font-size: 0.875rem;
}

.code-block pre {
    margin: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--border);
}

/* Tables */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--bg-primary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px var(--shadow);
}

thead {
    background: var(--bg-secondary);
}

th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--bg-secondary);
}

/* Grid */

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

.card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px var(--shadow);
}

.card h3 {
    margin-top: 0;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.card ul {
    margin-bottom: 0;
}

.card li {
    font-size: 0.875rem;
}

/* Links */

.links {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: var(--transition);
}

.link-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 6px var(--shadow);
    transform: translateY(-2px);
}

.link-icon {
    font-size: 2rem;
}

.link-card strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.link-card span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================================================
   Responsive
   ============================================================================ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
        z-index: 100;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0;
    }
    
    .article {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        padding: 0 1rem;
    }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
    .sidebar,
    .content-header,
    .theme-toggle {
        display: none;
    }
    
    .content {
        margin-left: 0;
    }
    
    .article {
        max-width: none;
    }
}
