/**
 * LINKVEST - Styles CSS
 * Mobile-first Design
 */

/* ===========================================
   VARIABLES CSS
   =========================================== */
:root {
    /* Couleurs principales */
    --primary: #00B04F;
    --primary-dark: #006B3C;
    --primary-light: #e8f5e9;
    --secondary: #FFD700;
    --secondary-dark: #FFA000;
    
    /* Couleurs de texte */
    --text-dark: #333333;
    --text-medium: #666666;
    --text-light: #999999;
    
    /* Couleurs de fond */
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-gray: #E9ECEF;
    
    /* Couleurs d'état */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    /* Bordures */
    --border-color: #E0E0E0;
    --border-radius: 10px;
    --border-radius-lg: 20px;
    --border-radius-full: 50px;
    
    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition: all 0.3s ease;
    
    /* Espacement */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
    
    /* Typographie */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
}

/* ===========================================
   RESET & BASE
   =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===========================================
   TEXT & CONTENT UTILITIES
   =========================================== */

/* Empêcher le débordement de texte */
p, span, div, h1, h2, h3, h4, h5, h6, li, td, th, label {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Contenus textuels longs */
.text-content,
.description-content,
.risks-content,
.bio-content,
.summary-content,
.article-content,
.course-description,
.mentor-bio,
.project-description,
.project-summary,
.comment-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.8;
    max-width: 100%;
}

/* Préserver les sauts de ligne */
.preserve-lines {
    white-space: pre-line;
}

/* Conteneur de texte avec scroll si nécessaire */
.text-scrollable {
    max-height: 400px;
    overflow-y: auto;
    padding-right: var(--spacing-sm);
}

/* ===========================================
   VIDEO & MEDIA CONTAINERS
   =========================================== */

/* Conteneur vidéo responsive (16:9) */
.video-container,
.video-embed-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: var(--border-radius-lg);
}

.video-container iframe,
.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Vidéo locale HTML5 */
.local-video-player,
video {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    background: #000;
    border-radius: var(--border-radius-lg);
    display: block;
}

/* Image responsive avec ratio */
.image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===========================================
   CARD & BOX CONTENT
   =========================================== */

/* Empêcher le débordement dans les cartes */
.card,
.box,
.panel,
.widget {
    overflow: hidden;
    max-width: 100%;
}

.card-body,
.box-body {
    overflow: hidden;
    word-wrap: break-word;
}

/* ===========================================
   GRID & LAYOUT FIXES
   =========================================== */

/* Grilles responsives sûres */
.grid {
    display: grid;
    gap: var(--spacing-lg);
    max-width: 100%;
}

.grid > * {
    min-width: 0; /* Permet aux enfants de la grille de rétrécir */
    max-width: 100%;
}

/* Flexbox safe */
.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.flex-container > * {
    min-width: 0;
    max-width: 100%;
}

/* ===========================================
   NAVBAR
   =========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: var(--spacing-md);
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: bold;
    font-size: var(--font-size-xl);
    color: var(--primary);
    flex-shrink: 0;
    white-space: nowrap;
}

.logo-icon {
    font-size: 1.5em;
}

.navbar-menu {
    display: none;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: nowrap;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    transition: var(--transition);
    white-space: nowrap;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-link-icon {
    position: relative;
    padding: var(--spacing-xs) var(--spacing-sm);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-full);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.user-dropdown-toggle:hover {
    border-color: var(--primary);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-name {
    font-weight: 500;
    display: none;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-level {
    font-size: var(--font-size-sm);
    display: none;
}

.dropdown-arrow {
    font-size: 0.7em;
    transition: var(--transition);
}

.user-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 100;
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-header strong {
    display: block;
    margin-bottom: 2px;
}

.dropdown-header small {
    color: var(--text-light);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--spacing-xs) 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-dark);
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.dropdown-item-danger:hover {
    background: #fee;
    color: var(--danger);
}

/* Navbar Toggle (Mobile) */
.navbar-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: var(--spacing-sm);
    background: transparent;
    border: none;
    cursor: pointer;
}

.navbar-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

.navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Navbar Mobile */
.navbar-mobile {
    display: none;
    flex-direction: column;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-md);
}

