/* KalviYogi Shorts — Teacher Studio */

body.studio {
  overflow: auto;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(123, 77, 255, 0.16), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(255, 46, 116, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100%;
}
.studio .toasts { bottom: 24px; }

/* ---------- login ---------- */

.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%); padding: 34px 28px; border-radius: 28px; text-align: center;
  background: rgba(20, 20, 31, 0.8); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--line); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  animation: page-in 0.4s ease both;
}
.login-card img { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 16px; box-shadow: 0 14px 34px -10px rgba(255, 46, 116, 0.6); }
.login-card h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.login-card p { margin: 6px 0 24px; color: var(--text-2); }
.login-card form { display: grid; gap: 12px; text-align: left; }
.login-card .btn { width: 100%; height: 50px; margin-top: 4px; }
.login-card .back { display: inline-block; margin-top: 18px; font-size: 13.5px; color: var(--text-3); }
.login-card .back:hover { color: var(--text); }
.remember { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.remember input { accent-color: var(--brand-2); width: 16px; height: 16px; }

/* ---------- shell ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px; height: 68px; padding: 0 20px;
  background: rgba(7, 7, 12, 0.78); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.topbar .badge { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text-2); }
.topbar .spacer { flex: 1; }
@media (max-width: 820px) { .topbar .btn .label { display: none; } .topbar .btn { padding: 0 12px; } .topbar { gap: 8px; padding: 0 14px; } }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  position: relative; overflow: hidden; padding: 16px 18px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line);
}
.stat .k { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.stat .k i { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--g); color: #fff; }
.stat .k i svg { width: 15px; height: 15px; }
.stat .v { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }

.tabs {
  display: inline-flex; gap: 4px; padding: 4px; border-radius: 16px; margin-bottom: 20px;
  background: var(--surface); border: 1px solid var(--line);
}
.tabs button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; font-weight: 700; font-size: 14px; color: var(--text-2); transition: background 0.2s, color 0.2s; }
.tabs button svg { width: 18px; height: 18px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface-3); color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.tabs .n { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--bg-2); color: var(--text-3); }

.card { padding: 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.card h3 { margin: 0 0 4px; font-size: 16.5px; letter-spacing: -0.01em; }
.card .hint { margin: 0 0 16px; color: var(--text-3); font-size: 13.5px; }

/* ---------- upload ---------- */

.upload-layout { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) { .upload-layout { grid-template-columns: 1fr 380px; } .upload-side { position: sticky; top: 88px; } }

.drop {
  position: relative; display: grid; place-items: center; text-align: center; padding: 42px 20px; border-radius: 24px; cursor: pointer;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    repeating-linear-gradient(135deg, rgba(255,255,255,0.22) 0 10px, transparent 10px 18px) border-box;
  border: 2px dashed transparent; transition: transform 0.2s, background 0.2s;
}
.drop:hover { background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, repeating-linear-gradient(135deg, rgba(255,255,255,0.3) 0 10px, transparent 10px 18px) border-box; }
.drop.over { transform: scale(1.01); background: linear-gradient(rgba(255,46,116,0.12), rgba(123,77,255,0.12)) padding-box, var(--brand) border-box; }
.drop .ico {
  width: 68px; height: 68px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 14px;
  background: var(--brand); color: #fff; box-shadow: 0 14px 30px -10px rgba(255, 46, 116, 0.7);
}
.drop .ico svg { width: 30px; height: 30px; }
.drop h3 { margin: 0 0 4px; font-size: 18px; }
.drop p { margin: 0; color: var(--text-3); font-size: 13.5px; }
.drop input { display: none; }

.queue { display: grid; gap: 10px; margin-top: 16px; }
.q-item {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  animation: page-in 0.3s ease both;
}
.q-thumb { position: relative; width: 64px; aspect-ratio: 9/16; border-radius: 11px; overflow: hidden; background: var(--surface-3); }
.q-thumb img { width: 100%; height: 100%; object-fit: cover; }
.q-thumb .d { position: absolute; right: 4px; bottom: 4px; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 5px; background: rgba(0,0,0,0.65); }
.q-body { min-width: 0; display: grid; gap: 6px; }
.q-body .input { height: 40px; font-weight: 600; }
.q-body textarea.input { min-height: 60px; font-weight: 400; font-size: 14px; }
.q-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--text-3); }
.q-meta .file { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-meta button { color: var(--text-2); font-weight: 600; }
.q-meta button:hover { color: var(--text); }
.q-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.q-bar i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: inherit; transition: width 0.2s; }
.q-item.done { border-color: rgba(42, 212, 154, 0.45); }
.q-item.done .q-bar i { background: var(--ok); }
.q-item.error { border-color: rgba(255, 84, 112, 0.55); }
.q-item.error .q-bar i { background: var(--danger); width: 100% !important; }
.q-status { font-weight: 700; }
.q-item.done .q-status { color: var(--ok); }
.q-item.error .q-status { color: var(--danger); }
.q-item .icon-btn { width: 36px; height: 36px; }

