/* LearnPath — Design System Premium v2 */

:root {
    /* Palette */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.3);
    --secondary: #ec4899;
    --secondary-light: #f472b6;
    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.25);

    /* Fonds */
    --bg-deep: #060b18;
    --bg-dark: #0b1120;
    --bg-card: rgba(15, 23, 42, 0.65);
    --bg-card-hover: rgba(15, 23, 42, 0.85);
    --bg-input: rgba(15, 23, 42, 0.8);

    /* Texte */
    --text-white: #f1f5f9;
    --text-gray: #94a3b8;
    --text-muted: #64748b;

    /* Bordures */
    --border: rgba(51, 65, 85, 0.5);
    --border-light: rgba(99, 102, 241, 0.25);

    /* Feedback */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --error: #f43f5e;
    --error-glow: rgba(244, 63, 94, 0.2);
    --warning: #f59e0b;

    /* Effets */
    --glass-bg: rgba(15, 23, 42, 0.55);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px var(--primary-glow);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Tailles */
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fond avec pattern de points subtil */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(99, 102, 241, 0.08) 1px, transparent 0);
    background-size: 48px 48px;
    pointer-events: none;
}

/* Dégradé d'ambiance */
body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(236, 72, 153, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(6, 182, 212, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* === LAYOUT === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* === SCROLLBAR CUSTOM === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* === TYPOGRAPHIE === */
h1, h2, h3, h4 {
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }

/* === GLASSMORPHISM === */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.glass:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
}

/* === BOUTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-white);
}

.btn-secondary:hover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* === INPUTS === */
input, textarea {
    width: 100%;
    padding: 13px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-white);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

input::placeholder {
    color: var(--text-muted);
}

input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: rgba(15, 23, 42, 0.95);
}

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

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

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

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

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

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

.animate-fade {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-scale {
    animation: fadeInScale 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
    animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* === SKELETON / LOADING === */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(99, 102, 241, 0.08) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: var(--radius-sm);
}

/* === PROGRESS BARS === */
.progress-container {
    margin: 15px 0;
}

.progress-bar-bg {
    height: 8px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-gray);
    font-weight: 500;
}

/* === MESSAGE LOADER / EMPTY / ERROR === */
.loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px;
    color: var(--text-gray);
}

.loader::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error {
    color: var(--error);
    background: var(--error-glow);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

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

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.empty-state p {
    color: var(--text-gray);
    margin-bottom: 24px;
    font-size: 1.1rem;
}

/* === MODAL OVERLAY (base) === */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(6, 11, 24, 0.9);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* === UTILITAIRES === */
.p-30 { padding: 30px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-gray { color: var(--text-gray); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container { padding: 0 16px; }

    .glass {
        border-radius: var(--radius);
    }

    .btn {
        padding: 11px 20px;
        font-size: 0.9rem;
    }

    .modal-content {
        padding: 24px;
        margin: 10px;
    }
}
