:root {
    --primary-color: #C24F00;
    --primary-hover: #5C2805;
    --secondary-color: #003084;
    --accent-blue: #0131B8;
    --success-color: #22C55E;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #057ED1;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e5e5e5;
    --bg-card: rgba(255, 255, 255, 0.82);
    
    --text-primary: #0a0a0a;
    --text-secondary: #737373;
    --text-tertiary: #a3a3a3;
    
    --border-color: #e5e5e5;
    --glass-border: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --border-radius: 0.5rem;
    --transition: all 0.3s ease;

    /* Curseurs personnalisés */
    --cursor-default: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M3 2l12 8.5-5.5 1.2L6.3 17z' fill='%230a0a0a' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E") 3 2, auto;
    --cursor-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='M8 2v12h3l2 5 2.5-1-2-5H17L8 2z' fill='%230a0a0a' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E") 8 2, pointer;
}

/* Dark Mode */
[data-theme="dark"] {
    color-scheme: dark;
    --primary-color: #FF8630;
    --primary-hover: #C24F00;
    --secondary-color: #057ED1;
    --accent-blue: #47C9FE;
    --success-color: #22C55E;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #47C9FE;
    
    --bg-primary: #171717;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #262626;
    --bg-card: rgba(23, 23, 23, 0.85);
    
    --text-primary: #fafafa;
    --text-secondary: #a3a3a3;
    --text-tertiary: #737373;
    
    --border-color: #262626;
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);

    --cursor-default: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M3 2l12 8.5-5.5 1.2L6.3 17z' fill='%23fafafa' stroke='%230a0a0a' stroke-width='1'/%3E%3C/svg%3E") 3 2, auto;
    --cursor-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='M8 2v12h3l2 5 2.5-1-2-5H17L8 2z' fill='%23fafafa' stroke='%230a0a0a' stroke-width='1'/%3E%3C/svg%3E") 8 2, pointer;
}

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

/* Curseur adaptatif au thème (utilise --cursor-default / --cursor-pointer) */
body {
    cursor: var(--cursor-default);
}
body a, body button, body [onclick], body label[for], body select,
body input[type='submit'], body input[type='button'], body input[type='checkbox'],
body input[type='radio'], body .btn, body [role='button'], body summary {
    cursor: var(--cursor-pointer);
}

#cyberBg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: transparent;
    /* background transparent : le canvas cyber-background dessine le fond */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .navbar {
    background-color: rgba(10, 10, 10, 0.85);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.nav-brand {
    flex-shrink: 0;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-quick-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-quick-actions .nav-msg-icon {
    display: none;
}

.nav-quick-actions .nav-messages-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.92rem;
    transition: var(--transition);
}

.nav-quick-actions .nav-messages-link:hover {
    color: white;
    background: rgba(194, 79, 0, 0.18);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Dark Mode Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: var(--cursor-pointer);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
}

.theme-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: var(--border-color);
    border-radius: 13px;
    transition: var(--transition);
}

.theme-switch-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .theme-switch {
    background-color: var(--primary-color);
}

[data-theme="dark"] .theme-switch-slider {
    transform: translateX(24px);
}

.theme-icon {
    font-size: 1.25rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.92rem;
}

.nav-menu a:hover {
    color: white;
    background: rgba(194, 79, 0, 0.18);
}

.nav-menu a.btn-primary,
.nav-menu a.btn-secondary {
    color: white;
}

.nav-user {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: var(--cursor-pointer);
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #0131B8;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #5C2805 0%, #001A4D 100%);
}

.btn-success:hover {
    background-color: #16a34a;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border-color: var(--error-color);
    color: #991b1b;
}

.alert-info {
    background-color: #f0f0f0;
    border-color: var(--info-color);
    color: #003084;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0131B8 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Sections */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 3rem 0 1.5rem;
    text-align: center;
    color: var(--accent-blue);
}

/* Features Grid */
.features {
    padding: 2rem 0;
}

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

.feature-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
}

/* Topics Grid */
.topics {
    padding: 2rem 0;
}

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

.topic-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.topic-card:hover {
    border-color: var(--primary-color);
}

.topic-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

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

/* CTA Section */
.cta {
    text-align: center;
    padding: 3rem 0;
    margin: 3rem 0;
}

.cta h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem 0;
}

.auth-card {
    background: var(--bg-card);
    padding: 2.5rem 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 480px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin: 40px auto;
}

[data-theme="dark"] .auth-card {
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    background: rgba(23, 23, 23, 0.92);
}

.auth-card h2 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    text-align: center;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-card .auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.auth-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 700;
}

.auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
}

