/*!
 * Tiznik Exam Manager — Videos UI (teacher + student)
 * فونت: وزیرمتن — ریسپانسیو — سازگار با حالت تیره‌ی پنل
 * همه‌ی کلاس‌ها با پیشوند tvd- (بدون تداخل با استایل‌های قبلی پنل)
 */

.tvd,
.tvd-modal,
.tvd-toast {
    --v-blue: #3560ff;
    --v-purple: #7c3aed;
    --v-teal: #0ea5a3;
    --v-grad: linear-gradient(135deg, #3560ff 0%, #7c3aed 100%);
    --v-text: #1f2440;
    --v-muted: #7a7f9a;
    --v-card: rgba(255, 255, 255, .92);
    --v-card-solid: #ffffff;
    --v-soft: #f3f5fd;
    --v-border: #e5e9f6;
    --v-input: #ffffff;
    --v-green: #16a34a;
    --v-red: #e11d48;
    --v-gold: #f59e0b;
    --v-shadow: 0 10px 30px rgba(38, 48, 110, .08);
    --v-shadow-lg: 0 20px 44px rgba(53, 96, 255, .16);
    direction: rtl;
    text-align: right;
    color: var(--v-text);
    font-family: 'Vazirmatn', 'Vazir', Tahoma, 'Segoe UI', sans-serif !important;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.ttp-dark .tvd,
.tsp-dark .tvd,
.tvd-modal.tvd-dark,
.tvd-toast.tvd-dark {
    --v-text: #eef1ff;
    --v-muted: #9aa0c4;
    --v-card: rgba(30, 33, 64, .72);
    --v-card-solid: #1a1d38;
    --v-soft: rgba(255, 255, 255, .06);
    --v-border: rgba(255, 255, 255, .1);
    --v-input: rgba(255, 255, 255, .06);
    --v-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --v-shadow-lg: 0 20px 44px rgba(0, 0, 0, .45);
}

.tvd *,
.tvd-modal *,
.tvd-toast {
    box-sizing: border-box;
    font-family: 'Vazirmatn', 'Vazir', Tahoma, 'Segoe UI', sans-serif !important;
}

.tvd [hidden],
.tvd-modal [hidden] {
    display: none !important;
}

.tvd {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    line-height: 1.9;
}

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */
.tvd-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 28px 30px;
    border-radius: 26px;
    color: #fff;
    background: var(--v-grad);
    box-shadow: var(--v-shadow-lg);
}

.tvd-hero::before,
.tvd-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: rgba(255, 255, 255, .11);
}

.tvd-hero::before { width: 240px; height: 240px; left: -70px; top: -90px; }
.tvd-hero::after  { width: 170px; height: 170px; left: 120px; bottom: -90px; background: rgba(255, 255, 255, .07); }

.tvd-hero-copy { position: relative; z-index: 1; max-width: 640px; }

.tvd-kicker {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tvd-hero h2 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.5;
}

.tvd-hero p {
    margin: 0;
    color: rgba(255, 255, 255, .88);
    font-size: 14px;
    line-height: 2;
}

.tvd-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tvd-hero-tags b {
    padding: 5px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .22);
    font-size: 12px;
    font-weight: 600;
}

.tvd-hero-btn { position: relative; z-index: 1; flex: 0 0 auto; }

.tvd-teacher .tvd-hero-btn {
    background: #fff !important;
    color: var(--v-blue) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 40, .22) !important;
    padding: 14px 26px;
    font-size: 15px;
}

.tvd-hero-art { position: relative; z-index: 1; flex: 0 0 auto; display: flex; align-items: center; gap: 14px; }

.tvd-hero-screen {
    width: 150px;
    height: 96px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    display: grid;
    place-items: center;
    backdrop-filter: blur(6px);
}
.tvd-hero-screen span {
    width: 46px; height: 46px; border-radius: 50%;
    background: #fff; color: var(--v-blue);
    display: grid; place-items: center; font-size: 18px;
    padding-right: 0; box-shadow: 0 8px 20px rgba(0, 0, 40, .2);
}

.tvd-hero-count {
    text-align: center;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 20px;
    padding: 12px 18px;
}
.tvd-hero-count b { display: block; font-size: 26px; font-weight: 800; line-height: 1.4; }
.tvd-hero-count small { font-size: 12px; opacity: .9; }

