/* ====================================
   🎨 THEME MODERNE - GRADIENTS BLEU/CYAN
   ====================================*/

:root {
    /* === PALETTE PRINCIPALE === */
    --primary-blue: #0066cc;
    --primary-cyan: #00d4ff;
    --deep-blue: #003d7a;
    --light-cyan: #7ae3ff;
    --dark-blue: #002952;

    /* === GRADIENTS === */
    --gradient-primary: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-cyan) 100%);
    --gradient-primary-soft: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-cyan) 100%);
    --gradient-primary-dark: linear-gradient(135deg, var(--dark-blue) 0%, var(--deep-blue) 100%);
    --gradient-primary-reverse: linear-gradient(135deg, var(--primary-cyan) 0%, var(--primary-blue) 100%);

    /* === COULEURS SECONDAIRES === */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --light: #f8fafc;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* === OMBRES === */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-gradient: 0 10px 40px rgba(0, 102, 204, 0.2);

    /* === RAYONS DE BORDURE === */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;

    /* === 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);

    /* === TYPOGRAPHIE === */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Fira Code', 'Cascadia Code', Consolas, monospace;

    /* === MOBILE TAB BAR === */
    --tab-bar-height: 70px;
    --tab-bar-bg: rgba(255, 255, 255, 0.95);
    --tab-bar-border: rgba(0, 102, 204, 0.1);
}

/* ====================================
   📱 BASE & RESET
   ====================================*/

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: var(--tab-bar-height);
    /* Espace pour mobile tab bar */
}

/* ====================================
   🎨 LAYOUT RESPONSIVE
   ====================================*/

.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container-fluid {
        padding: 0 2rem;
    }
}

/* ====================================
   📱 MOBILE TAB BAR
   ====================================*/

.mobile-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tab-bar-height);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 102, 204, 0.15);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 0.5rem 0;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.15);
    /* Dégradé subtil au top */
    background: linear-gradient(to top,
        rgba(255, 255, 255, 0.98) 70%,
        rgba(255, 255, 255, 0.95) 100%);
    animation: tabBarSlideUp 0.5s ease-out;
}

.mobile-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-500);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.75rem 0.5rem;
    border-radius: 16px;
    min-width: 4rem;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    transform: scale(1);
}

/* État actif avec animation fluide */
.mobile-tab-item.active {
    color: var(--primary-blue);
    background: linear-gradient(135deg,
            rgba(0, 102, 204, 0.15) 0%,
            rgba(0, 212, 255, 0.08) 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
}

/* Animation au hover */
.mobile-tab-item:hover:not(.active) {
    color: var(--primary-blue);
    background: rgba(0, 102, 204, 0.08);
    transform: translateY(-1px) scale(1.02);
}

/* Icônes avec animations */
.mobile-tab-item .tab-icon {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Animation spéciale pour l'icône active */
.mobile-tab-item.active .tab-icon {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: scale(1.1);
    /* Effet de pulse subtil */
    animation: iconPulse 2s ease-in-out infinite;
}

/* Labels avec typography améliorée */
.mobile-tab-item .tab-label {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    text-align: center;
    transition: all 0.3s ease;
}

.mobile-tab-item.active .tab-label {
    color: var(--primary-blue);
    font-weight: 700;
}

/* Masquer sur desktop */
@media (min-width: 768px) {
    .mobile-tab-bar {
        display: none;
    }

    body {
        padding-bottom: 0;
    }
}

/* ====================================
   🖥️ DESKTOP NAVIGATION
   ====================================*/

.desktop-navbar {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand:hover {
    color: var(--light-cyan) !important;
    transform: scale(1.05);
    transition: all var(--transition-fast);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--light-cyan);
    border-radius: 2px;
}

/* ====================================
   📋 CARTES MODERNES
   ====================================*/

.card {
    background: white;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all var(--transition-normal);
    overflow: hidden;
}

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

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

.card-gradient .card-title,
.card-gradient .card-text {
    color: white;
}

.card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 1.5rem;
}

/* Cartes statistiques */
.stat-card {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.stat-card .stat-icon {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    bottom: 1rem;
    right: 1rem;
}

/* ====================================
   🔘 BOUTONS MODERNES
   ====================================*/

.btn {
    font-weight: 500;
    border-radius: var(--radius);
    padding: 0.75rem 1.5rem;
    border: none;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--gradient-primary-reverse);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    color: white;
}

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

.btn-outline-primary:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

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

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

/* Effet de ripple sur les boutons */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width var(--transition-fast), height var(--transition-fast);
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* ====================================
   📝 FORMULAIRES MODERNES
   ====================================*/

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    position: relative;
    transition: all var(--transition-fast);
}

.form-control,
.form-select {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    background: white;
    position: relative;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.form-control.is-valid {
    border-color: var(--success);
    background-image: none;
}

.form-control.is-invalid {
    border-color: var(--danger);
    background-image: none;
}

.form-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-blue);
    transition: all var(--transition-normal);
}