.navbar-mobile.active {
    display: flex;
}

/* Menu mobile - Boutons auth */
.mobile-auth-buttons {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.mobile-auth-buttons .btn {
    flex: 1;
    text-align: center;
    padding: var(--spacing-sm) var(--spacing-md);
}

/* Menu mobile - Sections et dividers */
.mobile-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--spacing-sm) 0;
}

.mobile-menu-section {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--spacing-xs) var(--spacing-md);
    margin-top: var(--spacing-xs);
}

.nav-link-mobile {
    padding: var(--spacing-md);
    color: var(--text-dark);
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-link-mobile:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-link-danger {
    color: var(--danger);
}

.nav-link-danger:hover {
    background: #fee2e2;
    color: var(--danger);
}

.nav-link-warning {
    color: #b45309;
}

.nav-link-warning:hover {
    background: #fef3c7;
    color: #b45309;
}

.nav-link-admin {
    color: var(--primary);
    font-weight: 500;
}

.nav-link-trainer {
    color: #7c3aed;
    font-weight: 500;
}

.nav-link-trainer:hover {
    background: #ede9fe;
    color: #7c3aed;
}

/* ===========================================
   MAIN CONTENT
   =========================================== */
.main-content {
    padding-top: 90px;
    min-height: calc(100vh - 300px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.container-sm {
    max-width: 600px;
}

.container-md {
    max-width: 800px;
}

/* ===========================================
   BUTTONS
   =========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 12px 24px;
    font-size: var(--font-size-base);
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-full);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 176, 79, 0.3);
    color: white;
}

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

.btn-secondary:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

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

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 8px 16px;
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: 16px 32px;
    font-size: var(--font-size-lg);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===========================================
   FORMS
   =========================================== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-dark);
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--font-size-base);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    background: var(--bg-white);
}

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

.form-control.error {
    border-color: var(--danger);
}

.form-hint {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    margin-top: var(--spacing-xs);
}

.form-error {
    font-size: var(--font-size-sm);
    color: var(--danger);
    margin-top: var(--spacing-xs);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* File Upload */
.upload-area {
    border: 2px dashed var(--primary);
    border-radius: var(--border-radius);
    padding: var(--spacing-xl);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-white);
}

.upload-area:hover {
    background: var(--primary-light);
}

.upload-area.dragover {
    background: var(--primary-light);
    border-style: solid;
}

.upload-area-icon {
    font-size: 3em;
    margin-bottom: var(--spacing-md);
}

.upload-area p {
    color: var(--text-medium);
    margin-bottom: var(--spacing-sm);
}

.upload-area small {
    color: var(--text-light);
}

.upload-preview {
    margin-top: var(--spacing-md);
}

.upload-preview img {
    max-width: 200px;
    border-radius: var(--border-radius);
}

.upload-preview-info {
    background: var(--success-light, #d1fae5);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-top: var(--spacing-sm);
}

.upload-preview-info p {
    color: var(--success, #059669);
    font-weight: 600;
    margin-bottom: 4px;
}

.upload-preview-info small {
    color: var(--text-medium);
}

/* ===========================================
   CARDS
   =========================================== */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: var(--spacing-xl);
    transition: var(--transition);
}

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

.card-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: bold;
    color: var(--text-dark);
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    margin-top: var(--spacing-xs);
}

/* ===========================================
   BADGES
   =========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    font-size: 0.75em;
    font-weight: bold;
    border-radius: var(--border-radius-full);
    background: var(--primary);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: var(--text-dark);
}

.badge-danger {
    background: var(--danger);
}

.badge-success {
    background: var(--success);
}

.badge-info {
    background: var(--info);
}

/* ===========================================
   PROGRESS BAR
   =========================================== */
.progress-bar {
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    height: 10px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    height: 100%;
    border-radius: var(--border-radius);
    transition: width 0.5s ease;
}

/* ===========================================
   FLASH MESSAGES
   =========================================== */
.flash-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    z-index: 1001;
    animation: slideDown 0.3s ease;
    box-shadow: var(--shadow-lg);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.flash-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.flash-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.flash-close {
    background: transparent;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    opacity: 0.5;
}

.flash-close:hover {
    opacity: 1;
}

/* ===========================================
   AUTH PAGES
   =========================================== */
.auth-container {
    max-width: 450px;
    margin: var(--spacing-xl) auto;
    padding: var(--spacing-lg);
}

.auth-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-header h1 {
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
}

.auth-header p {
    color: var(--text-medium);
}

.auth-tabs {
    display: flex;
    margin-bottom: var(--spacing-xl);
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: var(--spacing-md);
    text-align: center;
    font-weight: 600;
    color: var(--text-light);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.auth-tab:hover {
    color: var(--primary);
}

.auth-tab.active {
    color: var(--primary);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-divider {
    text-align: center;
    margin: var(--spacing-lg) 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    background: var(--bg-white);
    padding: 0 var(--spacing-md);
    color: var(--text-light);
    position: relative;
}

.auth-footer {
    text-align: center;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* Social Login */
.social-login {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-white);
    cursor: pointer;
    transition: var(--transition);
}

.social-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Role Selection */
.role-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

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

.role-option:hover {
    border-color: var(--primary);
}

.role-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.role-option input {
    display: none;
}

.role-icon {
    font-size: 2em;
    margin-right: var(--spacing-md);
}

.role-info h4 {
    margin-bottom: var(--spacing-xs);
}

.role-info p {
    font-size: var(--font-size-sm);
    color: var(--text-medium);
}

/* ===========================================
   KYC PAGE
   =========================================== */
.kyc-status-card {
    text-align: center;
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
}

.kyc-status-icon {
    font-size: 4em;
    margin-bottom: var(--spacing-md);
}

.kyc-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.kyc-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: var(--border-color);
}

.kyc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.kyc-step-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray);
    border-radius: 50%;
    font-weight: bold;
    margin-bottom: var(--spacing-sm);
}

.kyc-step.active .kyc-step-number {
    background: var(--primary);
    color: white;
}

.kyc-step.completed .kyc-step-number {
    background: var(--success);
    color: white;
}

.kyc-step-label {
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

.kyc-step.active .kyc-step-label,
.kyc-step.completed .kyc-step-label {
    color: var(--text-dark);
}

/* ===========================================
   STARS / LEVELS
   =========================================== */
.stars {
    color: var(--secondary);
    font-size: 1.2em;
    letter-spacing: 2px;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-sm);
    font-weight: bold;
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5em;
    color: white;
}

.score-excellent { background: var(--success); }
.score-good { background: var(--warning); color: var(--text-dark); }
.score-average { background: #fd7e14; }
.score-poor { background: var(--danger); }

/* ===========================================
   FOOTER
   =========================================== */
.footer {
    background: var(--text-dark);
    color: white;
    margin-top: var(--spacing-xl);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-title {
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.footer-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-social {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 1.2em;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
}

.footer-bottom {
    padding-top: var(--spacing-lg);
}

.footer-bottom-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--font-size-sm);
}

.footer-bottom-links {
    display: flex;
    gap: var(--spacing-lg);
}

.footer-bottom-links a {
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--font-size-sm);
}

.footer-bottom-links a:hover {
    color: white;
}

/* ===========================================
   UTILITIES
   =========================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-light); }

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

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

.w-100 { width: 100%; }

/* ===========================================
   RESPONSIVE
   =========================================== */

/* Tablette - Menu simplifié */
@media (min-width: 992px) {
    .navbar-menu {
        display: flex;
    }
    
    .navbar-toggle {
        display: none;
    }
    
    .user-name,
    .user-level {
        display: block;
    }
    
    .footer-bottom-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Grand écran - Plus d'espace */
@media (min-width: 1200px) {
    .navbar-container {
        max-width: 1400px;
        padding: 0 var(--spacing-lg);
    }
    
    .navbar-menu {
        gap: var(--spacing-md);
    }
    
    .nav-link {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.95rem;
    }
}

/* Très grand écran */
@media (min-width: 1400px) {
    .navbar-container {
        max-width: 1600px;
    }
    
    .navbar-menu {
        gap: var(--spacing-lg);
    }
    
    .nav-link {
        font-size: 1rem;
    }
}

@media (min-width: 992px) {
    .auth-container {
        max-width: 500px;
    }
}

/* ===========================================
   ANIMATIONS
   =========================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

.pulse {
    animation: pulse 2s infinite;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-gray);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ===========================================
   GLOBAL RESPONSIVE FIXES
   =========================================== */

/* Container responsive */
.container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Grilles responsives */
@media (max-width: 992px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    /* Réduire le padding sur mobile */
    .container {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }
    
    /* Cartes plus compactes */
    .card {
        padding: var(--spacing-md);
    }
    
    /* Texte plus petit sur mobile */
    body {
        font-size: 0.95rem;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
}

/* ===========================================
   CONTENT OVERFLOW FIXES
   =========================================== */

/* Tables responsives */
table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

/* Préformatés et code */
pre, code {
    max-width: 100%;
    overflow-x: auto;
    word-wrap: break-word;
}

/* Iframes et embeds */
iframe {
    max-width: 100%;
}

/* Images dans les contenus */
.content img,
.description img,
.article-content img,
.lesson-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: var(--spacing-md) 0;
}

/* Vidéos */
video {
    max-width: 100%;
    height: auto;
}

/* Long URLs et textes sans espaces */
.break-all {
    word-break: break-all;
}

.break-word {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ===========================================
   FORM IMPROVEMENTS
   =========================================== */

/* Textareas */
textarea {
    resize: vertical;
    min-height: 80px;
    word-wrap: break-word;
}

/* Inputs longs */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="search"] {
    max-width: 100%;
}

/* ===========================================
   NAVBAR MOBILE IMPROVEMENTS
   =========================================== */

/* Boutons authentification avec icônes */
.btn-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-auth .auth-icon {
    font-size: 1.1em;
}

.btn-auth .auth-text {
    display: inline;
}

/* Mobile: afficher seulement les icônes */
@media (max-width: 768px) {
    .navbar-container {
        height: 60px;
        padding: 0 var(--spacing-sm);
    }
    
    .navbar-logo {
        font-size: 1.1rem;
    }
    
    .logo-icon {
        font-size: 1.3em;
    }
    
    .logo-text {
        display: none;
    }
    
    .navbar-actions {
        gap: 8px;
    }
    
    /* Boutons auth: icônes uniquement sur mobile */
    .btn-auth {
        padding: 10px 12px;
        min-width: 44px;
        min-height: 44px;
        border-radius: 50%;
    }
    
    .btn-auth .auth-text {
        display: none;
    }
    
    .btn-auth .auth-icon {
        font-size: 1.2em;
    }
    
    /* User dropdown compact */
    .user-dropdown-toggle {
        padding: 6px 10px;
    }
    
    .user-avatar-small {
        width: 28px;
        height: 28px;
    }
    
    .dropdown-arrow {
        display: none;
    }
    
    /* Menu mobile amélioré */
    .navbar-mobile {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        padding: var(--spacing-sm);
    }
    
    .nav-link-mobile {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.95rem;
        border-radius: 8px;
        margin-bottom: 2px;
    }
    
    /* Main content avec navbar plus petite */
    .main-content {
        padding-top: 75px;
    }
}

/* Très petit mobile */
@media (max-width: 380px) {
    .navbar-container {
        padding: 0 8px;
    }
    
    .btn-auth {
        padding: 8px 10px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .navbar-toggle {
        padding: 8px;
    }
    
    .navbar-toggle span {
        width: 20px;
    }
}

/* Tablette: afficher texte court */
@media (min-width: 769px) and (max-width: 991px) {
    .btn-auth .auth-text {
        display: inline;
    }
    
    .btn-auth {
        border-radius: var(--border-radius);
        padding: 8px 14px;
    }
    
    .logo-text {
        display: inline;
    }
}

/* Desktop: tout afficher */
@media (min-width: 992px) {
    .btn-auth {
        padding: 10px 20px;
    }
    
    .btn-auth .auth-text {
        display: inline;
    }
    
    .btn-auth .auth-icon {
        display: none;
    }
}

/* ===========================================
   ACCESSIBILITY & PRINT
   =========================================== */

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}