/* ------------------------------------------------------------------ */
/* Metrics                                                             */
/* ------------------------------------------------------------------ */
.tvd-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.tvd-metrics > div {
    background: var(--v-card);
    border: 1px solid var(--v-border);
    border-radius: 20px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "i n" "i l";
    column-gap: 12px;
    align-items: center;
    box-shadow: var(--v-shadow);
}
.tvd-metrics > div > span {
    grid-area: i;
    width: 44px; height: 44px; border-radius: 14px;
    display: grid; place-items: center; font-size: 20px;
    background: linear-gradient(135deg, rgba(53, 96, 255, .14), rgba(124, 58, 237, .14));
}
.tvd-metrics b { grid-area: n; font-size: 21px; font-weight: 800; line-height: 1.3; }
.tvd-metrics small { grid-area: l; color: var(--v-muted); font-size: 12px; }

/* ------------------------------------------------------------------ */
/* Toolbar                                                             */
/* ------------------------------------------------------------------ */
.tvd-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tvd-seg {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    border-radius: 18px;
    background: var(--v-card);
    border: 1px solid var(--v-border);
    box-shadow: var(--v-shadow);
    max-width: 100%;
}
.tvd-seg button {
    appearance: none;
    border: 0;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 14px;
    background: transparent;
    color: var(--v-muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: .2s;
    white-space: nowrap;
}
.tvd-seg button em {
    font-style: normal;
    min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 999px;
    display: inline-grid; place-items: center;
    font-size: 11px;
    background: var(--v-soft);
    color: var(--v-muted);
}
.tvd-seg button:hover { color: var(--v-blue); }
.tvd-seg button.active {
    background: var(--v-grad);
    color: #fff;
    box-shadow: 0 10px 22px rgba(83, 66, 226, .28);
}
.tvd-seg button.active em { background: rgba(255, 255, 255, .25); color: #fff; }

.tvd-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 240px;
    padding: 0 14px;
    border-radius: 16px;
    background: var(--v-card);
    border: 1px solid var(--v-border);
    box-shadow: var(--v-shadow);
    margin: 0;
}
.tvd-search input {
    flex: 1;
    min-width: 0;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--v-text);
    height: 44px;
    font-size: 14px;
    padding: 0 !important;
}

/* ------------------------------------------------------------------ */
/* Grid & cards                                                        */
/* ------------------------------------------------------------------ */
.tvd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
    gap: 18px;
}

.tvd-pane { display: none; }
.tvd-pane.active { display: block; }

.tvd-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    background: var(--v-card);
    border: 1px solid var(--v-border);
    box-shadow: var(--v-shadow);
    transition: transform .22s, box-shadow .22s;
}
.tvd-card:hover { transform: translateY(-4px); box-shadow: var(--v-shadow-lg); }
.tvd-card[hidden] { display: none !important; }

