/* ============================================
   GoLearn - Feuille de styles principale
   ============================================ */

/* --- Variables CSS --- */
:root {
    --primary: #4A90D9;
    --primary-dark: #357ABD;
    --primary-light: #6BA3E0;
    --secondary: #2ECC71;
    --secondary-dark: #27AE60;
    --accent: #F39C12;
    --danger: #E74C3C;
    --warning: #F1C40F;
    --info: #3498DB;
    --dark: #2C3E50;
    --dark-light: #34495E;
    --gray-900: #1a1a2e;
    --gray-800: #2d2d44;
    --gray-700: #404060;
    --gray-600: #6c757d;
    --gray-500: #8e8e9a;
    --gray-400: #adb5bd;
    --gray-300: #d1d5db;
    --gray-200: #e9ecef;
    --gray-100: #f3f4f6;
    --white: #ffffff;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --shadow-hover: 0 8px 30px rgba(74,144,217,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Navbar --- */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 65px;
    gap: 20px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-brand i {
    font-size: 1.6rem;
}

.navbar-search {
    flex: 1;
    max-width: 400px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 14px;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 2px solid var(--gray-200);
    border-radius: 50px;
    font-size: 0.9rem;
    font-family: var(--font);
    transition: var(--transition);
    background: var(--gray-100);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(74,144,217,0.1);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--dark-light);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(74,144,217,0.08);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.user-name {
    font-weight: 500;
}

.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 6px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 50px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1001;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--dark-light);
    font-size: 0.9rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

.dropdown-empty {
    padding: 16px;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.85rem;
}

.navbar-toggler {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--dark);
    cursor: pointer;
    padding: 8px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #2a6ab5);
    color: white;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--gray-300);
    color: var(--dark);
}

.btn-success {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--secondary-dark), #1e8449);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #c0392b);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* --- Cards --- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img i {
    font-size: 3rem;
    color: rgba(255,255,255,0.8);
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
    line-height: 1.4;
}

.card-text {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
    font-size: 0.8rem;
    color: var(--gray-500);
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-primary { background: rgba(74,144,217,0.12); color: var(--primary); }
.badge-success { background: rgba(46,204,113,0.12); color: var(--secondary-dark); }
.badge-warning { background: rgba(243,156,18,0.12); color: var(--accent); }
.badge-danger { background: rgba(231,76,60,0.12); color: var(--danger); }
.badge-secondary { background: var(--gray-200); color: var(--gray-600); }
.badge-info { background: rgba(52,152,219,0.12); color: var(--info); }

/* --- Alerts --- */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin: 16px auto;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
    position: relative;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: rgba(46,204,113,0.1); color: #1e8449; border-left: 4px solid var(--secondary); }
.alert-danger { background: rgba(231,76,60,0.1); color: #c0392b; border-left: 4px solid var(--danger); }
.alert-warning { background: rgba(243,156,18,0.1); color: #d68910; border-left: 4px solid var(--accent); }
.alert-info { background: rgba(52,152,219,0.1); color: #2471a3; border-left: 4px solid var(--info); }

.alert-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

.alert-close:hover { opacity: 1; }

/* --- Forms --- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--white);
    color: var(--dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(74,144,217,0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%236c757d' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 4px;
}

.form-text {
    color: var(--gray-500);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* --- Progress Bar --- */
.progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: 50px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 50px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.6s ease;
    position: relative;
}

.progress-lg {
    height: 12px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* --- Stars Rating --- */
.stars {
    display: inline-flex;
    gap: 2px;
}

.stars i {
    color: var(--warning);
    font-size: 0.85rem;
}

.stars i.empty {
    color: var(--gray-300);
}

/* --- Tables --- */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.9rem;
}

table thead {
    background: var(--gray-100);
}

table th {
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

table tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
}

table tbody tr:hover {
    background: var(--gray-100);
}

/* --- Grid System --- */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--dark) 50%, var(--primary-dark) 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(74,144,217,0.3) 0%, transparent 70%);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(46,204,113,0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 60px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 40px;
}

.hero-stat {
    text-align: center;
}

.hero-stat .number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-light);
}

