/**
 * academy-student-dashboard.css
 * Préfixe : .asd-*
 */

/* ── Overlay ─────────────────────────────────────────────────────────────── */
.asd-overlay {
    position: fixed; inset: 0; z-index: 10200;
    background: rgba(0,0,0,0.72);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: asd-fadein .22s ease;
}
@keyframes asd-fadein { from { opacity: 0 } to { opacity: 1 } }

.asd-modal {
    background: #13121f;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    width: 100%; max-width: 680px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    animation: asd-slidein .28s cubic-bezier(.22,.61,.36,1);
}
@keyframes asd-slidein {
    from { opacity: 0; transform: translateY(20px) scale(.97) }
    to   { opacity: 1; transform: translateY(0) scale(1) }
}

.asd-close-btn {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.08); border: none; color: rgba(255,255,255,0.6);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform .15s ease-out, background .15s ease-out, border-color .15s ease-out, color .15s ease-out, opacity .15s ease-out;
}
.asd-close-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.asd-header {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 24px;
}
.asd-header-icon { font-size: 36px; }
.asd-title { font-size: 22px; font-weight: 800; color: #fff; margin: 0; }
.asd-subtitle { font-size: 13px; color: rgba(255,255,255,0.4); margin: 2px 0 0; }

/* ── Stats row ───────────────────────────────────────────────────────────── */
.asd-stats-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin-bottom: 24px;
}
.asd-kpi {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 12px 10px;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    text-align: center;
}
.asd-kpi-icon { font-size: 18px; }
.asd-kpi-val  { font-size: 20px; font-weight: 800; color: #fff; }
.asd-kpi-lbl  { font-size: 10px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: .06em; }

/* ── Section ─────────────────────────────────────────────────────────────── */
.asd-section { margin-bottom: 24px; }
.asd-section-title {
    font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.5);
    text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px;
}

/* ── Formation Card ──────────────────────────────────────────────────────── */
.asd-card {
    display: flex; gap: 14px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 14px; margin-bottom: 10px;
    transition: border-color .15s ease;
}
.asd-card:hover { border-color: rgba(99,102,241,0.3); }
.asd-card-thumb {
    width: 60px; height: 60px; border-radius: 10px; flex-shrink: 0;
    object-fit: cover;
}
.asd-card-thumb--emoji {
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    background: rgba(255,255,255,0.06);
}
.asd-card-body { flex: 1; min-width: 0; }
.asd-card-title {
    font-size: 14px; font-weight: 700; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 3px;
}
.asd-card-meta { font-size: 11px; color: rgba(255,255,255,0.4); margin-bottom: 8px; }
.asd-progress-bar {
    height: 5px; background: rgba(255,255,255,0.1);
    border-radius: 4px; overflow: hidden; margin-bottom: 6px;
}
.asd-progress-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }
.asd-card-footer { display: flex; align-items: center; justify-content: space-between; }
.asd-pct-label { font-size: 12px; font-weight: 700; }
.asd-card-actions { display: flex; gap: 6px; align-items: center; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.asd-cert-btn, .asd-quiz-btn {
    font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 7px;
    cursor: pointer; border: 1px solid; transition: transform .15s ease-out, background .15s ease-out, border-color .15s ease-out, color .15s ease-out, opacity .15s ease-out; font-family: inherit;
    white-space: nowrap;
}
.asd-cert-btn {
    background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.3); color: #fbbf24;
}
.asd-cert-btn:hover { background: rgba(245,158,11,0.22); }
.asd-quiz-btn {
    background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.3); color: #a78bfa;
}
.asd-quiz-btn:hover { background: rgba(99,102,241,0.22); }
.asd-quiz-score {
    font-size: 11px; color: #10b981; font-weight: 600;
    background: rgba(16,185,129,0.1); padding: 3px 8px; border-radius: 6px;
}