.tvd-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.tvd-thumb.tvd-tone-a { background-image: linear-gradient(135deg, #3560ff, #6ea0ff); }
.tvd-thumb.tvd-tone-b { background-image: linear-gradient(135deg, #7c3aed, #b06cf5); }
.tvd-thumb.tvd-tone-c { background-image: linear-gradient(135deg, #0ea5a3, #34d3a5); }
.tvd-thumb.tvd-tone-d { background-image: linear-gradient(135deg, #f97316, #fbbf24); }
.tvd-thumb.has-cover { background-color: #1f2440; }
.tvd-thumb.has-cover[style] { background-repeat: no-repeat; }

.tvd-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(10, 12, 40, .5) 100%);
    pointer-events: none;
}

.tvd-play {
    position: relative;
    z-index: 2;
    width: 54px; height: 54px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .95);
    color: var(--v-blue);
    font-size: 19px;
    box-shadow: 0 10px 24px rgba(0, 0, 40, .28);
    transition: transform .22s;
    padding-right: 0;
}
.tvd-card:hover .tvd-play { transform: scale(1.1); }

.tvd-dur {
    position: absolute; z-index: 2; left: 12px; bottom: 10px;
    padding: 2px 10px; border-radius: 999px;
    background: rgba(10, 12, 40, .72); color: #fff;
    font-size: 12px; font-weight: 700;
}

.tvd-pill {
    position: absolute; z-index: 2; right: 12px; top: 12px;
    padding: 3px 11px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; color: #fff;
    backdrop-filter: blur(6px);
}
.tvd-pill-green { background: rgba(22, 163, 74, .9); }
.tvd-pill-gray { background: rgba(71, 79, 110, .9); }

.tvd-star {
    position: absolute; z-index: 2; left: 12px; top: 10px;
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .95); color: var(--v-gold);
    font-size: 16px; box-shadow: 0 6px 16px rgba(0, 0, 40, .22);
}

.tvd-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }

.tvd-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tvd-tag {
    font-style: normal;
    padding: 2px 11px; border-radius: 999px;
    background: rgba(53, 96, 255, .1); color: var(--v-blue);
    font-size: 11.5px; font-weight: 700; line-height: 1.9;
}
.tvd-tag-analysis { background: rgba(124, 58, 237, .12); color: var(--v-purple); }
.tvd-tag-training { background: rgba(14, 165, 163, .13); color: var(--v-teal); }
.tvd-tag-soft { background: var(--v-soft); color: var(--v-muted); }

.tvd-body h4 {
    margin: 2px 0 0;
    font-size: 16px; font-weight: 800; line-height: 1.8;
    color: var(--v-text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.tvd-exam { margin: 0; font-size: 12.5px; color: var(--v-purple); font-weight: 600; }
.tvd-desc {
    margin: 0; font-size: 13px; color: var(--v-muted); line-height: 1.9;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tvd-teacher { font-size: 12.5px; color: var(--v-muted); }

.tvd-audience {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 12px; border-radius: 14px;
    background: var(--v-soft); font-size: 12.5px; color: var(--v-text);
}
.tvd-audience b { font-weight: 600; line-height: 1.7; }

.tvd-stats-line { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--v-muted); }

.tvd-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.tvd-actions .tvd-btn { flex: 1; }
.tvd-actions .tvd-btn-danger { flex: 0 0 48px; }

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */
.tvd-btn,
.tvd-modal .tvd-btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 14px;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.6;
    text-decoration: none;
    transition: transform .15s, box-shadow .2s, background .2s, opacity .2s;
}
.tvd-btn:active { transform: scale(.98); }
.tvd-btn:disabled { opacity: .6; cursor: not-allowed; }

.tvd-btn-primary {
    background: var(--v-grad);
    color: #fff;
    box-shadow: 0 12px 26px rgba(83, 66, 226, .26);
}
.tvd-btn-primary:hover:not(:disabled) { box-shadow: 0 16px 32px rgba(83, 66, 226, .36); transform: translateY(-1px); }

.tvd-btn-soft {
    background: var(--v-soft);
    color: var(--v-text);
    border: 1px solid var(--v-border);
}
.tvd-btn-soft:hover:not(:disabled) { background: rgba(53, 96, 255, .1); color: var(--v-blue); }
.tvd-btn-danger { color: var(--v-red); }
.tvd-btn-danger:hover:not(:disabled) { background: rgba(225, 29, 72, .1) !important; color: var(--v-red) !important; }

.tvd-watch { width: 100%; margin-top: 8px; padding: 13px 18px; font-size: 14px; }
.tvd-watch.is-loading { pointer-events: none; }
.tvd-watch-icon { font-size: 12px; }

/* ------------------------------------------------------------------ */
/* Empty state                                                         */
/* ------------------------------------------------------------------ */
.tvd-empty {
    grid-column: 1 / -1;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 46px 20px;
    border-radius: 24px;
    border: 2px dashed var(--v-border);
    background: var(--v-card);
}
.tvd-empty span { font-size: 42px; margin-bottom: 6px; }
.tvd-empty b { font-size: 16px; font-weight: 800; }
.tvd-empty p { margin: 4px 0 0; color: var(--v-muted); font-size: 13.5px; }

/* ------------------------------------------------------------------ */
/* Modal (teacher)                                                     */
/* ------------------------------------------------------------------ */
.tvd-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tvd-modal.open { display: flex; }

body.tvd-lock { overflow: hidden !important; }

.tvd-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(13, 16, 38, .55);
    backdrop-filter: blur(4px);
    animation: tvdFade .2s ease;
}

.tvd-sheet {
    position: relative;
    width: 100%;
    max-width: 760px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: var(--v-card-solid);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(10, 14, 50, .4);
    overflow: hidden;
    animation: tvdPop .25s cubic-bezier(.2, .9, .3, 1.1);
}

@keyframes tvdFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tvdPop { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }

.tvd-sheet form { display: flex; flex-direction: column; min-height: 0; flex: 1; margin: 0; }

.tvd-sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--v-border);
}
.tvd-sheet-head h3 { margin: 0; font-size: 18px; font-weight: 800; color: var(--v-text); }
.tvd-x {
    appearance: none; border: 0; cursor: pointer;
    width: 38px; height: 38px; border-radius: 12px;
    background: var(--v-soft); color: var(--v-muted); font-size: 15px;
}
.tvd-x:hover { background: rgba(225, 29, 72, .12); color: var(--v-red); }

.tvd-sheet-body { padding: 20px 24px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 16px; -webkit-overflow-scrolling: touch; }
.tvd-sheet-foot {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 14px 24px;
    border-top: 1px solid var(--v-border);
    background: var(--v-card-solid);
}
.tvd-sheet-foot .tvd-btn-primary { min-width: 150px; }

.tvd-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tvd-span-2 { grid-column: 1 / -1; }

.tvd-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tvd-field > label { font-size: 13px; font-weight: 700; color: var(--v-text); margin: 0; }
.tvd-field > label b { color: var(--v-red); }
.tvd-field > label small { color: var(--v-muted); font-weight: 500; }

.tvd-field input[type="text"],
.tvd-field input[type="url"],
.tvd-field select,
.tvd-field textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1.5px solid var(--v-border);
    background: var(--v-input);
    color: var(--v-text);
    font-size: 14px;
    line-height: 1.8;
    box-shadow: none;
    outline: 0;
    transition: border-color .2s, box-shadow .2s;
}
.tvd-field textarea { resize: vertical; min-height: 88px; }
.tvd-field input:focus,
.tvd-field select:focus,
.tvd-field textarea:focus {
    border-color: var(--v-blue);
    box-shadow: 0 0 0 4px rgba(53, 96, 255, .14);
}
.tvd-field input[dir="ltr"] { text-align: left; }
.tvd-hint { font-style: normal; font-size: 12px; color: var(--v-muted); line-height: 1.9; }

.tvd-choice-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tvd-access-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.tvd-choice {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "i t" "i s";
    column-gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1.5px solid var(--v-border);
    background: var(--v-input);
    cursor: pointer;
    transition: .2s;
    margin: 0;
}
.tvd-choice input { position: absolute; opacity: 0; pointer-events: none; }
.tvd-choice > span {
    grid-area: i;
    width: 42px; height: 42px; border-radius: 14px;
    display: grid; place-items: center; font-size: 20px;
    background: var(--v-soft);
}
.tvd-choice strong { grid-area: t; font-size: 13.5px; font-weight: 800; color: var(--v-text); line-height: 1.7; }
.tvd-choice small { grid-area: s; font-size: 11.5px; color: var(--v-muted); line-height: 1.7; }
.tvd-choice:hover { border-color: rgba(53, 96, 255, .5); }
.tvd-choice.active {
    border-color: var(--v-blue);
    background: linear-gradient(135deg, rgba(53, 96, 255, .08), rgba(124, 58, 237, .08));
    box-shadow: 0 0 0 3px rgba(53, 96, 255, .12);
}
.tvd-choice.active > span { background: var(--v-grad); filter: none; }
.tvd-choice.active::after {
    content: "✓";
    position: absolute; left: 10px; top: 8px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--v-blue); color: #fff;
    display: grid; place-items: center; font-size: 11px; line-height: 1;
}