[data-theme="dark"] .form-control {
    background-color: rgba(10, 10, 10, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(194, 79, 0, 0.15);
    background-color: var(--bg-primary);
}

[data-theme="dark"] .form-control:focus {
    box-shadow: 0 0 0 3px rgba(255, 134, 48, 0.15);
    background-color: var(--bg-primary);
}

.form-control::placeholder {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Fix: native <option> elements in dark mode */
.form-control option {
    background-color: var(--bg-primary, #1a1a1a);
    color: var(--text-primary, #f0f0f0);
}

[data-theme="dark"] .form-control option {
    background-color: #1e1e1e;
    color: #f0f0f0;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.auth-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    margin-top: 8px;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
}

.auth-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194, 79, 0, 0.3);
}

[data-theme="dark"] .auth-card .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(255, 134, 48, 0.3);
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* Dashboard */
.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Courses Grid */
.courses-section {
    margin-bottom: 3rem;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.course-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.course-card.locked {
    opacity: 0.7;
}

.course-card .lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 10;
}

.course-card .lock-icon {
    font-size: 60px;
    opacity: 0.9;
}

.course-card .lock-text {
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.course-card .lock-deps {
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
    max-width: 80%;
}

.course-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.course-difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.course-difficulty.débutant {
    background-color: #d1fae5;
    color: #065f46;
}

.course-difficulty.intermédiaire {
    background-color: #fef3c7;
    color: #92400e;
}

.course-difficulty.avancé {
    background-color: #fee2e2;
    color: #991b1b;
}

.course-category {
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.course-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.course-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.course-progress {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: var(--success-color);
    transition: width 0.3s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.progress-status {
    color: var(--text-secondary);
}

.progress-status.completed {
    color: var(--success-color);
    font-weight: 600;
}

.progress-score {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Course View */
.course-view {
    max-width: 900px;
    margin: 0 auto;
}

.course-breadcrumb {
    margin-bottom: 2rem;
}

.course-breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.course-header-full {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.course-header-full h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.course-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.content-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.content-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.course-body {
    line-height: 1.8;
}

.course-body h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.course-body h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.course-body ul, .course-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.course-body li {
    margin-bottom: 0.5rem;
}

.course-body pre {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1rem 0;
}

.course-body code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* Exercises */
.exercises-section {
    margin-top: 3rem;
}

.exercises-section h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.exercises-intro {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.exercise-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.exercise-number {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.exercise-question {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.exercise-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: var(--cursor-pointer);
    transition: var(--transition);
}

.option-label:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.option-label input[type="radio"] {
    margin-right: 0.75rem;
    cursor: var(--cursor-pointer);
}

.option-text {
    flex: 1;
}

.exercise-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
}

.exercise-result.correct {
    background-color: #d1fae5;
    border: 1px solid var(--success-color);
}

.exercise-result.incorrect {
    background-color: #fee2e2;
    border: 1px solid var(--error-color);
}

.result-message {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-message.correct {
    color: var(--success-color);
}

.result-message.incorrect {
    color: var(--error-color);
}

.result-explanation {
    color: var(--text-primary);
}

.btn-submit-exercise {
    margin-top: 1rem;
    cursor: var(--cursor-pointer);
}

.exercises-summary {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    text-align: center;
    margin-top: 2rem;
}

.summary-text {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-secondary);
}

[data-theme="dark"] .footer {
    background-color: rgba(10, 10, 10, 0.85);
}

/* Notifications */
.notification-container {
    position: relative;
    z-index: 1001;
}

.notification-bell {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: var(--cursor-pointer);
    position: relative;
    padding: 0.5rem;
    transition: transform 0.2s ease;
}

.notification-bell:hover {
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--error-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 400px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 10000;
    margin-top: 0.5rem;
}

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

.notification-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: var(--cursor-pointer);
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.mark-all-read:hover {
    background-color: var(--bg-tertiary);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
    cursor: var(--cursor-pointer);
}

.notification-item:hover {
    background-color: var(--bg-secondary);
}

.notification-item.read {
    opacity: 0.6;
}

.notification-item.unread {
    background-color: var(--bg-tertiary);
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.notification-mark-read {
    background: none;
    border: none;
    color: var(--success-color);
    cursor: var(--cursor-pointer);
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
}

.notification-item:hover .notification-mark-read {
    opacity: 1;
}

.notification-mark-read:hover {
    background-color: var(--bg-tertiary);
}

.notification-item.clickable {
    cursor: var(--cursor-pointer);
}

.notification-item.clickable:hover {
    background-color: rgba(194, 79, 0, 0.08);
}

.notification-arrow {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
}

.notification-item.clickable:hover .notification-arrow {
    transform: translateX(3px);
    color: var(--primary-color);
}

.no-notifications {
    text-align: center;
    padding: 2rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ====================================
   SKILL TREE STYLES
   ==================================== */

/* Skill Tree Container */
.skill-tree-container {
    width: 100%;
    height: calc(100vh - 60px);
    position: relative;
    background: transparent;
    overflow: hidden;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ::before stars removed — cyber canvas handles the background */

@keyframes twinkle {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.25; }
}

/* Skill Tree Controls */
.skill-tree-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, rgba(194, 79, 0, 0.15) 0%, rgba(92, 40, 5, 0.15) 100%);
    padding: 25px 30px;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(25px);
    border: 2px solid rgba(194, 79, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.skill-tree-controls .filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-tree-controls label {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #FF8630 0%, #47C9FE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.skill-tree-controls select {
    padding: 12px 20px;
    border: 2px solid rgba(5, 126, 209, 0.5);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    background: rgba(23, 23, 23, 0.95);
    color: #ffffff;
    cursor: var(--cursor-pointer);
    transition: all 0.3s ease;
    outline: none;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.skill-tree-controls select option {
    background: #1a1a1a;
    color: #ffffff;
    padding: 10px;
    font-weight: 600;
}

.skill-tree-controls select option:hover,
.skill-tree-controls select option:checked {
    background: linear-gradient(135deg, #C24F00 0%, #0131B8 100%);
    color: #ffffff;
}

.skill-tree-controls select:hover,
.skill-tree-controls select:focus {
    border-color: #057ED1;
    box-shadow: 0 0 25px rgba(5, 126, 209, 0.4), 0 4px 15px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, rgba(194, 79, 0, 0.3) 0%, rgba(92, 40, 5, 0.3) 100%);
    transform: translateY(-2px);
}

#skill-tree-canvas {
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
}

#skill-tree-canvas:active {
    cursor: grabbing;
}

@media (pointer: coarse) {
    #skill-tree-canvas {
        cursor: default;
    }
}

/* Loading Spinner */
.skill-tree-container .loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    z-index: 100;
    text-align: center;
}

.skill-tree-container .spinner {
    border: 4px solid rgba(194, 79, 0, 0.2);
    border-top: 4px solid #C24F00;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(194, 79, 0, 0.4);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Skill Tree Controls Toggle (mobile only) */
.skill-tree-controls-toggle {
    display: none;
}

/* Skill Tree Share Panel */
.skill-tree-share-panel {
    position: absolute;
    top: 55px;
    right: 10px;
    z-index: 1100;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    max-width: 380px;
    width: 90%;
}

/* Mobile Help Hint */
.mobile-help-hint {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(194, 79, 0, 0.95) 0%, rgba(92, 40, 5, 0.95) 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.5s ease-out, pulse 2s ease-in-out infinite;
    pointer-events: none;
}

.mobile-help-hint .help-icon {
    font-size: 18px;
    margin-right: 8px;
}

.mobile-help-hint .help-text {
    letter-spacing: 0.5px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, 0) scale(1);
    }
    50% {
        transform: translate(-50%, 0) scale(1.05);
    }
}

@media (max-width: 768px) {
    .mobile-help-hint {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Course Detail Panel */
.course-detail-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 450px;
    max-height: 75vh;
    background: var(--bg-secondary);
    z-index: 3000;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--primary-color);
    border-radius: 20px;
    overflow: hidden;
    flex-direction: column;
}

[data-theme="dark"] .course-detail-panel {
    background: var(--bg-secondary);
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.8);
}

.course-detail-panel.show {
    display: flex;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.course-detail-panel .panel-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    flex: 1;
}

.course-detail-panel::-webkit-scrollbar {
    width: 10px;
}

.course-detail-panel::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.course-detail-panel::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

.course-detail-panel::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Panel Header */
.course-detail-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    cursor: move;
    user-select: none;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.course-detail-panel .panel-header-left {
    flex: 1;
}

.course-detail-panel .panel-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.course-detail-panel .panel-category {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.course-detail-panel .panel-difficulty {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 0.75rem;
    border: 2px solid var(--border-color);
}

.course-detail-panel .panel-close {
    width: 45px;
    height: 45px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: var(--cursor-pointer);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 28px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.course-detail-panel .panel-close:hover {
    background: var(--error-color);
    border-color: var(--error-color);
    color: white;
    transform: rotate(90deg);
}

/* Panel Content Grid */
.course-detail-panel .panel-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    width: 100%;
}

/* Info Cards */
.course-detail-panel .info-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.2rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

[data-theme="dark"] .course-detail-panel .info-card {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

.course-detail-panel .info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.course-detail-panel .info-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.course-detail-panel .info-card-icon {
    font-size: 2rem;
}

.course-detail-panel .info-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.course-detail-panel .info-card-content {
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.7;
}

.course-detail-panel .info-card-full {
    grid-column: 1 / -1;
}

.course-detail-panel .panel-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Progress Bar */
.course-detail-panel .panel-progress-bar {
    width: 100%;
    height: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.course-detail-panel .panel-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color) 0%, #16a34a 100%);
    transition: width 0.5s ease;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .course-detail-panel .panel-progress-fill {
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.5);
}

.course-detail-panel .panel-progress-text {
    text-align: right;
    font-size: 1.25rem;
    color: var(--success-color);
    font-weight: 700;
}

/* Stats */
.course-detail-panel .stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    line-height: 1;
}

/* Actions */
.course-detail-panel .panel-actions {
    width: 100%;
    margin-top: 1rem;
}

.course-detail-panel .btn-goto-course {
    width: 100%;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: var(--cursor-pointer);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.course-detail-panel .btn-goto-course:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(194, 79, 0, 0.5);
}

[data-theme="dark"] .course-detail-panel .btn-goto-course:hover {
    box-shadow: 0 10px 30px rgba(5, 126, 209, 0.6);
}

.course-detail-panel .btn-goto-course:active {
    transform: translateY(0);
}

.course-detail-panel .btn-goto-course:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.course-detail-panel .btn-goto-course:disabled:hover {
    transform: none;
}

/* Locked Message */
.course-detail-panel .course-locked-message {
    padding: 1.25rem;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--error-color);
    border-radius: var(--border-radius);
    color: var(--error-color);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    text-align: center;
    font-weight: 600;
}

[data-theme="dark"] .course-detail-panel .course-locked-message {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* ========================================
   RESPONSIVE MOBILE STYLES
   ======================================== */

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text-primary);
    cursor: var(--cursor-pointer);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.mobile-menu-toggle:active {
    transform: scale(0.92);
}

.mobile-menu-toggle.is-open {
    background-color: var(--bg-secondary);
}

.mobile-menu-toggle .mobile-menu-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle.is-open .mobile-menu-icon {
    transform: rotate(90deg);
}

/* Tablets and smaller desktops (991px and below) */
@media (max-width: 991px) {
    .container {
        padding: 0 15px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .course-detail-panel {
        width: 90%;
        max-width: 500px;
    }
}

/* Mobile devices (768px and below) */
@media (max-width: 768px) {
    /* Typography */
    body {
        font-size: 14px;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
        margin: 2rem 0 1rem;
    }

    /* Container */
    .container {
        padding: 0 10px;
    }

    /* Navigation */
    .navbar {
        padding: 0.6rem 0;
    }

    .navbar .container {
        flex-wrap: wrap;
        position: relative;
        gap: 0.4rem;
    }

    .nav-brand {
        flex: 1 1 auto;
        min-width: 0;
    }

    .nav-brand a {
        font-size: 1.15rem;
    }

    .nav-brand .site-brand-link span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Quick actions row: always visible at the top */
    .nav-quick-actions {
        order: 2;
        margin-left: 0;
        gap: 0.15rem;
    }

    .nav-quick-actions .theme-toggle {
        padding: 0.35rem 0.5rem;
        width: auto;
    }

    /* Messages link: show icon only on mobile */
    .nav-quick-actions .nav-messages-link {
        position: relative;
        padding: 0.4rem 0.55rem;
        border-radius: 8px;
        color: var(--text-primary);
        text-decoration: none;
        font-size: 1.3rem;
        line-height: 1;
    }

    .nav-quick-actions .nav-messages-link:hover {
        background: var(--bg-secondary);
    }

    .nav-quick-actions .nav-msg-icon {
        display: inline-block;
    }

    .nav-quick-actions .nav-msg-text {
        display: none;
    }

    .nav-quick-actions .nav-msg-badge {
        position: absolute;
        top: 2px;
        right: 0;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        font-size: 0.62rem;
        line-height: 16px;
        border-radius: 8px;
        border: 2px solid var(--bg-primary);
        box-sizing: content-box;
    }

    .mobile-menu-toggle {
        display: block;
        order: 3;
        flex-shrink: 0;
    }

    /* Collapsible nav menu with smooth slide-down */
    .nav-menu {
        display: flex;
        width: 100%;
        order: 4;
        flex-direction: column;
        background: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        gap: 0.25rem;
        align-items: stretch;

        max-height: 0;
        overflow: hidden;
        padding: 0 0;
        margin-top: 0;
        opacity: 0;
        transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease, margin-top 0.25s ease;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .nav-menu.active {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        padding: 0.75rem 0 1rem;
        margin-top: 0.6rem;
        opacity: 1;
    }

    .nav-menu a {
        padding: 0.85rem 1rem;
        width: 100%;
        text-align: left;
        border-radius: 10px;
        font-size: 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .nav-menu a:hover,
    .nav-menu a:active {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    .user-dropdown {
        width: 100%;
    }

    .nav-user {
        width: 100%;
        justify-content: center;
    }

    .dropdown-menu {
        position: relative;
        width: 100%;
        margin-top: 0.5rem;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }

    /* Hero Section */
    .hero {
        padding: 2.5rem 0;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    /* Main Content */
    .main-content {
        padding: 1.5rem 0;
    }

    /* Grids */
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .features-grid, 
    .topics-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Cards */
    .feature-card,
    .topic-card,
    .course-card {
        padding: 1.5rem;
    }

    .course-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Auth Pages */
    .auth-container {
        padding: 1.5rem 0;
        min-height: 60vh;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        margin: 0 10px;
    }

    .auth-title {
        font-size: 1.75rem;
    }

    /* iOS fix: prevent auto-zoom on input focus (requires font-size >= 16px) */
    .form-control,
    .form-control:focus,
    textarea.form-control,
    select.form-control {
        font-size: 16px;
    }

    /* Course View */
    .course-view {
        padding: 0 10px;
    }

    .course-breadcrumb {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }

    .course-header-full {
        padding: 1.5rem;
    }

    .course-header-full h1 {
        font-size: 1.5rem;
    }

    .course-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .content-card {
        padding: 1.5rem;
    }

    .content-card h2 {
        font-size: 1.25rem;
    }

    .course-body h2 {
        font-size: 1.25rem;
    }

    .course-body h3 {
        font-size: 1.125rem;
    }

    .course-body pre {
        font-size: 0.875rem;
        overflow-x: auto;
    }

    /* Exercises */
    .exercise-card {
        padding: 1.5rem;
    }

    .exercise-question {
        font-size: 1.125rem;
    }

    .option-label {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Buttons */
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    /* Notifications: anchor the dropdown below the navbar (full-width, fixed) */
    .notification-container {
        position: static;
    }

    .notification-bell {
        position: relative;
        padding: 0.4rem 0.5rem;
        font-size: 1.4rem;
    }

    .notification-badge {
        border: 2px solid var(--bg-primary);
        box-sizing: content-box;
    }

    .notification-dropdown {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        max-height: calc(100vh - 80px);
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-top: 0;
        z-index: 10001;
    }

    .notification-item {
        padding: 0.85rem;
    }

    /* Skill Tree */
    .skill-tree-container {
        height: calc(100vh - 80px);
    }

    /* Toggle button — mobile only */
    .skill-tree-controls-toggle {
        display: flex;
        align-items: center;
        gap: 6px;
        position: absolute;
        top: 10px;
        left: 10px;
        z-index: 1050;
        background: linear-gradient(135deg, rgba(194,79,0,0.9) 0%, rgba(92,40,5,0.9) 100%);
        border: 2px solid rgba(194,79,0,0.6);
        border-radius: 12px;
        color: #fff;
        font-size: 0.82rem;
        font-weight: 700;
        padding: 8px 14px;
        cursor: pointer;
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.35);
        letter-spacing: 0.5px;
    }

    .skill-tree-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        top: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: calc(100vw - 20px);
        box-sizing: border-box;
        /* Ensure controls don't start immediately at top — leave room for toggle */
        top: 54px;
        /* Smooth collapse */
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
        max-height: 600px;
        opacity: 1;
    }

    /* Collapsed state */
    .skill-tree-controls.collapsed {
        max-height: 0;
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-width: 0;
        pointer-events: none;
    }

    .skill-tree-controls label {
        font-size: 12px;
        text-align: left;
        margin-right: 0;
        margin-bottom: 4px;
    }

    .skill-tree-controls .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .skill-tree-controls select {
        width: 100%;
        min-width: auto;
        padding: 10px 40px 10px 12px;
        font-size: 14px;
        -webkit-appearance: none;
        appearance: none;
        background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 20px;
    }

    /* Share button inside controls — full width on mobile */
    .skill-tree-controls .filter-group:last-child {
        margin-left: 0;
    }
    .skill-tree-controls .filter-group:last-child .btn {
        width: 100%;
        justify-content: center;
    }

    /* Share panel — fixed to viewport on mobile */
    .skill-tree-share-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 30px rgba(0,0,0,0.25);
        padding: 20px 16px;
        z-index: 3100;
    }

    /* Course Detail Panel */
    .course-detail-panel {
        width: 95vw;
        max-width: none;
        max-height: 85vh;
        border-radius: 12px;
    }

    .course-detail-panel .panel-container {
        padding: 1rem;
    }

    .course-detail-panel .panel-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .course-detail-panel .panel-close {
        align-self: flex-end;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .course-detail-panel .panel-title {
        font-size: 1.2rem;
    }

    .course-detail-panel .panel-category,
    .course-detail-panel .panel-difficulty {
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
    }

    .course-detail-panel .panel-content {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .course-detail-panel .info-card {
        padding: 1rem;
    }

    .course-detail-panel .info-card-icon {
        font-size: 1.5rem;
    }

    .course-detail-panel .info-card-title {
        font-size: 0.85rem;
    }

    .course-detail-panel .stat-value {
        font-size: 2.5rem;
    }

    .course-detail-panel .btn-goto-course {
        padding: 1rem;
        font-size: 1rem;
    }

    /* Dashboard specific */
    .dashboard-header h1 {
        font-size: 1.75rem;
    }

    .dashboard-header p {
        font-size: 1rem;
    }

    /* CTA Section */
    .cta h2 {
        font-size: 1.5rem;
    }

    .cta p {
        font-size: 0.9rem;
    }

    /* Footer */
    .footer {
        padding: 1.5rem 0;
        font-size: 0.875rem;
    }
}

/* Small mobile devices (480px and below) */
@media (max-width: 480px) {
    /* Further optimizations for very small screens */
    body {
        font-size: 13px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .nav-brand a {
        font-size: 1rem;
    }

    .mobile-menu-toggle {
        font-size: 1.5rem;
    }

    .auth-card {
        padding: 1.5rem 1rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .form-control {
        padding: 0.625rem;
        font-size: 0.9rem;
    }

    .course-card,
    .feature-card,
    .topic-card {
        padding: 1.25rem;
    }

    .course-title {
        font-size: 1.125rem;
    }

    .course-description {
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .btn-lg {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }

    .course-detail-panel {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        top: 0 !important;
        left: 0 !important;
        right: 0;
        bottom: 0;
        transform: none !important;
    }

    .course-detail-panel.show {
        transform: none !important;
    }
    
    .course-detail-panel .panel-container {
        padding: 1rem;
        max-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .course-detail-panel .panel-title {
        font-size: 1.1rem;
    }

    .course-detail-panel .stat-value {
        font-size: 2rem;
    }
    
    .course-detail-panel .panel-close {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }

    .skill-tree-controls {
        padding: 8px;
    }
    .skill-tree-controls-toggle {
        padding: 7px 11px;
        font-size: 0.78rem;
    }

    .notification-item {
        font-size: 0.875rem;
    }

    .notification-title {
        font-size: 0.9rem;
    }

    .notification-message {
        font-size: 0.8rem;
    }
}

/* Landscape mode for mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .course-detail-panel {
        max-height: 95vh;
    }

    .skill-tree-container {
        height: calc(100vh - 60px);
    }
}

/* Touch-specific improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes */
    .btn,
    .option-label,
    .nav-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Remove hover effects that don't work on touch */
    .course-card:hover,
    .feature-card:hover,
    .topic-card:hover {
        transform: none;
    }

    /* Make interactive elements more obvious */
    .btn,
    .option-label {
        border-width: 2px;
    }
}

/* === Styles pour la vérification de cours === */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-verify {
    background: linear-gradient(135deg, #C24F00 0%, #0131B8 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: var(--cursor-pointer);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(194, 79, 0, 0.3);
    font-size: 0.95rem;
}

.btn-verify:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(194, 79, 0, 0.4);
}

.btn-verify:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-format-ai {
    background: linear-gradient(135deg, #057ED1 0%, #003084 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: var(--cursor-pointer);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(5, 126, 209, 0.3);
    font-size: 0.85rem;
    margin-left: 10px;
    float: right;
}

.btn-format-ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(5, 126, 209, 0.4);
}

.btn-format-ai:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
    box-shadow: none;
}

.verification-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.badge-verification {
    background: #057ED1;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.btn-view-verification {
    background: #22C55E;
    color: white;
    padding: 4px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.85rem;
    cursor: var(--cursor-pointer);
    transition: background 0.3s;
}

.btn-view-verification:hover {
    background: #16a34a;
}

/* ========================================
   COURSE VIEWER STYLES
   ======================================== */

.course-viewer {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.course-header {
    margin-bottom: 30px;
}

.course-header h1 {
    color: var(--text-primary);
    font-size: 28px;
    line-height: 1.3;
    margin: 20px 0 0 0;
    font-weight: 600;
}

.breadcrumb {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 14px;
}

[data-theme="dark"] .breadcrumb {
    color: var(--text-secondary);
}

.breadcrumb a {
    color: #C24F00;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #C24F00, #0131B8);
    transition: width 0.3s ease;
}

.section-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.section-media {
    margin-bottom: 30px;
    text-align: center;
}

.section-media img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.section-media video {
    max-width: 100%;
    border-radius: 8px;
}

.section-text {
    line-height: 1.8;
    font-size: 16px;
    margin-bottom: 30px;
    color: var(--text-primary);
}

/* Code blocks inside course sections */
.section-text pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 16px 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 16px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2);
    white-space: pre-wrap;
    word-break: break-word;
}
[data-theme="dark"] .section-text pre {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.06);
}

.section-text pre code {
    background: none;
    padding: 0;
    border: none;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}

.section-text code {
    background: var(--bg-secondary);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.88em;
    border: 1px solid var(--border-color);
}

/* Detailed explanation code blocks */
.detailed-explanation pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 16px 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 12px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: pre-wrap;
    word-break: break-word;
}
[data-theme="dark"] .detailed-explanation pre {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.06);
}

.detailed-explanation pre code {
    background: none;
    padding: 0;
    border: none;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}

.detailed-explanation code {
    background: var(--bg-secondary);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.88em;
    border: 1px solid var(--border-color);
}

.section-actions {
    display: flex;
    gap: 15px;
    margin: 30px 0;
    justify-content: flex-start;
}

.btn-detail, .btn-chat {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: var(--cursor-pointer);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-detail {
    background: #22C55E;
    color: white;
}

.btn-detail:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.btn-chat {
    background: #C24F00;
    color: white;
}

.btn-chat:hover {
    background: #0131B8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(194, 79, 0, 0.3);
}

.btn-ai-locked {
    background: #737373 !important;
    opacity: 0.85;
    position: relative;
}
.btn-ai-locked:hover {
    background: #737373 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(115, 115, 115, 0.3);
}

.detailed-explanation {
    background: #d1fae5;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #22C55E;
    margin: 20px 0;
}

[data-theme="dark"] .detailed-explanation {
    background: #1a2418;
    border-left-color: #22C55E;
}

.detailed-explanation h3 {
    color: #22C55E;
    margin-bottom: 15px;
    font-size: 20px;
}

[data-theme="dark"] .detailed-explanation h3 {
    color: #22C55E;
}

.detail-content {
    line-height: 1.8;
    color: var(--text-primary);
}

.detail-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 16px 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 12px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: pre-wrap;
    word-break: break-word;
}
[data-theme="dark"] .detail-content pre {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.06);
}
.detail-content pre code {
    background: none;
    padding: 0;
    border: none;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}
.detail-content code {
    background: var(--bg-secondary);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.88em;
    border: 1px solid var(--border-color);
}

/* ========================================
   CHAT / ASSISTANT IA STYLES
   ======================================== */

.chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
    z-index: 1000;
}

.chat-container {
    pointer-events: auto;
    background: var(--bg-card);
    width: 450px;
    height: 70vh;
    max-height: 90vh;
    min-height: 250px;
    min-width: 300px;
    max-width: 95vw;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    position: fixed;
    top: 80px;
    right: 40px;
    overflow: hidden;
    z-index: 1001;
}

.chat-container.dragging {
    box-shadow: 0 16px 60px rgba(0,0,0,0.45);
    user-select: none;
    transition: none !important;
}

.chat-container.resizing {
    user-select: none;
    transition: none !important;
}

/* Resize handle (bottom-right corner) */
.chat-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    z-index: 10;
    background: transparent;
}
.chat-resize-handle::before {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--text-secondary, #999);
    border-bottom: 2px solid var(--text-secondary, #999);
    opacity: 0.5;
    transition: opacity 0.2s;
}
.chat-resize-handle:hover::before {
    opacity: 1;
}

.chat-container.fullscreen {
    width: 95vw !important;
    height: 95vh !important;
    max-height: 95vh !important;
    min-height: 500px;
    top: 2.5vh !important;
    left: 2.5vw !important;
    right: auto !important;
    transform: none !important;
}

/* Dark chat-container handled by glassmorphism block */

.chat-header {
    background: #C24F00;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    cursor: grab;
    border-radius: 12px 12px 0 0;
    user-select: none;
}

.chat-header:active {
    cursor: grabbing;
}

.chat-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-fullscreen, .btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: var(--cursor-pointer);
    padding: 5px;
    line-height: 1;
    transition: all 0.2s ease;
}

.btn-fullscreen:hover, .btn-close:hover {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.btn-close {
    font-size: 30px;
    line-height: 1;
}

.chat-messages {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
    height: 0;
    scrollbar-width: thin;
    scrollbar-color: #C24F00 var(--bg-tertiary);
    -webkit-overflow-scrolling: touch;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #C24F00;
    border-radius: 4px;
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb {
    background: #003084;
}

.chat-message {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chat-message.user {
    background: #C24F00;
    color: white;
    margin-left: auto;
}

.chat-message.bot {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .chat-message.bot {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.chat-message.loading {
    opacity: 0.6;
}

/* ── Markdown rendered content in chat ── */
.chat-message.bot.md-content p {
    margin: 0 0 8px 0;
    line-height: 1.6;
}
.chat-message.bot.md-content p:last-child { margin-bottom: 0; }

.chat-message.bot.md-content .md-h {
    font-weight: 700;
    margin: 12px 0 6px 0;
    line-height: 1.3;
}
.chat-message.bot.md-content h1.md-h { font-size: 1.15em; }
.chat-message.bot.md-content h2.md-h { font-size: 1.08em; }
.chat-message.bot.md-content h3.md-h { font-size: 1.02em; }
.chat-message.bot.md-content h4.md-h { font-size: 0.95em; }
.chat-message.bot.md-content .md-h:first-child { margin-top: 0; }

.chat-message.bot.md-content .md-list {
    margin: 6px 0;
    padding-left: 20px;
}
.chat-message.bot.md-content .md-list li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.chat-message.bot.md-content .md-inline-code {
    background: var(--bg-secondary);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.88em;
    border: 1px solid var(--border-color);
}

.chat-message.bot.md-content .md-code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 8px 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85em;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
[data-theme="dark"] .chat-message.bot.md-content .md-code-block {
    background: rgba(0, 0, 0, 0.3);
}

.chat-message.bot.md-content .md-hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 10px 0;
}

.chat-message.bot.md-content strong {
    font-weight: 600;
}

.chat-message.bot.md-content em {
    font-style: italic;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

#chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: none;
    font-family: inherit;
}

[data-theme="dark"] #chat-input {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-send {
    padding: 10px 20px;
    background: #C24F00;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: var(--cursor-pointer);
    font-weight: 600;
}

.btn-send:hover {
    background: #0131B8;
}

.section-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.btn-nav {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: var(--cursor-pointer);
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-prev {
    background: #525252;
    color: white;
}

.btn-next, .btn-finish {
    background: #C24F00;
    color: white;
}

.btn-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ========================================
   COURSE VIEWER - RESPONSIVE MOBILE
   ======================================== */

@media (max-width: 768px) {
    .course-viewer {
        padding: 10px;
    }

    .course-header h1 {
        font-size: 22px;
    }

    .breadcrumb {
        font-size: 12px;
        word-break: break-word;
    }

    .section-content {
        padding: 15px;
        margin-bottom: 15px;
    }

    .section-text {
        font-size: 15px;
        line-height: 1.6;
    }

    .section-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-detail, .btn-chat {
        width: 100%;
        padding: 12px 20px;
    }

    .detailed-explanation {
        padding: 15px;
    }

    .detailed-explanation h3 {
        font-size: 18px;
    }

    .section-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .btn-nav {
        width: 100%;
        padding: 12px 20px;
    }

    .chat-modal {
        padding: 0;
        align-items: stretch;
        justify-content: center;
        overflow: hidden;
    }

    .chat-container {
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        min-height: unset !important;
        min-width: unset !important;
        margin: 0;
        border-radius: 0;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        overflow: hidden;
    }

    .chat-container.fullscreen {
        width: 100%;
        height: 100vh;
        transform: none;
        top: 0;
        left: 0;
    }

    .chat-resize-handle {
        display: none;
    }
    
    .chat-messages {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto !important;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch !important;
        padding: 15px;
    }
    
    .chat-message {
        max-width: 90%;
        font-size: 14px;
        flex-shrink: 0;
    }

    .chat-input-container {
        flex-shrink: 0;
    }

    .chat-input-container textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn-fullscreen {
        display: none;
    }

    .chat-header {
        padding: 12px 15px;
        flex-shrink: 0;
        cursor: default;
        border-radius: 0;
    }

    .chat-header h3 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .course-header h1 {
        font-size: 18px;
    }

    .breadcrumb {
        font-size: 11px;
    }

    .section-content {
        padding: 12px;
    }

    .section-text {
        font-size: 14px;
    }

    .btn-detail, .btn-chat {
        padding: 10px 15px;
        font-size: 13px;
    }

    .btn-nav {
        padding: 10px 15px;
        font-size: 13px;
    }

    .detailed-explanation {
        padding: 12px;
    }

    .detailed-explanation h3 {
        font-size: 16px;
    }

    .chat-container {
        height: 100vh;
    }
    
    .chat-messages {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 12px;
    }
    
    .chat-message {
        padding: 10px 12px;
        max-width: 95%;
        font-size: 13px;
        flex-shrink: 0;
    }

    .chat-header h3 {
        font-size: 14px;
    }

    .btn-close {
        font-size: 26px;
    }
    
    #chat-input {
        font-size: 16px; /* Évite le zoom sur iOS */
    }
}

/* Landscape mode */
@media (max-height: 600px) and (orientation: landscape) {
    .chat-container {
        height: 100vh;
    }

    .chat-messages {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .chat-header {
        padding: 8px 15px;
    }

    .chat-input-container {
        padding: 8px;
    }

    #chat-input {
        min-height: 40px;
    }
}

/* ========================
   NOUVEAUX COMPOSANTS v2
   ======================== */

/* Carte générique */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* Badge générique */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

/* Hero section (alias) */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0131B8 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

/* Dark hero handled by glassmorphism block */

/* Course grid (alias singulier) */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
}

/* Role selection cards (registration) */
.role-option {
    flex: 1;
    min-width: 140px;
}

.role-option input[type="radio"] {
    display: none;
}

.role-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    cursor: var(--cursor-pointer);
    transition: var(--transition);
}

.role-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.role-option input[type="radio"]:checked + .role-card {
    border-color: var(--primary-color);
    background: rgba(194, 79, 0, 0.05);
    box-shadow: 0 0 0 3px rgba(194, 79, 0, 0.15);
}

/* Settings page */
.settings-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Subscription cards */
.subscription-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.subscription-card.active {
    border-color: var(--success-color);
    background: rgba(34, 197, 94, 0.05);
}

/* Professor profile page */
.profile-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0131B8 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

/* Dark profile-header handled by glassmorphism block */

/* Code display (invitation codes) */
.code-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: var(--bg-tertiary);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    border: 1px dashed var(--border-color);
    color: var(--primary-color);
    user-select: all;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-tertiary);
}

.empty-state .emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* Table styling for dashboards */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background: var(--bg-secondary);
}

/* Members list (entity) */
.member-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    background: var(--bg-card);
    transition: var(--transition);
}

.member-card:hover {
    box-shadow: var(--shadow-sm);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Block card */
.block-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
}

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

/* Mobile responsiveness for new components */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .settings-section {
        padding: 1.25rem;
    }

    .member-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }

    .profile-header {
        padding: 1.5rem;
    }
}