.hero-stat .label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.hero-illustration {
    width: 100%;
    max-width: 500px;
    padding: 40px;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.hero-illustration .code-block {
    background: rgba(0,0,0,0.3);
    border-radius: var(--radius-sm);
    padding: 20px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #e0e0e0;
    line-height: 1.8;
}

.hero-illustration .code-block .tag { color: #E44D26; }
.hero-illustration .code-block .attr { color: #F1C40F; }
.hero-illustration .code-block .val { color: #2ECC71; }
.hero-illustration .code-block .comment { color: #6c757d; }

/* --- Section --- */
.section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 12px;
}

.section-header p {
    color: var(--gray-600);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

.section-header-left {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header-left h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

/* --- Category Cards --- */
.category-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-decoration: none;
    color: var(--dark);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    color: var(--dark);
}

.category-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
}

.category-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.category-info span {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* --- Course Card --- */
.course-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.course-img {
    height: 160px;
    position: relative;
    overflow: hidden;
}

.course-img-bg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: rgba(255,255,255,0.9);
}

.course-img-real {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.course-card:hover .course-img-real {
    transform: scale(1.05);
}

/* Upload zones */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--gray-50);
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(74, 144, 217, 0.04);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.upload-preview {
    width: 100%;
    text-align: center;
}

.upload-preview img,
.upload-preview video {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Video container in course detail */
.course-video-container {
    border-radius: var(--radius);
    overflow: hidden;
}

.course-level {
    position: absolute;
    top: 12px;
    left: 12px;
}

.course-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.course-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-title a {
    color: inherit;
    text-decoration: none;
}

.course-title a:hover {
    color: var(--primary);
}

.course-desc {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.course-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    font-size: 0.8rem;
    color: var(--gray-500);
}

.course-footer span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.course-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.course-rating .score {
    font-weight: 700;
    color: var(--accent);
}

/* --- Features --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.feature-card {
    text-align: center;
    padding: 40px 24px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- Auth Pages --- */
.auth-page {
    min-height: calc(100vh - 65px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--dark) 100%);
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.password-toggle {
    position: relative;
}

.password-toggle .toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 1rem;
}

/* --- Dashboard Layout --- */
.dashboard {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 65px);
}

.sidebar {
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 24px 0;
    position: sticky;
    top: 65px;
    height: calc(100vh - 65px);
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-item {
    margin-bottom: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    color: var(--primary);
    background: rgba(74,144,217,0.05);
}

.sidebar-link.active {
    color: var(--primary);
    background: rgba(74,144,217,0.08);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 16px 24px;
}

.sidebar-label {
    padding: 8px 24px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dashboard-content {
    padding: 32px;
    background: var(--bg);
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* --- Stats Cards --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* --- Chart Container --- */
.chart-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

/* --- Quiz / Evaluation --- */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.quiz-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--danger);
}

.question-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 20px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.question-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
}

.question-points {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.options-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.option-item:hover {
    border-color: var(--primary-light);
    background: rgba(74,144,217,0.04);
}

.option-item.selected {
    border-color: var(--primary);
    background: rgba(74,144,217,0.08);
}

.option-item.correct {
    border-color: var(--secondary);
    background: rgba(46,204,113,0.08);
}

.option-item.incorrect {
    border-color: var(--danger);
    background: rgba(231,76,60,0.08);
}

.option-item input[type="radio"] {
    display: none;
}

.option-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--gray-500);
    flex-shrink: 0;
    transition: var(--transition);
}

.option-item.selected .option-marker {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.quiz-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
}

/* --- Course View --- */
.course-header-banner {
    padding: 60px 0;
    color: white;
    position: relative;
}

.course-header-content {
    position: relative;
    z-index: 1;
}

.course-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    color: rgba(255,255,255,0.7);
}

.course-breadcrumb a {
    color: rgba(255,255,255,0.7);
}

.course-breadcrumb a:hover {
    color: white;
}

.lesson-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
    min-height: calc(100vh - 65px);
}

