
:root {
    /* Palette sombre par défaut */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-sidebar: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;

    /* Couleurs des méthodes HTTP */
    --get: #10b981;
    --post: #3b82f6;
    --put: #f59e0b;
    --delete: #ef4444;
    --patch: #8b5cf6;

    /* Espacements */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --sidebar-width: 280px;
    --preview-width: 500px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Thème clair */
body.light {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --accent: #2563eb;
    --accent-hover: #3b82f6;

    /* Couleurs des méthodes HTTP (version claire) */
    --get: #059669;
    --post: #2563eb;
    --put: #d97706;
    --delete: #dc2626;
    --patch: #7c3aed;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    line-height: 1.5;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Menu */
.menu {
    padding: 1.5rem;
    flex-grow: 1;
}

.menu-group {
    margin-bottom: 1.5rem;
}

.menu-group-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    cursor: pointer;
    user-select: none;
}

.menu-group-title h3 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.menu-group-title i {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.menu-group.open .menu-group-title i {
    transform: rotate(180deg);
}

.menu-items {
    margin-top: 0.5rem;
    display: none;
}

.menu-group.open .menu-items {
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.menu-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.menu-item.active {
    background-color: var(--accent);
    color: white;
}

.menu-item.active .http-badge {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
}

.menu-item i {
    font-size: 0.75rem;
    width: 16px;
    text-align: center;
}

.http-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    padding: 0.25rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.http-get {
    background-color: var(--get);
    color: white;
}

.http-post {
    background-color: var(--post);
    color: white;
}

.http-put {
    background-color: var(--put);
    color: white;
}

.http-delete {
    background-color: var(--delete);
    color: white;
}

/* Main content */
.main-content {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.content-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.content-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.theme-toggle {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.card-icon {
    width: 40px;
    height: 40px;
    background-color: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.endpoint-url {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    /*border-left: 4px solid var(--accent);*/
}

/* Tables */
.parameters-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1rem 0;
}

.parameters-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background-color: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.parameters-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

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

.required-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #fee2e2;
    color: #991b1b;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

body.light .required-badge {
    background-color: #fecaca;
    color: #991b1b;
}

.optional-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #dbeafe;
    color: #1e40af;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

body.light .optional-badge {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Preview panel */
.preview-panel {
    width: var(--preview-width);
    background-color: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.preview-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.preview-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.language-selector {
    display: flex;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    margin: 1rem 0;
}

.language-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.language-tab.active {
    background-color: var(--accent);
    color: white;
}

.code-container {
    position: relative;
    margin-bottom: 1.5rem;
    display: none;
}

.code-container.active {
    display: block;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--bg-tertiary);
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.code-header span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.copy-btn {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background-color: var(--accent);
    color: white;
}

pre {
    margin: 0;
    padding: 1.5rem;
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    border-top: none;
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #e2e8f0;
    white-space: pre-wrap;
}

body.light pre {
    background-color: #1e293b;
    color: #cbd5e1;
}

.code-block {
    display: none;
}

.code-block.active {
    display: block;
}

/* JSON syntax highlighting */
.json-key {
    color: #7dd3fc;
}

.json-string {
    color: #bbf7d0;
}

.json-number {
    color: #fde68a;
}

.json-boolean {
    color: #fca5a5;
}

.json-null {
    color: #c4b5fd;
}

/* Responsive */
@media (max-width: 1200px) {
    body {
        flex-direction: column;
    }

    .sidebar,
    .preview-panel {
        width: 100%;
    }

    .sidebar {
        max-height: 300px;
    }

    .preview-panel {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-content {
    animation: fadeIn 0.4s ease;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--get);
}

.status-error {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--delete);
}

.status-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--put);
}

.status-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--post);
}