.tvd-section {
    display: flex; flex-direction: column; gap: 12px;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid var(--v-border);
    background: var(--v-soft);
}
.tvd-section-title { display: flex; align-items: center; gap: 12px; }
.tvd-section-title > span {
    width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
    background: var(--v-card-solid); font-size: 19px; flex: 0 0 auto;
}
.tvd-section-title strong { display: block; font-size: 14px; font-weight: 800; color: var(--v-text); }
.tvd-section-title small { display: block; font-size: 12px; color: var(--v-muted); }

.tvd-grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.tvd-chip { margin: 0; cursor: pointer; }
.tvd-chip input { position: absolute; opacity: 0; pointer-events: none; }
.tvd-chip span {
    display: block; text-align: center;
    padding: 8px 6px; border-radius: 12px;
    border: 1.5px solid var(--v-border);
    background: var(--v-card-solid);
    font-size: 12.5px; font-weight: 600; color: var(--v-text);
    transition: .18s;
}
.tvd-chip input:checked + span { background: var(--v-grad); color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(83, 66, 226, .25); }
.tvd-chip input:focus-visible + span { outline: 3px solid rgba(53, 96, 255, .35); }

.tvd-switches { display: flex; flex-direction: column; gap: 10px; }
.tvd-switch {
    display: flex; align-items: center; gap: 12px; margin: 0; cursor: pointer;
    padding: 10px 12px; border-radius: 16px; background: var(--v-card-solid); border: 1px solid var(--v-border);
}
.tvd-switch input { position: absolute; opacity: 0; pointer-events: none; }
.tvd-switch i {
    position: relative; flex: 0 0 46px; width: 46px; height: 26px; border-radius: 999px;
    background: #cdd3e6; transition: .2s;
}
.tvd-switch i::after {
    content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 40, .25); transition: .2s;
}
.tvd-switch input:checked + i { background: var(--v-blue); }
.tvd-switch input:checked + i::after { right: 23px; }
.tvd-switch strong { display: block; font-size: 13px; font-weight: 700; color: var(--v-text); }
.tvd-switch small { display: block; font-size: 11.5px; color: var(--v-muted); line-height: 1.7; }