.lesson-sidebar {
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    max-height: calc(100vh - 65px);
    position: sticky;
    top: 65px;
}

.lesson-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.lesson-sidebar-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.chapter-list {
    list-style: none;
}

.chapter-item {
    border-bottom: 1px solid var(--gray-100);
}

.chapter-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.chapter-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.chapter-link.active {
    background: rgba(74,144,217,0.08);
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid var(--primary);
}

.chapter-link.completed {
    color: var(--secondary-dark);
}

.chapter-link .chapter-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    border: 2px solid var(--gray-300);
}

.chapter-link.completed .chapter-icon {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.chapter-link.active .chapter-icon {
    border-color: var(--primary);
    color: var(--primary);
}

.lesson-content {
    padding: 40px;
    max-width: 900px;
}

.lesson-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--dark);
}

.lesson-content .code-example {
    background: var(--gray-900);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
}

.lesson-content .code-example pre {
    margin: 0;
}

.lesson-content .code-example code {
    color: #e0e0e0;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
}

.lesson-content ul, .lesson-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.lesson-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.lesson-content p {
    margin-bottom: 16px;
    line-height: 1.7;
}

.lesson-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 28px 0 12px;
    color: var(--dark);
}

.lesson-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 32px;
    margin-top: 40px;
    border-top: 2px solid var(--gray-200);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    list-style: none;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.pagination a {
    background: var(--white);
    color: var(--dark);
    box-shadow: var(--shadow);
}

.pagination a:hover {
    background: var(--primary);
    color: white;
}

.pagination .active {
    background: var(--primary);
    color: white;
}

/* --- Footer --- */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 60px 0 0;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
}

.footer-col h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.footer-col a {
    color: var(--gray-400);
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--primary-light);
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-800);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    color: white;
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--gray-800);
    font-size: 0.85rem;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 24px;
}

.tab-link {
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-500);
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-link:hover {
    color: var(--primary);
}

.tab-link.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* --- Result Card --- */
.result-card {
    text-align: center;
    padding: 40px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.result-score {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
}

.result-score.passed {
    background: rgba(46,204,113,0.1);
    color: var(--secondary-dark);
    border: 4px solid var(--secondary);
}

.result-score.failed {
    background: rgba(231,76,60,0.1);
    color: var(--danger);
    border: 4px solid var(--danger);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--gray-300);
}

.empty-state h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-600);
}

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 24px;
}

/* --- Utilities --- */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--secondary) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--accent) !important; }
.text-muted { color: var(--gray-500) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.w-100 { width: 100%; }

/* --- Modal responsive --- */
#createModal > .chart-card,
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* --- Video responsive --- */
video, iframe {
    max-width: 100%;
    height: auto;
}

.course-video-container video,
.course-video-container iframe {
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
}

/* --- Stat value/label (span-based) --- */
.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* --- Evaluations Page --- */
.eval-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.eval-card {
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--warning);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.eval-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.eval-card-course {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: block;
    margin-bottom: 4px;
}

.eval-card-title {
    margin: 0 0 12px;
    font-size: 0.95rem;
    line-height: 1.3;
    font-weight: 600;
}

.eval-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.eval-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.eval-card .btn {
    margin-top: auto;
    width: 100%;
    justify-content: center;
}

/* Evaluations table */
.eval-table-wrap {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.eval-table {
    width: 100%;
    min-width: 600px;
}

.eval-score {
    font-weight: 600;
    font-size: 1.1rem;
}

.eval-score--pass { color: var(--secondary-dark); }
.eval-score--fail { color: var(--danger); }

.eval-date {
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* Mobile card layout for evaluations table */
.eval-mobile-cards {
    display: none;
}

.eval-mobile-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 12px;
}

.eval-mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.eval-mobile-card-header strong {
    font-size: 0.95rem;
    line-height: 1.3;
    flex: 1;
}

.eval-mobile-card-course {
    font-size: 0.8rem;
    color: var(--primary);
    margin-bottom: 10px;
    display: block;
}

.eval-mobile-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-200);
    flex-wrap: wrap;
    gap: 8px;
}

