:root {
    --background-primary: #f8fafc;
    --background-secondary: #ffffff;
    --background-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #6366f1;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #06b6d4;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

[data-theme="dark"] {
    --background-primary: #0f172a;
    --background-secondary: #1e293b;
    --background-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-light: #334155;
    --border-medium: #475569;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    gap: 0;
}

/* Sidebar */
.sidebar-logs {
    background: var(--background-secondary);
    border-right: 1px solid var(--border-light);
    padding: 24px 0;
    overflow-y: auto;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-logs h2 {
    padding: 0 24px 16px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category {
    margin-bottom: 8px;
}

.category h3 {
    padding: 12px 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.category h3::before {
    content: '▶';
    font-size: 10px;
    transition: transform 0.2s ease;
}

.category h3:hover {
    background: var(--background-tertiary);
    color: var(--accent-primary);
}

.category h3.selected {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
}

.category h3.selected::before {
    transform: rotate(90deg);
}

.modules-list {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.modules-list.hidden {
    max-height: 0;
}

.module-link {
    display: block;
    padding: 10px 24px 10px 52px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.module-link:hover {
    background: var(--background-tertiary);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    padding-left: 54px;
}

.module-link.active {
    background: var(--background-tertiary);
    color: var(--accent-primary);
    font-weight: 600;
    border-left-color: var(--accent-primary);
}

/* Main content */
.main-content {
    padding: 32px;
    max-width: 1400px;
}

.header-section {
    margin-bottom: 32px;
}

.header-section h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-section p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Barre de recherche et filtres */
.controls-bar {
    background: var(--background-secondary);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--background-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--background-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--background-secondary);
    border-color: var(--accent-primary);
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--background-secondary);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Logs list */
.logs-container {
    background: var(--background-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.logs-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logs-header h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.log-entry {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s ease;
}

.log-entry:hover {
    background: var(--background-tertiary);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.log-class {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.log-time {
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.log-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    padding-left: 28px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-steam {
    background: linear-gradient(135deg, #1b2838, #2a475e);
    color: #66c0f4;
}

.badge-number {
    background: var(--background-tertiary);
    color: var(--accent-primary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 24px;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    background: var(--background-tertiary);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.pagination .active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-color: transparent;
    font-weight: 600;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .sidebar-logs {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }
    
    .controls-bar {
        flex-direction: column;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}