.tvd-cover { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tvd-cover-preview {
    width: 160px; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden;
    border: 2px dashed var(--v-border); background: var(--v-soft);
    display: grid; place-items: center; font-size: 26px;
}
.tvd-cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tvd-cover-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tvd-cover-actions small { flex-basis: 100%; color: var(--v-muted); font-size: 11.5px; }

.tvd-msg { min-height: 0; font-size: 13px; font-weight: 600; border-radius: 14px; }
.tvd-msg.is-error { padding: 10px 14px; background: rgba(225, 29, 72, .1); color: var(--v-red); }
.tvd-msg.is-ok { padding: 10px 14px; background: rgba(22, 163, 74, .1); color: var(--v-green); }

/* ------------------------------------------------------------------ */
/* آپلود فایل ویدیو (پنل مدرس)                                        */
/* ------------------------------------------------------------------ */
.tvd-upload {
    border: 2px dashed var(--v-border);
    border-radius: 18px;
    background: var(--v-soft);
    padding: 18px;
}
.tvd-upload-idle { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.tvd-upload-icon { font-size: 30px; }
.tvd-upload-idle p { margin: 0; font-size: 13px; color: var(--v-text); font-weight: 600; }
.tvd-upload-idle small { color: var(--v-muted); font-size: 11.5px; }
.tvd-upload-idle .tvd-btn { margin: 4px 0; }

.tvd-upload-progress { display: flex; flex-direction: column; gap: 10px; }
.tvd-upload-bar { width: 100%; height: 10px; border-radius: 999px; background: var(--v-card-solid); overflow: hidden; border: 1px solid var(--v-border); }
.tvd-upload-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--v-grad); transition: width .2s; }
.tvd-upload-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tvd-upload-progress-row span { font-size: 12.5px; font-weight: 700; color: var(--v-text); }
.tvd-upload-progress-row .tvd-btn { padding: 6px 14px; font-size: 12px; }