.eval-mobile-card-score {
    font-size: 1.2rem;
    font-weight: 700;
}

.eval-mobile-card-date {
    font-size: 0.78rem;
    color: var(--gray-500);
}

/* --- Touch optimizations --- */
@media (hover: none) and (pointer: coarse) {
    .card:hover, .course-card:hover, .stat-card:hover,
    .feature-card:hover, .category-card:hover {
        transform: none;
    }
    .btn:hover {
        transform: none;
    }
    .nav-link {
        padding: 10px 14px;
    }
    .option-item {
        padding: 14px 18px;
    }
}

/* --- Responsive --- */

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar toggle button for mobile */
.sidebar-toggle-mobile {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(74,144,217,0.4);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 997;
    transition: var(--transition);
    align-items: center;
    justify-content: center;
}
.sidebar-toggle-mobile:hover {
    transform: scale(1.1);
}

/* Lesson sidebar toggle for mobile */
.lesson-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(46,204,113,0.4);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 997;
    transition: var(--transition);
    align-items: center;
    justify-content: center;
}

/* Mobile search bar - shown below navbar on mobile */
.navbar-search-mobile {
    display: none;
    padding: 8px 16px 12px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}
.navbar-search-mobile .search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 2px solid var(--gray-200);
    border-radius: 50px;
    font-size: 0.9rem;
    font-family: var(--font);
    transition: var(--transition);
    background: var(--gray-100);
}
.navbar-search-mobile .search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(74,144,217,0.1);
}