/* ── Quiz list ───────────────────────────────────────────────────────────── */
.asd-quiz-list { display: flex; flex-direction: column; gap: 8px; }
.asd-quiz-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2); border-radius: 10px;
}
.asd-quiz-emoji { font-size: 18px; }
.asd-quiz-name { flex: 1; font-size: 13px; color: rgba(255,255,255,0.8); font-weight: 500; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.asd-empty {
    text-align: center; padding: 40px 20px;
    color: rgba(255,255,255,0.4); font-size: 14px;
}
.asd-empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ── Loading / Error ─────────────────────────────────────────────────────── */
.asd-loading {
    display: flex; flex-direction: column; align-items: center;
    gap: 14px; padding: 60px 20px; color: rgba(255,255,255,0.4); font-size: 14px;
}
.asd-spinner {
    width: 32px; height: 32px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #7c3aed;
    animation: asd-spin .8s linear infinite;
}
@keyframes asd-spin { to { transform: rotate(360deg) } }
.asd-error { padding: 24px; text-align: center; color: #f87171; font-size: 14px; }

/* ── Completion celebration ──────────────────────────────────────────────── */
.asd-completion { text-align: center; padding: 8px 0; }
.asd-completion-badge {
    font-size: 64px; display: block; margin-bottom: 16px;
    animation: asd-badge-pop .6s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes asd-badge-pop {
    from { opacity:0; transform: scale(.5) rotate(-10deg) }
    to   { opacity:1; transform: scale(1)  rotate(0deg) }
}
.asd-completion-title {
    font-size: 28px; font-weight: 800; color: #fff; margin: 0 0 8px;
}
.asd-completion-sub {
    font-size: 15px; color: rgba(255,255,255,0.6); margin-bottom: 28px; line-height: 1.6;
}
.asd-completion-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }

.asd-btn {
    padding: 13px 24px; border-radius: 50px; font-size: 14px; font-weight: 700;
    cursor: pointer; border: none; font-family: inherit; transition: transform .2s ease-out, background .2s ease-out, border-color .2s ease-out, color .2s ease-out, opacity .2s ease-out;
    display: inline-flex; align-items: center; gap: 7px;
}
.asd-btn-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff; box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}
.asd-btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,158,11,0.4); }
.asd-btn-outline {
    background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
}
.asd-btn-outline:hover { background: rgba(255,255,255,0.1); }

/* ── Recommendations ─────────────────────────────────────────────────────── */
.asd-recs-section {
    border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; margin-top: 8px;
}
.asd-recs-title {
    font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.5);
    text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px;
}
.asd-recs-list { display: flex; flex-direction: column; gap: 10px; }
.asd-recs-loading { font-size: 13px; color: rgba(255,255,255,0.35); text-align: center; padding: 12px 0; }
.asd-rec-card {
    display: flex; gap: 12px; align-items: center;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; padding: 12px 14px;
    transition: border-color .15s ease; cursor: pointer;
}
.asd-rec-card:hover { border-color: rgba(99,102,241,0.3); }
.asd-rec-emoji { font-size: 24px; flex-shrink: 0; }
.asd-rec-body { flex: 1; min-width: 0; }
.asd-rec-title {
    font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.85);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px;
}
.asd-rec-meta { font-size: 11px; color: rgba(255,255,255,0.35); }

/* ── Confetti animation ──────────────────────────────────────────────────── */
@keyframes asd-confetti-fall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(500px) rotate(720deg); opacity: 0; }
}

/* ── Live Sessions ───────────────────────────────────────────────────────── */
.asd-live-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.asd-live-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 14px;
    padding: 16px 18px;
    transition: border-color .18s ease;
}

.asd-live-card:hover {
    border-color: rgba(139,92,246,0.3);
}

.asd-live-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.asd-live-card-formation {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.asd-live-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.3;
}

.asd-live-card-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
}

.asd-live-card-desc {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 6px;
    line-height: 1.5;
}

/* Countdown */
.asd-countdown {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #a78bfa;
    background: rgba(139,92,246,0.12);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 8px;
    padding: 4px 12px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
}

/* Status badges */
.asd-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.asd-live-badge-live {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.4);
    color: #f87171;
    animation: asd-pulse 2s infinite;
}

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

.asd-live-badge-ended {
    background: rgba(107,114,128,0.1);
    border: 1px solid rgba(107,114,128,0.2);
    color: #6b7280;
}

.asd-live-badge-soon {
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.3);
    color: #f59e0b;
}

.asd-live-badge-planned {
    background: rgba(139,92,246,0.1);
    border: 1px solid rgba(139,92,246,0.3);
    color: #a78bfa;
}

/* Bottom action row */
.asd-live-card-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.asd-live-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity .18s ease;
}

.asd-live-btn:hover { opacity: 0.85; }

.asd-live-btn-join {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.asd-live-btn-wait {
    background: rgba(139,92,246,0.15);
    border: 1px solid rgba(139,92,246,0.3);
    color: #a78bfa;
}

.asd-live-btn-replay {
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.3);
    color: #34d399;
}

