/**
 * L'Ora Pilates Studio - Custom Styles
 * Design System: Terracotta/Warm Brown, Mobile-First
 */

/* ============================================
   CSS VARIABLES - Design Tokens
   ============================================ */
:root {
    /* Brand Colors - L'Ora Pilates */
    --primary-brown: #8B5A3C;
    --primary-brown-light: #A67B5B;
    --primary-brown-dark: #6D4830;
    --secondary-cream: #F5E6D3;
    --secondary-beige: #E8D5C4;
    
    /* Keep purple as accent */
    --primary-purple: #9333ea;
    --primary-purple-light: #a855f7;
    --primary-purple-dark: #7e22ce;
    --secondary-pink: #ec4899;
    --secondary-pink-light: #f472b6;
    
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f97316;
    --warning-light: #fb923c;
    --danger: #ef4444;
    --danger-light: #f87171;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-brown) 0%, var(--primary-brown-light) 100%);
    --gradient-purple: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
    --gradient-pink: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    --gradient-background: linear-gradient(180deg, #fef7f0 0%, #fdf2e9 50%, #fef9f6 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-purple: 0 10px 40px -10px rgba(147, 51, 234, 0.4);
    
    /* Spacing */
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --bottom-nav-height: 70px;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--gradient-background);
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--gray-800);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   LAYOUT
   ============================================ */
.app-container {
    max-width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 20px);
}

.view {
    display: none;
    padding: 20px 16px;
    animation: fadeIn var(--transition-normal) ease-out;
}

.view.active {
    display: block;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: linear-gradient(135deg, #8B5A3C 0%, #A67B5B 50%, #C4956A 100%);
    padding: 16px 16px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(139, 90, 60, 0.2);
}

/* Spacer to compensate fixed header height */
.header-spacer {
    height: calc(72px + env(safe-area-inset-top, 0px));
}

.header-with-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.header-content {
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.header p {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:active {
    transform: scale(0.98);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary-purple);
}

/* ============================================
   STAT CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card.stat-orange::before {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.stat-card.stat-blue::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.stat-card.stat-green::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.stat-card.stat-purple::before {
    background: linear-gradient(90deg, #9333ea, #a855f7);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.stat-orange .stat-icon {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(251, 146, 60, 0.15));
    color: var(--warning);
}

.stat-blue .stat-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(96, 165, 250, 0.15));
    color: #3b82f6;
}

.stat-green .stat-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.15));
    color: var(--success);
}

.stat-purple .stat-icon {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(168, 85, 247, 0.15));
    color: var(--primary-purple);
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 44px;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-brown) 0%, var(--primary-brown-light) 100%);
    color: white;
    box-shadow: 0 10px 40px -10px rgba(139, 90, 60, 0.4);
}

.btn-primary:hover {
    opacity: 0.9;
}

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

.btn-secondary:hover {
    background: rgba(139, 90, 60, 0.05);
}

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

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

.btn-sm {
    padding: 8px 16px;
    font-size: 0.75rem;
    min-height: 36px;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--bottom-nav-height);
    padding-bottom: var(--safe-area-bottom);
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: var(--gray-400);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    background: none;
    min-width: 60px;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    transition: transform var(--transition-fast);
}

.nav-item span {
    font-size: 0.625rem;
    font-weight: 500;
}

.nav-item.active {
    color: var(--primary-brown);
}

.nav-item.active svg {
    transform: scale(1.1);
}

/* ============================================
   COURSE CARDS
   ============================================ */
.course-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    border-left: 4px solid var(--primary-purple);
    transition: all var(--transition-fast);
}

.course-card:active {
    transform: scale(0.98);
}

.course-card.reformer {
    border-left-color: #8b5cf6;
}

.course-card.pilates {
    border-left-color: var(--secondary-pink);
}

.course-card.tonicflow {
    border-left-color: var(--success);
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.course-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.course-instructor {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.course-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-purple);
}

.course-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.course-detail {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.course-detail svg {
    width: 14px;
    height: 14px;
    color: var(--gray-400);
}

.course-actions {
    display: flex;
    gap: 8px;
}

.course-spots {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 500;
}

.course-spots.available {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.course-spots.limited {
    background: rgba(249, 115, 22, 0.1);
    color: var(--warning);
}

.course-spots.full {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ============================================
   BADGES
   ============================================ */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 400px) {
    .badges-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 8px;
    border-radius: 12px;
    background: var(--gray-50);
    transition: all var(--transition-fast);
    position: relative;
}

.badge-item.unlocked {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(236, 72, 153, 0.1));
    box-shadow: 0 2px 8px rgba(147, 51, 234, 0.15);
}

.badge-item.locked {
    opacity: 0.6;
}

.badge-item.locked .badge-icon {
    filter: grayscale(0.8);
}

.badge-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.badge-name {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--gray-600);
    line-height: 1.2;
}

/* Barre de progression sur badge verrouillé */
.badge-progress {
    width: 100%;
    height: 3px;
    background: var(--gray-200);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.badge-progress-fill {
    height: 100%;
    background: var(--primary-purple);
    border-radius: 2px;
    transition: width 0.5s ease-out;
}

/* Badge Tooltip */
.badge-tooltip {
    position: fixed;
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.badge-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.badge-tooltip-content {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    min-width: 200px;
    max-width: 260px;
}

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

.badge-tooltip-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 12px;
    font-size: 1.5rem;
    filter: grayscale(0.8);
    transition: all 0.3s;
}

.badge-tooltip-icon.unlocked {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(236, 72, 153, 0.15));
    filter: none;
    animation: badgePop 0.4s ease-out;
}

@keyframes badgePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.badge-tooltip-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray-800);
}