.form-section:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.section-title {
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Icônes de champ */
.form-group {
    position: relative;
}

.field-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 0.875rem;
    z-index: 2;
    transition: all var(--transition-fast);
}

.form-group-focused .field-icon {
    color: var(--primary-blue);
}

.field-status-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    z-index: 3;
}

/* Messages de validation */
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger);
    animation: fadeIn 0.3s ease-out;
}

.valid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--success);
    animation: fadeIn 0.3s ease-out;
}

/* Sauvegarde automatique */
.auto-save-status {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: none;
}

.auto-save-status.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
}

/* Progression de formulaire */
.form-progress-container {
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

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

.form-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width var(--transition-normal);
    position: relative;
}

.form-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 33%, rgba(255, 255, 255, 0.2) 33%, rgba(255, 255, 255, 0.2) 66%, transparent 66%);
    background-size: 20px 20px;
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 20px 0;
    }
}

.form-progress-text {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Autocomplete */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: all var(--transition-fast);
}

.autocomplete-item:hover {
    background: var(--gray-50);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-name {
    font-weight: 500;
    color: var(--gray-800);
}

.autocomplete-subtitle {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--gray-50);
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: var(--primary-blue);
    background: rgba(0, 102, 204, 0.05);
    transform: translateY(-2px);
}

.drop-zone-icon {
    font-size: 3rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
    transition: all var(--transition-fast);
}

.file-drop-zone:hover .drop-zone-icon,
.file-drop-zone.drag-over .drop-zone-icon {
    color: var(--primary-blue);
    transform: scale(1.1);
}