.subject-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.subject-pick button {
  display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 10px; border-radius: 14px; text-align: left;
  background: var(--bg-2); border: 1px solid var(--line-strong); font-weight: 600; font-size: 13.5px; transition: border-color 0.2s, background 0.2s;
}
.subject-pick button span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-pick button:hover { background: var(--surface-2); }
.subject-pick button.active { border-color: transparent; box-shadow: 0 0 0 2px var(--brand-2); background: var(--surface-2); }
.subject-pick .dot { width: 28px; height: 28px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; font-size: 14px; }

.upload-side .card { display: grid; gap: 14px; }
.upload-side .btn.primary { width: 100%; height: 52px; font-size: 15.5px; }
.summary { font-size: 13px; color: var(--text-3); text-align: center; }

/* ---------- video list ---------- */

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search-box { flex: 1; min-width: 220px; height: 46px; }
.toolbar select.input { width: auto; min-width: 180px; }

.vlist { display: grid; gap: 8px; }
.vrow {
  display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center;
  padding: 10px 12px 10px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  transition: background 0.2s, border-color 0.2s;
}
.vrow:hover { background: var(--surface-2); }
.vrow .q-thumb { width: 54px; }
.vrow .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow .m { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 4px; font-size: 12.5px; color: var(--text-3); }
.vrow .m span { display: inline-flex; align-items: center; gap: 4px; }
.vrow .m svg { width: 14px; height: 14px; }
.vrow .pill { padding: 2px 8px 2px 3px; border-radius: 99px; background: var(--bg-2); color: var(--text-2); font-weight: 600; gap: 5px !important; }
.vrow .pill b { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; }
.vrow .acts { display: flex; gap: 6px; }
.vrow .icon-btn { width: 38px; height: 38px; }
.vrow .icon-btn.danger:hover { color: var(--danger); }

/* ---------- subjects manager ---------- */

.subj-layout { display: grid; gap: 18px; align-items: start; }
@media (min-width: 980px) { .subj-layout { grid-template-columns: 1fr 360px; } }
.subj-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.subj-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.subj-item .dot { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 21px; flex-shrink: 0; }
.subj-item .t { font-weight: 700; }
.subj-item .c { font-size: 12.5px; color: var(--text-3); }
.subj-item .icon-btn { margin-left: auto; width: 36px; height: 36px; }
.subj-item .icon-btn:hover { color: var(--danger); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 34px; height: 34px; border-radius: 11px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15); transition: transform 0.15s; }
.swatches button:hover { transform: scale(1.08); }
.swatches button.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff; }
.preview-subject { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--g); font-weight: 800; font-size: 17px; }
.preview-subject span:first-child { font-size: 28px; }


/* ---------- accounts ---------- */

.login-card .fine { margin: 16px 0 0; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.login-card code, .fine code { font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); }

.me-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: 13.5px; }
.me-chip:hover { background: var(--surface-3); }
.me-chip .label { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .me-chip .label { display: none; } .me-chip { padding: 0 3px; } }

.stat .sub { margin-top: 2px; font-size: 12.5px; color: var(--text-3); font-weight: 600; }

.tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex-shrink: 0; }
@media (max-width: 640px) { .tabs button > span:not(.n) { display: none; } .tabs button.active > span:not(.n) { display: inline; } }

.srow, .arow { grid-template-columns: 44px 1fr auto; }
.srow .avatar, .arow .avatar { width: 44px; height: 44px; font-size: 15px; }
.srow .m + .m { margin-top: 2px; }
.grade { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; vertical-align: 2px; background: rgba(255, 46, 116, 0.14); color: #ff7aa6; }
.toolbar .btn { height: 46px; }
@media (max-width: 640px) {
  .srow .acts { flex-direction: column; }
  .srow .m span:nth-child(n + 3) { display: none; }
}

/* ---------- optimizer status ---------- */

.vrow .opt { padding: 1px 8px; border-radius: 99px; font-weight: 700; font-size: 11.5px; }
.vrow .opt.busy { background: rgba(255, 200, 61, 0.14); color: #ffd36b; animation: pulse 1.6s ease-in-out infinite; }
.vrow .opt.done { background: rgba(42, 212, 154, 0.14); color: #4fe3b0; }
.vrow .opt svg { width: 12px !important; height: 12px !important; stroke-width: 3; }
@keyframes pulse { 50% { opacity: 0.55; } }