.badge-tooltip-status {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 2px;
}

.badge-tooltip-status.unlocked {
    color: var(--success);
}

.badge-tooltip-status.locked {
    color: var(--gray-500);
}

.badge-tooltip-desc {
    font-size: 0.8rem;
    color: var(--gray-600);
    line-height: 1.4;
    margin-bottom: 12px;
}

.badge-tooltip-progress {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.badge-tooltip-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    animation: progressGrow 0.6s ease-out;
}

@keyframes progressGrow {
    from { width: 0; }
}

.badge-tooltip-hint {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-align: center;
    font-style: italic;
}

.badge-tooltip-congrats {
    font-size: 0.8rem;
    color: var(--primary-purple);
    text-align: center;
    font-weight: 600;
    animation: confetti 0.5s ease-out;
}

@keyframes confetti {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Légende - Comment ça marche */
.legend-card {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.legend-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.legend-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.legend-subtitle {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.legend-text {
    font-size: 0.8rem;
    color: var(--gray-600);
    line-height: 1.5;
    margin-bottom: 12px;
}

.legend-levels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.legend-level-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.legend-level-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1rem;
    color: white;
}

.legend-level-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-800);
}

.legend-level-req {
    display: block;
    font-size: 0.65rem;
    color: var(--gray-500);
}

.legend-badges-info {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.legend-badge-example {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.legend-badge-example .badge-item {
    width: 48px;
    padding: 8px 4px;
}

.legend-points-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.legend-points-list li {
    font-size: 0.8rem;
    color: var(--gray-600);
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.legend-points-list li::before {
    content: '•';
    position: absolute;
    left: 6px;
    color: var(--primary-purple);
    font-weight: bold;
}

.legend-points-list strong {
    color: var(--primary-purple);
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress-container {
    margin-bottom: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.progress-value {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width var(--transition-slow) ease-out;
}

/* ============================================
   LEVEL DISPLAY
   ============================================ */
.level-display {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.05), rgba(236, 72, 153, 0.05));
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: var(--gradient-primary);
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    box-shadow: var(--shadow-purple);
}

.level-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.level-subtitle {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

/* Level Steps - Progression visuelle */
.level-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.level-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.level-step.active {
    opacity: 1;
}

.level-step-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-200);
    border-radius: 50%;
    font-size: 1rem;
    transition: all 0.3s;
}

.level-step.active .level-step-icon {
    background: var(--primary-purple);
    color: white;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.level-step-name {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
}

/* ============================================
   CALENDAR (Weekly View)
   ============================================ */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin: -20px -16px 16px -16px;
    position: sticky;
    top: calc(72px + env(safe-area-inset-top, 0px));
    z-index: 50;
    background: rgba(254, 247, 240, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(139, 90, 60, 0.1);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.calendar-nav-btn:active {
    background: var(--gray-100);
}

.calendar-nav-btn svg {
    width: 20px;
    height: 20px;
    color: var(--gray-600);
}

.calendar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.day-section {
    margin-bottom: 20px;
}

.day-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.day-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
}

.day-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.day-badge {
    font-size: 0.625rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--gradient-primary);
    color: white;
    font-weight: 500;
}

.no-classes {
    text-align: center;
    padding: 24px;
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.status-badge.confirmed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.waitlist {
    background: rgba(249, 115, 22, 0.1);
    color: var(--warning);
}

.status-badge.cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Style spécial pour cours confirmé depuis liste d'attente */
.promoted-course {
    border-left: 4px solid var(--success) !important;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.05), transparent) !important;
}

.status-badge.promoted {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    animation: pulse 2s infinite;
}

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

/* Style pour cours terminé */
.course-card.finished {
    opacity: 0.6;
    border-left-color: var(--gray-400) !important;
}

.status-badge.finished {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* Style pour cours fermé */
.course-card.course-closed {
    border-left-color: #374151 !important;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.course-card.course-closed::before {
    content: '🔒';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    opacity: 0.6;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    left: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: white;
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown var(--transition-normal) ease-out;
    pointer-events: auto;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--primary-purple);
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast.info .toast-icon {
    color: var(--primary-purple);
}

.toast-message {
    font-size: 0.875rem;
    color: var(--gray-700);
    flex: 1;
}

.toast-close {
    width: 20px;
    height: 20px;
    cursor: pointer;
    color: var(--gray-400);
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--gray-600);
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 9998;
    animation: fadeIn var(--transition-fast) ease-out;
}

.modal {
    background: white;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp var(--transition-normal) ease-out;
    padding-bottom: var(--safe-area-bottom);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-200);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    color: var(--gray-600);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--gray-800);
    background: white;
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-purple);
}