.asd-live-btn-link {
    font-size: 12px;
    color: #52525b;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color .15s;
}

.asd-live-btn-link:hover { color: #a78bfa; }

/* ── Bouton Parcours Maha ────────────────────────────────────────────────── */
.asd-path-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid rgba(167,139,250,0.4);
    background: rgba(167,139,250,0.1);
    color: #a78bfa;
    cursor: pointer;
    transition: transform .15s ease-out, background .15s ease-out, border-color .15s ease-out, color .15s ease-out, opacity .15s ease-out;
    white-space: nowrap;
}
.asd-path-btn:hover,
.asd-path-btn--active {
    background: rgba(167,139,250,0.2);
    border-color: #a78bfa;
}

/* ── Parcours personnalisé — container ───────────────────────────────────── */
.asd-path-section {
    margin-top: 0;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
    animation: asd-fadein .2s ease;
}

.asd-path-container {
    background: rgba(167,139,250,0.05);
    border: 1px solid rgba(167,139,250,0.15);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 16px;
}

.asd-path-loading,
.asd-path-empty {
    padding: 16px;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    font-style: italic;
    background: rgba(167,139,250,0.04);
    border: 1px solid rgba(167,139,250,0.1);
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.asd-path-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.asd-path-header-icon { font-size: 18px; }
.asd-path-header-title {
    font-size: 13px;
    font-weight: 700;
    color: #a78bfa;
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* AI Summary */
.asd-path-summary {
    display: flex;
    gap: 10px;
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
}
.asd-path-summary-icon { font-size: 18px; flex-shrink: 0; }
.asd-path-summary-text {
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(255,255,255,0.7);
    font-style: italic;
}

/* Stats bar */
.asd-path-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.asd-path-stat {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 3px 10px;
}
.asd-path-stat-essential {
    color: #f59e0b;
    background: rgba(245,158,11,0.1);
}

/* Timeline modules */
.asd-path-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asd-path-module {
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
    transition: border-color .15s;
}
.asd-path-module--essential { border-color: rgba(245,158,11,0.25); }
.asd-path-module--optional  { border-color: rgba(255,255,255,0.07); }

.asd-path-module-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
}

.asd-path-module-num {
    width: 24px; height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(167,139,250,0.2);
    color: #a78bfa;
    font-size: 11px;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}

.asd-path-module-info { flex: 1; min-width: 0; }
.asd-path-module-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}
.asd-path-module-reason {
    font-size: 11.5px;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
    font-style: italic;
}

.asd-path-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 3px 8px;
    white-space: nowrap;
}
.asd-path-badge-essential {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
    border: 1px solid rgba(245,158,11,0.3);
}
.asd-path-badge-optional {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Lessons inside module */
.asd-path-lessons {
    padding: 6px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.asd-path-lesson {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
}
.asd-path-lesson--done { opacity: 0.55; }
.asd-path-lesson-icon { font-size: 11px; width: 16px; text-align: center; color: #10b981; }
.asd-path-lesson--done .asd-path-lesson-icon { color: #10b981; }
.asd-path-lesson-title { flex: 1; font-size: 12px; color: rgba(255,255,255,0.7); line-height: 1.3; }
.asd-path-lesson-dur { font-size: 10px; color: rgba(255,255,255,0.3); white-space: nowrap; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .asd-modal { padding: 20px 16px; }
    .asd-stats-row { grid-template-columns: repeat(2, 1fr); }
    .asd-completion-title { font-size: 22px; }
    .asd-live-card-top { flex-direction: column; }
    .asd-path-module-header { flex-wrap: wrap; }
}

/* ── Thumbnails cartes formation (fcard) — fix affichage image ── */
.fcard-thumb--img {
    background: var(--bg-secondary, #1a1a2e);
}
.fcard-thumb--img::before {
    display: none;
}
.fcard-thumb-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    transition: transform 0.4s ease;
    display: block;
    border-radius: 0;
}
.fcard:hover .fcard-thumb-image {
    transform: scale(1.06);
}
.fcard-thumb--img .formation-status-badge,
.fcard-thumb--img .fcard-price-tag,
.fcard-thumb--img .fcard-hover-actions,
.fcard-thumb--img .fcard-cert-badge,
.fcard-thumb--img .fcard-change-thumb {
    z-index: 2;
}