.drop-zone-text {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.drop-zone-link {
    color: var(--primary-blue);
    text-decoration: underline;
    font-weight: 500;
}

.drop-zone-hint {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.selected-files {
    text-align: left;
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.file-icon {
    color: var(--primary-blue);
}

.file-name {
    flex: 1;
    font-weight: 500;
}

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

.btn-remove-file {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

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

/* Formulaires multi-étapes */
.multi-step-navigation {
    margin-bottom: 2rem;
}

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

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

.step-indicator::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--gray-200);
    z-index: -1;
}

.step-indicator:last-child::after {
    display: none;
}

.step-indicator.completed::after {
    background: var(--success);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all var(--transition-fast);
}

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

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

.step-indicator.completed .step-number::before {
    content: '✓';
}

.step-title {
    font-size: 0.875rem;
    color: var(--gray-600);
    text-align: center;
    max-width: 120px;
}

.step-indicator.active .step-title {
    color: var(--primary-blue);
    font-weight: 600;
}

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

.step-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width var(--transition-normal);
}

.form-step {
    animation: fadeIn 0.5s ease-out;
}

.step-navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.step-navigation-buttons .btn {
    min-width: 120px;
}

/* Responsive pour formulaires */
@media (max-width: 768px) {
    .form-section {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .step-indicators {
        flex-direction: column;
        gap: 1rem;
    }

    .step-indicator::after {
        display: none;
    }

    .step-navigation-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .step-navigation-buttons .btn {
        width: 100%;
    }

    .autocomplete-dropdown {
        max-height: 150px;
    }

    .file-drop-zone {
        padding: 1rem;
    }

    .drop-zone-icon {
        font-size: 2rem;
    }
}

/* ====================================
   ✏️ ÉDITION EN LIGNE MODERNE
   ====================================*/

.inline-edit {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    border: 2px dashed transparent;
    min-width: 100px;
}

.inline-edit:hover {
    background: var(--gray-50);
    border-color: var(--primary-blue);
    transform: scale(1.02);
}

.inline-edit::before {
    content: '✏️';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.75rem;
    opacity: 0;
    transition: all var(--transition-fast);
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: sans-serif;
}

.inline-edit:hover::before {
    opacity: 1;
    transform: scale(1);
}

.inline-edit-field {
    background: white !important;
    border: 2px solid var(--primary-blue) !important;
    border-radius: var(--radius) !important;
    padding: 0.5rem 1rem !important;
    font-size: inherit;
    color: inherit;
    width: 100%;
    min-width: 200px;
    box-shadow: var(--shadow-lg) !important;
    transition: all var(--transition-fast);
}

.inline-edit-field:focus {
    outline: none !important;
    border-color: var(--primary-cyan) !important;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2) !important;
    transform: scale(1.02);
}

/* Édition rapide pour métriques */
.metric-edit {
    position: relative;
}

.metric-edit .metric-number {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.metric-edit:hover .metric-number {
    background: rgba(0, 102, 204, 0.1);
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    transform: scale(1.05);
}

/* Formulaires flottants */
.floating-label {
    position: relative;
}

.floating-label .form-control,
.floating-label .form-select {
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
}

.floating-label label {
    position: absolute;
    top: 0;
    left: 0.75rem;
    padding: 0.75rem 0.25rem 0;
    font-size: 0.75rem;
    color: var(--gray-500);
    transition: all var(--transition-fast);
    transform-origin: 0 0;
    background: transparent;
    pointer-events: none;
}

.floating-label .form-control:focus+label,
.floating-label .form-control:not(:placeholder-shown)+label {
    transform: scale(0.85) translateY(-0.5rem);
    color: var(--primary-blue);
}

/* États visuels améliorés */
.form-group-focused {
    transform: scale(1.02);
    transition: all var(--transition-fast);
}

.form-group-focused .form-control {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* ====================================
   🎭 ANIMATIONS & MICRO-INTERACTIONS
   ====================================*/

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

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

.slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

.pulse-on-hover:hover {
    animation: pulse 1s infinite;
}

/* Loading shimmer effect */
.loading-shimmer {
    background: linear-gradient(90deg,
            var(--gray-200) 25%,
            var(--gray-100) 50%,
            var(--gray-200) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ====================================
   🏷️ BADGES & LABELS
   ====================================*/

.badge {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-xl);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.badge-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

/* ====================================
   📊 TABLEAUX
   ====================================*/

.table-modern {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-modern thead th {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-modern tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    transition: all var(--transition-fast);
}

.table-modern tbody tr:hover td {
    background: var(--gray-50);
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* ====================================
   📱 RESPONSIVE DESIGN
   ====================================*/

/* Mobile First */
@media (max-width: 767px) {
    .container-fluid {
        padding: 0 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .form-section {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .btn-group .btn {
        width: auto;
        margin-bottom: 0;
    }

    .stat-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .stat-card .stat-number {
        font-size: 2rem;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .stat-card {
        padding: 1.75rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .container-fluid {
        padding: 0 3rem;
    }

    .card:hover {
        transform: translateY(-4px);
    }
}

/* ====================================
   📱 MICRO-INTERACTIONS AVANCÉES
   ====================================*/

/* Animations de base */
.hover-lift {
    transition: all var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.hover-scale {
    transition: all var(--transition-normal);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: all var(--transition-normal);
}

.hover-rotate:hover {
    transform: rotate(3deg);
}

/* Animations fluides pour mobile */
.mobile-view .card {
    transition: all var(--transition-fast);
}

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

.mobile-view .btn:active {
    transform: scale(0.95);
}

/* États de chargement */
.loading-shimmer {
    background: linear-gradient(90deg,
            var(--gray-200) 25%,
            var(--gray-100) 50%,
            var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Effets de ripple */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Animations d'apparition */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulsation pour les éléments importants */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 102, 204, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 102, 204, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 102, 204, 0);
    }
}

/* Glow effect */
.glow {
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px var(--primary-blue);
    }

    to {
        box-shadow: 0 0 20px var(--primary-blue), 0 0 30px var(--primary-blue);
    }
}

/* États de focus améliorés */
.form-control:focus {
    animation: focusGlow 0.3s ease-out;
}

@keyframes focusGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 102, 204, 0.5);
    }

    100% {
        box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    }
}

/* Transitions de page fluides */
.page-transition {
    animation: pageSlideIn 0.5s ease-out;
}

@keyframes pageSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Améliorations pour les notifications */
.toast {
    animation: toastSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* États de survol pour les éléments interactifs */
.interactive-card {
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.interactive-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.interactive-card:hover::before {
    left: 100%;
}

/* Optimisations pour les performances */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* États de chargement pour les boutons */
.btn.loading {
    position: relative;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: button-spin 1s linear infinite;
}

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

/* Responsive animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {

    .hover-lift:hover,
    .hover-scale:hover,
    .hover-rotate:hover {
        transform: none;
    }

    .mobile-tab-item {
        transform: translateZ(0);
        will-change: transform;
    }

    .card {
        will-change: transform;
    }
}

/* ====================================
   🌙 DARK MODE SUPPORT
   ====================================*/

@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #0f172a;
        --gray-100: #1e293b;
        --gray-200: #334155;
        --light: #1e293b;
        --dark: #f8fafc;
    }

    body {
        background: var(--gray-900);
        color: var(--gray-100);
    }

    .card {
        background: var(--gray-800);
        color: var(--gray-100);
    }

    .form-control,
    .form-select {
        background: var(--gray-700);
        border-color: var(--gray-600);
        color: var(--gray-100);
    }
}

/* ====================================
   🎯 UTILITIES
   ====================================*/

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient {
    background: var(--gradient-primary);
}

.shadow-gradient {
    box-shadow: var(--shadow-gradient);
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
        var(--gradient-primary) border-box;
}

/* Animation classes */
.hover-lift:hover {
    transform: translateY(-4px);
    transition: all var(--transition-normal);
}

.hover-scale:hover {
    transform: scale(1.05);
    transition: all var(--transition-normal);
}

.hover-rotate:hover {
    transform: rotate(5deg);
    transition: all var(--transition-normal);
}

/* Print styles */
@media print {

    .mobile-tab-bar,
    .desktop-navbar,
    .btn,
    .card-header .btn {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid var(--gray-300) !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}