/* ===== SWA EDU :: app.css =====
   Additive styles for the student area. Uses the existing tokens from styles.css
   (--navy-900, --blue, --cyan, --muted, --line, --glass, --radius, --wrap).
   Load AFTER styles.css. Mobile-first + tablet + desktop.
*/

/* ---------- صفحات مركزية (تسجيل / دخول / كلمة مرور / دفع) ---------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 88px 16px 40px;
}

.auth-card {
    width: 100%;
    max-width: 520px;
    padding: 28px 22px;
    border-radius: var(--radius);
}

.auth-card__head {
    text-align: center;
    margin-bottom: 22px;
}

    .auth-card__head h1 {
        font-size: clamp(22px, 4vw, 28px);
        margin: 8px 0 6px;
    }

    .auth-card__head p {
        color: var(--muted);
        font-size: 14px;
        line-height: 1.7;
    }

.auth-foot {
    margin-top: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

    .auth-foot a {
        color: var(--cyan);
        text-decoration: none;
    }

/* ---------- شريط خطوات التسجيل ---------- */
.steps {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

    .steps span {
        font-size: 12px;
        padding: 6px 12px;
        border-radius: 999px;
        border: 1px solid var(--line);
        color: var(--muted);
        background: var(--glass);
    }

        .steps span[data-active='true'] {
            color: var(--white);
            border-color: transparent;
            background: var(--grad);
        }

/* ---------- شريط علوي للوحة الطالب ---------- */
.dash-top {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(14px);
    background: rgba(7, 13, 31, 0.82);
    border-bottom: 1px solid var(--line);
}

.dash-top__inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dash-main {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 26px 16px 80px;
}

/* ---------- بطاقات الملخّص ---------- */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.dash-stat {
    padding: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--glass);
}

.dash-stat__label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.dash-stat__value {
    font-size: 20px;
    font-weight: 700;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
}

.badge--active {
    color: #7ee7b0;
    border-color: rgba(126, 231, 176, 0.35);
    background: rgba(126, 231, 176, 0.1);
}

.badge--expired {
    color: #ffb4b4;
    border-color: rgba(255, 180, 180, 0.35);
    background: rgba(255, 180, 180, 0.1);
}

/* ---------- شريط التقدم ---------- */
.progress {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.progress__bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--grad);
    transition: width 0.5s ease;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
    margin-top: 10px;
}

/* ---------- بطاقات المحاضرات ---------- */
.lessons-grid,
.files-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.lesson-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--glass);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

    .lesson-card:hover {
        transform: translateY(-4px);
        border-color: rgba(37, 99, 255, 0.45);
    }

.lesson-card__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
    display: grid;
    place-items: center;
    font-size: 30px;
}

    .lesson-card__thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.lesson-card__no {
    position: absolute;
    inset-inline-start: 10px;
    top: 10px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(4, 8, 20, 0.75);
    border: 1px solid var(--line);
}

.lesson-card__time {
    position: absolute;
    inset-inline-end: 10px;
    bottom: 10px;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(4, 8, 20, 0.75);
}

.lesson-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

    .lesson-card__body h3 {
        font-size: 16px;
        line-height: 1.5;
    }

    .lesson-card__body p {
        font-size: 13px;
        color: var(--muted);
        line-height: 1.7;
    }

/* ---------- بطاقات الملفات ---------- */
.file-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--glass);
}

.file-card__icon {
    font-size: 26px;
    line-height: 1;
}

.file-card__meta {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
}

/* ---------- مشغل الفيديو ---------- */
.player {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: #000;
}

    .player video,
    .player iframe {
        width: 100%;
        aspect-ratio: 16 / 9;
        display: block;
        border: 0;
    }

/* ---------- حالات ---------- */
.state {
    text-align: center;
    padding: 40px 16px;
    color: var(--muted);
}

.state--error {
    color: #ffb4b4;
}

.hidden {
    display: none !important;
}

.skeleton {
    border-radius: var(--radius-sm);
    height: 150px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
    background-size: 200% 100%;
    animation: sk 1.2s linear infinite;
}

@keyframes sk {
    to {
        background-position: -200% 0;
    }
}

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
    .dash-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lessons-grid,
    .files-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .auth-card {
        padding: 34px 30px;
    }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
    .dash-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .lessons-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .files-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .lesson-layout {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 20px;
        align-items: start;
    }
}