/* ========================================
   COURSE RATING SECTION
   ======================================== */
.course-rating-section {
    margin-top: 30px;
    padding: 25px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.course-rating-section h3 {
    margin: 0 0 15px;
    font-size: 1.15rem;
}
.rating-info {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.rating-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Star rating input (reverse order trick) */
.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}
.star-rating-input input { display: none; }
.star-rating-input label {
    font-size: 2rem;
    color: var(--border-color);
    cursor: var(--cursor-pointer);
    transition: color 0.15s, transform 0.15s;
    line-height: 1;
}
.star-rating-input label::before { content: "★"; }
.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
    color: #f5a623;
    transform: scale(1.15);
}
.rating-comment {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    background: var(--bg-secondary, #f9f9f9);
    color: var(--text-primary);
}
.rating-comment:focus {
    outline: none;
    border-color: #C24F00;
    box-shadow: 0 0 0 3px rgba(194, 79, 0, 0.15);
}

[data-theme="dark"] .rating-comment {
    background: rgba(23, 23, 23, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ========================================
   COURSE MESSAGING BUTTON
   ======================================== */
.course-messaging-section {
    margin-top: 15px;
    text-align: center;
}
.btn-chat-prof {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #C24F00, #0131B8);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: var(--cursor-pointer);
    transition: all 0.2s ease;
}
.btn-chat-prof:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(194, 79, 0, 0.4);
    color: white;
}

/* ========================================
   GLASSMORPHISM
   Cards get semi-transparent bg + backdrop-filter
   so the cyber background canvas shines through.
   --bg-card is used for card backgrounds (semi-transparent)
   --bg-primary/secondary/tertiary stay solid for inputs, text, etc.
   ======================================== */

/* All glass-card elements: backdrop blur */
.card,
.course-card,
.stat-card,
.feature-card,
.topic-card,
.auth-card,
.course-header-full,
.content-card,
.exercise-card,
.exercises-summary,
.settings-section,
.role-card,
.block-card,
.member-card,
.subscription-card,
.course-rating-section,
.section-content {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Dark mode: glass card backgrounds */
[data-theme="dark"] .card,
[data-theme="dark"] .course-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .topic-card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .course-header-full,
[data-theme="dark"] .content-card,
[data-theme="dark"] .exercise-card,
[data-theme="dark"] .exercises-summary,
[data-theme="dark"] .settings-section,
[data-theme="dark"] .role-card,
[data-theme="dark"] .block-card,
[data-theme="dark"] .member-card,
[data-theme="dark"] .subscription-card,
[data-theme="dark"] .course-rating-section,
[data-theme="dark"] .section-content {
    background: var(--bg-card) !important;
    border-color: var(--glass-border);
}

/* Stronger blur for overlays */
.chat-container {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

[data-theme="dark"] .notification-dropdown {
    background-color: #1a1a1a !important;
    border-color: var(--border-color);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

[data-theme="dark"] .chat-container {
    background: rgba(23, 23, 23, 0.8) !important;
    border-color: var(--glass-border);
}

/* Dark mode gradient overrides */
[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, rgba(23, 23, 23, 0.7) 0%, rgba(10, 10, 10, 0.7) 100%) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

[data-theme="dark"] .profile-header {
    background: linear-gradient(135deg, rgba(23, 23, 23, 0.7) 0%, rgba(10, 10, 10, 0.7) 100%) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* Form inputs: solid bg in dark mode */
[data-theme="dark"] .form-control,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 134, 48, 0.2);
}