/* ---- Breakpoint: Tablette large / Desktop petit (max 1200px) ---- */
@media (max-width: 1200px) {
    .container {
        padding: 0 16px;
    }
    .dashboard-content {
        padding: 24px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- Breakpoint: Tablette (max 1024px) ---- */
@media (max-width: 1024px) {
    /* Hero */
    .hero-content { 
        grid-template-columns: 1fr; 
        text-align: center;
        gap: 30px;
    }
    .hero-visual { display: none; }
    .hero-stats { justify-content: center; }
    .hero-buttons { justify-content: center; }
    .hero h1 { font-size: 2.4rem; }

    /* Features & Grids */
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    /* Footer */
    .footer-grid { grid-template-columns: repeat(2, 1fr); }

    /* Dashboard - sidebar slide-in sur tablette */
    .dashboard { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: 65px;
        left: -280px;
        width: 270px;
        height: calc(100vh - 65px);
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: none;
    }
    .sidebar.show {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .sidebar-toggle-mobile {
        display: flex;
    }

    /* Evaluations grid */
    .eval-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    /* Lesson layout */
    .lesson-layout { grid-template-columns: 1fr; }
    .lesson-sidebar {
        position: fixed;
        top: 65px;
        left: -320px;
        width: 300px;
        height: calc(100vh - 65px);
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: none;
    }
    .lesson-sidebar.show {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .lesson-sidebar-toggle {
        display: flex;
    }

    /* Course view header inline grid */
    .course-header-grid {
        grid-template-columns: 1fr !important;
    }
    .course-header-card {
        min-width: auto !important;
    }

    /* Navbar */
    .navbar-search {
        max-width: 280px;
    }
    .nav-link span:not(.notif-badge):not(.user-name) {
        /* keep visible on tablet */
    }

    /* Section */
    .section { padding: 48px 0; }
    .section-header h2 { font-size: 1.7rem; }
}

/* ---- Breakpoint: Tablette portrait / Mobile grand (max 768px) ---- */
@media (max-width: 768px) {
    /* Navbar */
    .navbar-search { display: none; }
    .navbar-search-mobile { display: block; }
    .navbar-menu { 
        display: none; 
    }
    .navbar-toggler { display: block; }
    .navbar-menu.show {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 65px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 16px;
        box-shadow: var(--shadow-lg);
        z-index: 999;
        gap: 4px;
        border-top: 1px solid var(--gray-200);
        max-height: calc(100vh - 65px);
        overflow-y: auto;
    }
    .navbar-menu.show .nav-link {
        padding: 12px 16px;
        border-radius: var(--radius-sm);
        font-size: 0.95rem;
    }
    .navbar-menu.show .nav-link:hover {
        background: var(--gray-100);
    }
    .navbar-menu.show .nav-dropdown {
        width: 100%;
    }
    .navbar-menu.show .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 1px solid var(--gray-200);
        margin-top: 4px;
        border-radius: var(--radius-sm);
    }
    .navbar-menu.show .dropdown-menu:not(.show) {
        display: none;
    }
    .navbar-menu.show .dropdown-menu.show {
        display: block;
    }
    .navbar-menu.show .user-name {
        display: inline;
    }
    .navbar-content {
        height: 60px;
    }

    /* Hero */
    .hero { padding: 40px 0; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 0.95rem; }
    .hero-stats { 
        flex-wrap: wrap; 
        gap: 20px; 
    }
    .hero-stat .number { font-size: 1.5rem; }

    /* Grids */
    .features-grid { grid-template-columns: 1fr; gap: 20px; }
    .grid-4, .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }

    /* Section */
    .section { padding: 32px 0; }
    .section-header { margin-bottom: 32px; }
    .section-header h2 { font-size: 1.5rem; }
    .section-header p { font-size: 0.95rem; }
    .section-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Dashboard */
    .dashboard-content { padding: 16px; }
    .page-header { margin-bottom: 20px; }
    .page-header h1 { font-size: 1.4rem; }
    .page-header p { font-size: 0.85rem; }

    /* Evaluations mobile */
    .eval-grid {
        grid-template-columns: 1fr;
    }
    .eval-table-wrap {
        display: none;
    }
    .eval-mobile-cards {
        display: block;
    }
    .stat-value {
        font-size: 1.4rem;
    }
    .stat-label {
        font-size: 0.75rem;
    }

    /* Stat cards */
    .stat-card {
        padding: 16px;
        gap: 12px;
    }
    .stat-icon {
        width: 46px;
        height: 46px;
        font-size: 1.1rem;
    }
    .stat-info h3 { font-size: 1.4rem; }

    /* Cards */
    .card-body { padding: 16px; }
    .course-body { padding: 16px; }
    .chart-card { padding: 16px; }
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .chart-container { height: 220px; }

    /* Lesson content */
    .lesson-content { padding: 20px 16px; }
    .lesson-content h2 { font-size: 1.4rem; }
    .lesson-nav {
        flex-direction: column;
        gap: 12px;
    }
    .lesson-nav .btn {
        width: 100%;
        justify-content: center;
    }

    /* Auth */
    .auth-page { padding: 20px 16px; }
    .auth-card { 
        padding: 24px 20px; 
        max-width: 100%;
    }
    .auth-header h2 { font-size: 1.3rem; }

    /* Tables - better mobile presentation */
    table th, table td {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    table th {
        font-size: 0.7rem;
    }

    /* Tabs */
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tabs::-webkit-scrollbar { display: none; }
    .tab-link {
        padding: 10px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Buttons */
    .btn { 
        padding: 8px 18px; 
        font-size: 0.85rem; 
    }
    .btn-lg { 
        padding: 12px 24px; 
        font-size: 0.9rem; 
    }

    /* Quiz */
    .quiz-header { 
        flex-direction: column; 
        gap: 12px; 
        padding: 16px;
        text-align: center;
    }
    .quiz-timer { font-size: 1rem; }
    .question-card { padding: 20px; }
    .question-text { font-size: 1rem; }
    .option-item { 
        padding: 12px 16px;
        font-size: 0.9rem; 
    }
    .quiz-actions { 
        flex-direction: column; 
        gap: 8px; 
    }
    .quiz-actions .btn { width: 100%; }

    /* Result card */
    .result-score {
        width: 120px;
        height: 120px;
        font-size: 2rem;
    }

    /* Category card */
    .category-card {
        padding: 16px;
        gap: 12px;
    }
    .category-icon {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    /* Feature card */
    .feature-card {
        padding: 28px 20px;
    }
    .feature-icon {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }

    /* Footer */
    .footer { padding: 40px 0 0; }
    .footer-brand { font-size: 1.2rem; }
    .footer-col h4 { margin-bottom: 12px; }

    /* Pagination */
    .pagination { flex-wrap: wrap; }
    .pagination a, .pagination span {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* Empty state */
    .empty-state { padding: 40px 16px; }
    .empty-state i { font-size: 2.5rem; }
    .empty-state h3 { font-size: 1.05rem; }

    /* Filters row responsive */
    .filters-row,
    [style*="display: flex"][style*="gap"] {
        flex-wrap: wrap !important;
    }

    /* Inline grid overrides for mobile */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: 1fr auto"],
    .inline-grid-responsive {
        grid-template-columns: 1fr !important;
    }

    /* Form grid responsive */
    .form-grid, .grid.grid-2, .grid.grid-3 {
        grid-template-columns: 1fr !important;
    }

    /* Reset grid-column spans on mobile */
    [style*="grid-column: span"] {
        grid-column: span 1 !important;
    }

    /* Course view header */
    .course-header-banner {
        padding: 30px 0;
    }
    .course-header-banner h1 {
        font-size: 1.4rem !important;
    }

    /* Sidebar mobile adjustments */
    .sidebar {
        left: -280px;
        width: 270px;
    }
    .sidebar.show {
        left: 0;
    }

    /* Dropdown improvements for mobile */
    .dropdown-menu {
        min-width: 220px;
    }

    /* Utility adjustments */
    .d-flex {
        flex-wrap: wrap;
    }
}

/* ---- Breakpoint: Mobile (max 576px) ---- */
@media (max-width: 576px) {
    /* Container */
    .container { padding: 0 12px; }

    /* Hero */
    .hero { padding: 30px 0; }
    .hero h1 { font-size: 1.6rem; }
    .hero p { font-size: 0.9rem; margin-bottom: 20px; }
    .hero-buttons { 
        flex-direction: column; 
        gap: 10px;
    }
    .hero-buttons .btn { width: 100%; }
    .hero-stats { 
        flex-direction: column; 
        gap: 12px; 
    }

    /* Navbar */
    .navbar-brand i { font-size: 1.5rem; }
    .navbar-content { 
        height: 56px; 
        gap: 12px;
    }
    .navbar-toggler { font-size: 1.2rem; }

    /* Dashboard */
    .dashboard-content { padding: 12px; }
    .page-header h1 { font-size: 1.2rem; }

    /* Stats */
    .stat-card {
        padding: 14px;
    }
    .stat-info h3 { font-size: 1.2rem; }
    .stat-info p { font-size: 0.75rem; }
    .stat-value { font-size: 1.2rem; }
    .stat-label { font-size: 0.7rem; }

    /* Evaluations */
    .eval-card {
        padding: 14px;
    }
    .eval-card-title {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    .eval-card-meta {
        font-size: 0.75rem;
        gap: 8px;
        margin-bottom: 12px;
    }
    .eval-mobile-card {
        padding: 14px;
    }
    .eval-mobile-card-header strong {
        font-size: 0.88rem;
    }
    .eval-mobile-card-score {
        font-size: 1rem;
    }

    /* Cards */
    .chart-card { 
        padding: 14px; 
        margin-bottom: 16px;
    }
    .chart-header h3 { font-size: 0.95rem; }

    /* Course cards */
    .course-img { height: 140px; }
    .course-body { padding: 14px; }
    .course-title { font-size: 0.95rem; }
    .course-footer { font-size: 0.75rem; }

    /* Auth */
    .auth-card { padding: 20px 16px; }
    .auth-header .logo { font-size: 1.5rem; }
    .auth-header h2 { font-size: 1.2rem; }

    /* Quiz */
    .quiz-container { padding: 0; }
    .question-card { padding: 16px; }
    .question-text { font-size: 0.95rem; }
    .option-item {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    .option-marker {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    /* Tables */
    table th, table td {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    /* Forms */
    .form-control {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    .form-label { font-size: 0.85rem; }
    .form-group { margin-bottom: 16px; }

    /* Sort/filter bar */
    select.form-control {
        font-size: 0.8rem;
        padding: 8px 30px 8px 12px;
    }

    /* Section */
    .section { padding: 24px 0; }
    .section-header { margin-bottom: 24px; }
    .section-header h2 { font-size: 1.3rem; }
    .section-header p { font-size: 0.85rem; }

    /* Buttons */
    .btn { 
        padding: 8px 14px; 
        font-size: 0.8rem; 
    }
    .btn-lg { 
        padding: 10px 20px; 
        font-size: 0.85rem; 
    }
    .btn-sm {
        padding: 5px 12px;
        font-size: 0.75rem;
    }

    /* Footer */
    .footer { padding: 32px 0 0; }
    .social-links { gap: 8px; }
    .social-links a { width: 32px; height: 32px; font-size: 0.85rem; }
    .footer-bottom { font-size: 0.75rem; }

    /* Breadcrumb */
    .course-breadcrumb { 
        font-size: 0.75rem; 
        flex-wrap: wrap;
    }

    /* Progress */
    .progress-label { font-size: 0.75rem; }

    /* Lesson */
    .lesson-content { padding: 16px 12px; }
    .lesson-content h2 { font-size: 1.2rem; }
    .lesson-content h3 { font-size: 1.1rem; }

    /* Result */
    .result-card { padding: 24px 16px; }
    .result-score {
        width: 100px;
        height: 100px;
        font-size: 1.6rem;
    }

    /* Badge */
    .badge { font-size: 0.7rem; padding: 3px 8px; }

    /* Alert */
    .alert { 
        padding: 10px 14px; 
        font-size: 0.8rem;
        margin: 12px auto;
    }

    /* Sidebar wider on small phones */
    .sidebar {
        width: 260px;
        left: -270px;
    }
    .sidebar-link {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    .sidebar-label {
        padding: 6px 20px;
        font-size: 0.65rem;
    }

    /* Override inline min-width on filters */
    .search-box,
    [style*="min-width: 250px"],
    [style*="min-width: 200px"],
    [style*="min-width: 180px"],
    [style*="min-width: 160px"],
    [style*="min-width: 150px"],
    [style*="min-width: 140px"] {
        min-width: 100% !important;
        width: 100% !important;
    }
    select.form-control[style*="width: auto"] {
        width: 100% !important;
    }
    [style*="max-width: 300px"] {
        max-width: 100% !important;
    }

    /* Upload zone */
    .upload-zone {
        min-height: 100px;
        padding: 14px;
    }

    /* Modal responsive */
    #createModal > .chart-card {
        width: 95% !important;
        max-width: 100% !important;
        padding: 16px !important;
    }
}

/* ---- Breakpoint: Très petit mobile (max 400px) ---- */
@media (max-width: 400px) {
    .hero h1 { font-size: 1.35rem; }
    .hero p { font-size: 0.85rem; }
    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 12px;
    }
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }
    .stat-info h3 { font-size: 1rem; }
    .stat-value { font-size: 1rem; }
    .page-header h1 { font-size: 1.1rem; }
    .course-title { font-size: 0.85rem; }
    .auth-card { padding: 16px 12px; }
    .navbar-brand i { font-size: 1.3rem; }
}

/* ---- Orientation paysage mobile ---- */
@media (max-height: 500px) and (orientation: landscape) {
    .hero { padding: 20px 0; }
    .hero h1 { font-size: 1.4rem; }
    .hero-stats { display: none; }
    .sidebar {
        top: 56px;
        height: calc(100vh - 56px);
    }
    .lesson-sidebar {
        top: 56px;
        height: calc(100vh - 56px);
    }
}

/* ---- Print ---- */
@media print {
    .navbar, .sidebar, .footer, .sidebar-toggle-mobile, 
    .lesson-sidebar-toggle, .mobile-overlay, .navbar-search-mobile { 
        display: none !important; 
    }
    .dashboard { grid-template-columns: 1fr; }
    .lesson-layout { grid-template-columns: 1fr; }
    .dashboard-content, .lesson-content { padding: 0; }
    body { background: white; }
}

/* --- Animations --- */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}