.tvd-upload-done {
    display: flex; align-items: center; gap: 12px;
}
.tvd-upload-file-icon {
    flex: 0 0 46px; width: 46px; height: 46px; border-radius: 14px;
    background: var(--v-card-solid); display: grid; place-items: center; font-size: 20px;
    border: 1px solid var(--v-border);
}
.tvd-upload-file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tvd-upload-file-info b { font-size: 13.5px; color: var(--v-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvd-upload-file-info small { font-size: 11.5px; color: var(--v-muted); }

/* ------------------------------------------------------------------ */
/* پلیر ویدیوی آپلودی (پنل دانش‌آموز) — شبیه نمایشگر اپارات             */
/* ------------------------------------------------------------------ */
.tvd-player {
    position: fixed;
    inset: 0;
    z-index: 100002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    direction: rtl;
}
.tvd-player.open { display: flex; }
.tvd-player-backdrop {
    position: absolute; inset: 0;
    background: rgba(6, 8, 22, .82);
    backdrop-filter: blur(6px);
    animation: tvdFade .2s ease;
}
.tvd-player-sheet {
    position: relative;
    width: 100%;
    max-width: 980px;
    background: #0d0e1c;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
    animation: tvdPop .25s cubic-bezier(.2, .9, .3, 1.1);
    border: 1px solid rgba(255, 255, 255, .08);
}
.tvd-player-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(20, 22, 46, .95), rgba(13, 14, 28, .95));
}
.tvd-player-head b {
    font-size: 14.5px; font-weight: 800; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tvd-player-head .tvd-x { background: rgba(255, 255, 255, .1); color: #fff; flex: 0 0 auto; }
.tvd-player-head .tvd-x:hover { background: rgba(225, 29, 72, .5); color: #fff; }

.tvd-player-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}
.tvd-player-stage video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    outline: 0;
}

@media (max-width: 640px) {
    .tvd-player { padding: 0; align-items: flex-end; }
    .tvd-player-sheet { max-width: 100%; border-radius: 20px 20px 0 0; }
    .tvd-player-stage { aspect-ratio: 16 / 10; }
}

/* ------------------------------------------------------------------ */
/* Toast                                                               */
/* ------------------------------------------------------------------ */
.tvd-toast {
    position: fixed;
    z-index: 100001;
    bottom: 26px;
    left: 50%;
    transform: translate(-50%, 24px);
    opacity: 0;
    pointer-events: none;
    max-width: calc(100vw - 32px);
    padding: 12px 22px;
    border-radius: 16px;
    background: #1f2440;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 16px 40px rgba(10, 14, 50, .35);
    transition: .28s;
}
.tvd-toast.show { opacity: 1; transform: translate(-50%, 0); }
.tvd-toast.is-ok { background: linear-gradient(135deg, #16a34a, #0ea5a3); }
.tvd-toast.is-error { background: linear-gradient(135deg, #e11d48, #f97316); }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 1100px) {
    .tvd-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .tvd-hero { flex-direction: column; align-items: stretch; padding: 22px 20px; border-radius: 22px; }
    .tvd-hero h2 { font-size: 21px; }
    .tvd-hero-art { justify-content: space-between; }
    .tvd-hero-screen { flex: 1; width: auto; }
    .tvd-teacher .tvd-hero-btn { width: 100%; }
    .tvd-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tvd-metrics > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .tvd-toolbar { flex-direction: column; align-items: stretch; }
    .tvd-seg { display: flex; }
    .tvd-seg button { flex: 1; justify-content: center; padding: 10px 8px; font-size: 13px; }
    .tvd-search { min-width: 0; width: 100%; }
}

@media (max-width: 640px) {
    .tvd-grid { grid-template-columns: 1fr; gap: 14px; }
    .tvd-hero-tags b { font-size: 11.5px; }
    .tvd-hero-count { padding: 10px 14px; }
    .tvd-hero-count b { font-size: 22px; }

    .tvd-modal { padding: 0; align-items: flex-end; }
    .tvd-sheet { max-width: 100%; max-height: 94vh; border-radius: 26px 26px 0 0; animation: tvdSlide .28s ease; }
    .tvd-sheet-head { padding: 16px 18px; }
    .tvd-sheet-body { padding: 16px 18px; }
    .tvd-sheet-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); }
    .tvd-sheet-foot .tvd-btn { flex: 1; }
    .tvd-grid-2, .tvd-choice-row, .tvd-access-cards { grid-template-columns: 1fr; }
    .tvd-cover-preview { width: 100%; max-width: 260px; }
}

@keyframes tvdSlide { from { transform: translateY(100%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .tvd *, .tvd-modal *, .tvd-toast { animation: none !important; transition: none !important; }
}