.form-input::placeholder {
    color: var(--gray-400);
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, #fef7f0 0%, #fdf2e9 50%, #fef9f6 100%);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-img {
    width: 160px;
    height: 160px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(139, 90, 60, 0.15);
    animation: logoFloat 3s ease-in-out infinite;
}

.login-logo-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.login-logo-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: var(--shadow-purple);
}

.login-logo-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(139, 90, 60, 0.12);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 16px;
    display: none;
}

.login-error.show {
    display: block;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes grow {
    from {
        width: 0%;
    }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease-out;
}

.animate-slide-up {
    animation: slideUp var(--transition-normal) ease-out;
}

.animate-slide-down {
    animation: slideDown var(--transition-normal) ease-out;
}

.animate-scale-in {
    animation: scaleIn var(--transition-normal) ease-out;
}

.animate-bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-grow {
    animation: grow var(--transition-slow) ease-out;
}

/* Staggered animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* ============================================
   UTILITIES
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--gray-500);
}

.font-bold {
    font-weight: 700;
}

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

/* ============================================
   LOADING STATES
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-card {
    height: 120px;
    margin-bottom: 12px;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    color: var(--gray-300);
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ============================================
   CHARTS (Simple Bar Chart)
   ============================================ */
.chart-container {
    padding: 16px 0;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 120px;
    gap: 8px;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bar {
    width: 100%;
    background: var(--gradient-primary);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height var(--transition-slow) ease-out;
}

.bar-label {
    font-size: 0.625rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.bar-value {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* ============================================
   LANGUAGE SELECTOR IN PROFILE
   ============================================ */
.lang-btn-profile {
    padding: 10px 16px;
    border-radius: 12px;
    border: 2px solid var(--gray-200);
    background: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 90px;
    text-align: center;
}

.lang-btn-profile:hover {
    border-color: var(--primary-brown);
    background: var(--secondary-cream);
}

.lang-btn-profile.active {
    background: var(--primary-brown);
    color: white;
    border-color: var(--primary-brown);
}

/* RTL Support */
[dir="rtl"] .flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .text-right {
    text-align: left;
}

[dir="rtl"] .text-left {
    text-align: right;
}

[dir="rtl"] .ml-2 {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .mr-2 {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .course-card {
    border-left: none;
    border-right: 4px solid var(--primary-brown);
}

[dir="rtl"] .bottom-nav {
    direction: ltr;
}

/* ============================================
   CUSTOM CONFIRMATION MODAL
   ============================================ */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.confirm-modal-overlay.active {
    opacity: 1;
}
.confirm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.confirm-modal-card {
    position: relative;
    background: white;
    border-radius: 24px;
    padding: 32px 24px 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(139, 90, 60, 0.2);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.confirm-modal-overlay.active .confirm-modal-card {
    transform: scale(1) translateY(0);
}
.confirm-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef7f0, #fff5eb);
    border: 2px solid rgba(139, 90, 60, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.confirm-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}
.confirm-modal-message {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 24px;
}
.confirm-modal-actions {
    display: flex;
    gap: 10px;
}
.confirm-modal-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}
.confirm-modal-btn-cancel {
    background: #f3f4f6;
    color: #6b7280;
}
.confirm-modal-btn-cancel:active {
    background: #e5e7eb;
}
.confirm-modal-btn-confirm {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.confirm-modal-btn-confirm:active {
    transform: scale(0.96);
}
