/* ══════════════════════════════════════════════════════════════
   ECLOSION+ LMS — Custom CSS (standalone, pas besoin de build)
   ══════════════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────────── */
:root {
    --green-50: #f0fdf4;
    --green-100: #dcfce7;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    --green-800: #166534;
    --green-900: #14532d;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
}

/* ── Base ─────────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}
::selection {
    background: var(--green-200);
    color: var(--green-900);
}
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-eclosion {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    background: var(--green-600);
    color: #fff;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}
.btn-eclosion:hover {
    background: var(--green-700);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.35);
    transform: translateY(-1px);
}
.btn-eclosion:active {
    transform: scale(0.97);
}

.btn-outline-green {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: 2px solid var(--green-600);
    color: var(--green-600);
    background: transparent;
    transition: all 0.2s;
    cursor: pointer;
}
.btn-outline-green:hover {
    background: var(--green-50);
}

/* ── Cards ────────────────────────────────────────────────── */
.card-course {
    background: #fff;
    border-radius: var(--radius-2xl);
    border: 1px solid #f3f4f6;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.card-course:hover {
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}
.card-course-img {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f9fafb;
}
.card-course-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.card-course:hover .card-course-img img {
    transform: scale(1.06);
}
.card-course-img::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.05) 50%,
        transparent 100%
    );
}
.card-course-price {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.card-course-price.paid {
    background: rgba(255, 255, 255, 0.95);
    color: var(--green-700);
}
.card-course-price.free {
    background: var(--green-500);
    color: #fff;
}
.card-course-badges {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-course-badge {
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 8px;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-course-rating {
    background: rgba(250, 204, 21, 0.9);
    color: #713f12;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 2px;
}
.card-course-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.card-course-body h3 {
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.card-course:hover .card-course-body h3 {
    color: var(--green-600);
}
.card-course-body .instructor {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-course-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-course-footer .duration {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-course-footer .cta {
    font-size: 13px;
    font-weight: 600;
    color: var(--green-600);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s;
}
.card-course:hover .card-course-footer .cta {
    transform: translateX(3px);
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: var(--radius-xl);
    border: 1px solid #f3f4f6;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}
.stat-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.stat-card.green::before {
    background: linear-gradient(90deg, var(--green-600), var(--green-400));
}
.stat-card.blue::before {
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}
.stat-card.purple::before {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}
.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
}
.stat-card-value {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
}
.stat-card-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    margin-top: 2px;
}

/* ── Forms ────────────────────────────────────────────────── */
.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 14px;
    color: #374151;
    background: #fff;
    transition: all 0.2s;
    outline: none;
}
.input-field:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}
.input-field::placeholder {
    color: #9ca3af;
}
.input-field.error {
    border-color: #ef4444;
}
.input-field.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.form-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.form-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.badge-success {
    background: #dcfce7;
    color: #166534;
}
.badge-warning {
    background: #fef3c7;
    color: #92400e;
}
.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}
.badge-info {
    background: #dbeafe;
    color: #1e40af;
}
.badge-purple {
    background: #f3e8ff;
    color: #6b21a8;
}
.badge-gray {
    background: #f3f4f6;
    color: #4b5563;
}

/* ── Tables ───────────────────────────────────────────────── */
.table-clean {
    width: 100%;
    font-size: 14px;
    border-collapse: collapse;
}
.table-clean thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.table-clean tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}
.table-clean tbody tr {
    transition: background 0.15s;
}
.table-clean tbody tr:hover {
    background: #f9fafb;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}
.animate-fade-up {
    animation: fadeInUp 0.5s ease-out;
}
.animate-scale-in {
    animation: scaleIn 0.2s ease-out;
}
.animate-slide-down {
    animation: slideDown 0.3s ease-out;
}

/* Stagger children */
.stagger > * {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}
.stagger > *:nth-child(1) {
    animation-delay: 0.05s;
}
.stagger > *:nth-child(2) {
    animation-delay: 0.1s;
}
.stagger > *:nth-child(3) {
    animation-delay: 0.15s;
}
.stagger > *:nth-child(4) {
    animation-delay: 0.2s;
}
.stagger > *:nth-child(5) {
    animation-delay: 0.25s;
}
.stagger > *:nth-child(6) {
    animation-delay: 0.3s;
}

/* ── Skeleton loading ─────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ── Toast ────────────────────────────────────────────────── */
.toast {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease-out;
}
.toast-success {
    background: var(--green-600);
}
.toast-error {
    background: #ef4444;
}
.toast-info {
    background: #3b82f6;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease-out;
}
.modal-box {
    background: #fff;
    border-radius: var(--radius-2xl);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.2s ease-out;
}

/* ── Progress bar ─────────────────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, var(--green-600), var(--green-400));
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}
.empty-state-icon {
    font-size: 56px;
    color: #d1d5db;
    margin-bottom: 16px;
}
.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}
.empty-state-text {
    font-size: 14px;
    color: #9ca3af;
    max-width: 360px;
}

/* ── Tooltip ──────────────────────────────────────────────── */
[data-tooltip] {
    position: relative;
}
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 50;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }
    .card-course-img {
        height: 160px;
    }
}
@media (min-width: 641px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
    .no-print {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
    }
}

/* ── Accessibility ────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--green-500);
    outline-offset: 2px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.stat-card.yellow::before{background:linear-gradient(90deg,#ca8a04,#facc15)}.stat-card.orange::before{background:linear-gradient(90deg,#ea580c,#fb923c)}
