/* zero2hero — admin: Clases muestra (page-scoped styles)
   Depends on admin.css tokens. Scoped under #admin-sample-classes / .smpa-drawer. */

/* ── List rows ─────────────────────────────────────────────────────── */
body.adm-body .adm-content #admin-sample-classes .smpa-row {
  display: grid;
  grid-template-columns: auto 128px minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  cursor: default;
}
body.adm-body .adm-content #admin-sample-classes .smpa-row.is-dragging { opacity: 0.45; }
body.adm-body .adm-content #admin-sample-classes .smpa-row.is-drop-target {
  border-color: var(--adm-violet) !important;
  box-shadow: 0 -2px 0 0 var(--adm-violet);
}
body.adm-body .adm-content #admin-sample-classes .smpa-row.is-saved { animation: smpa-flash 1.6s ease-out; }
body.adm-body .adm-content #admin-sample-classes .smpa-row.is-draft { background: var(--adm-surface-2); }
@keyframes smpa-flash {
  0% { background: var(--adm-violet-soft); border-color: var(--adm-violet-line); }
  100% { background: var(--adm-surface); }
}

.smpa-handle {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  min-width: 44px;
  color: var(--adm-muted-2);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.smpa-handle:active { cursor: grabbing; }
.smpa-handle__pos {
  font-family: var(--adm-font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--adm-violet-strong);
  background: var(--adm-violet-soft);
  border: 1px solid var(--adm-violet-line);
  border-radius: 999px;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}
.smpa-move { display: flex; gap: 0.25rem; }
.smpa-move .adm-act { padding-inline: 0.5rem; min-height: 30px; }

.smpa-thumb {
  position: relative;
  width: 128px;
  aspect-ratio: 16 / 9;
  border-radius: var(--adm-radius-sm);
  border: 1px solid var(--adm-border);
  background: #0f0b1f;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.6);
}
.smpa-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; border: 0; border-radius: 0; }
.smpa-thumb__play {
  position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.6rem; padding-left: 2px; color: #fff; background: rgba(15, 11, 31, 0.75); border: 1px solid rgba(255, 255, 255, 0.3);
}
.smpa-thumb__dur {
  position: absolute; right: 4px; bottom: 4px; z-index: 1; font-family: var(--adm-font-mono); font-size: 0.62rem;
  color: #fff; background: rgba(0, 0, 0, 0.72); padding: 0.1rem 0.35rem; border-radius: 4px;
}
.smpa-row.is-draft .smpa-thumb img { opacity: 0.55; filter: grayscale(0.5); }

.smpa-body { display: grid; gap: 0.3rem; min-width: 0; }
.smpa-title {
  font-family: var(--adm-font-head);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
}
.smpa-desc {
  color: var(--adm-muted);
  font-size: 0.82rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.smpa-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font-size: 0.78rem; color: var(--adm-muted); align-items: center; }
.smpa-meta i { margin-right: 0.25rem; }
.smpa-links a { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; font-weight: 600; text-decoration: none; }
.smpa-links a:hover { text-decoration: underline; }
.smpa-actions { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; }

/* skeleton rows */
.smpa-skel { display: grid; grid-template-columns: 44px 128px 1fr; gap: 0.9rem; align-items: center; }
.smpa-skel .adm-skeleton:first-child { height: 28px; width: 28px; border-radius: 999px; }
.smpa-skel__thumb { height: 72px !important; border-radius: var(--adm-radius-sm) !important; }
.smpa-skel__lines { display: grid; gap: 0.5rem; }

/* toolbar filter */
.smpa-seg { display: inline-flex; border: 1px solid var(--adm-border); border-radius: var(--adm-radius-sm); overflow: hidden; background: var(--adm-surface); }
.smpa-seg button {
  border: 0; background: transparent; padding: 0.4rem 0.85rem; font-size: 0.8rem; font-weight: 600; color: var(--adm-muted); cursor: pointer;
  font-family: var(--adm-font-body);
}
.smpa-seg button.is-active { background: var(--adm-ink); color: #fff; }
.smpa-seg button:focus-visible { outline: 0; box-shadow: var(--adm-ring); }

/* ── Drawer (create / edit) ────────────────────────────────────────── */
.smpa-drawer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 11, 31, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
}
.smpa-drawer[hidden] { display: none; }
.smpa-drawer__panel {
  width: min(600px, 100%);
  height: 100%;
  background: var(--adm-surface);
  border-left: 1px solid var(--adm-border);
  box-shadow: var(--adm-shadow-lg);
  display: flex;
  flex-direction: column;
  animation: smpa-slide 0.22s var(--adm-ease);
}
@keyframes smpa-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.smpa-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--adm-border);
}
.smpa-drawer__head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.smpa-drawer__head p { margin: 0; color: var(--adm-muted); font-size: 0.8rem; }
.smpa-drawer__close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--adm-border);
  background: var(--adm-surface);
  color: var(--adm-muted);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.smpa-drawer__close:hover { color: var(--adm-violet-strong); border-color: var(--adm-violet-line); background: var(--adm-violet-soft); }
.smpa-drawer__body { flex: 1 1 auto; overflow-y: auto; padding: 1.1rem 1.3rem 1.5rem; }
.smpa-drawer__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.9rem 1.3rem;
  border-top: 1px solid var(--adm-border);
  background: var(--adm-surface-2);
}

/* live YouTube preview inside the drawer */
.smpa-preview {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  background: var(--adm-surface-2);
  margin-top: 0.6rem;
}
.smpa-preview__thumb {
  position: relative; width: 160px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;
  background: #0f0b1f; border: 1px solid var(--adm-border); display: grid; place-items: center; color: rgba(255, 255, 255, 0.5);
}
.smpa-preview__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.smpa-preview__text { display: grid; gap: 0.25rem; min-width: 0; }
.smpa-preview__text strong { font-size: 0.88rem; }
.smpa-preview__text small { color: var(--adm-muted); font-size: 0.78rem; }
.smpa-preview__id { font-family: var(--adm-font-mono); font-size: 0.78rem; color: var(--adm-violet-strong); }
.smpa-preview.is-invalid { border-color: var(--adm-danger-line); background: var(--adm-danger-soft); }
.smpa-preview.is-invalid .smpa-preview__thumb { background: var(--adm-surface-3); color: var(--adm-danger); }
.smpa-preview.is-empty { border-style: dashed; }

.smpa-switches { display: grid; gap: 0.6rem; }
.smpa-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 0.9rem; border: 1px solid var(--adm-border); border-radius: var(--adm-radius-sm); background: var(--adm-surface-2);
}
.smpa-switch__text { display: grid; gap: 0.1rem; }
.smpa-switch__text strong { font-size: 0.88rem; }
.smpa-switch__text small { color: var(--adm-muted); font-size: 0.76rem; }
.smpa-switch .form-check { margin: 0; min-height: 0; padding-left: 0; }
.smpa-switch .form-check-input { margin-left: 0; width: 2.6em; height: 1.4em; cursor: pointer; }
.smpa-switch .form-check-input:checked { background-color: var(--adm-violet); border-color: var(--adm-violet); }

@media (max-width: 767.98px) {
  body.adm-body .adm-content #admin-sample-classes .smpa-row { grid-template-columns: minmax(0, 1fr); gap: 0.7rem; }
  .smpa-handle { grid-auto-flow: column; justify-content: start; align-items: center; gap: 0.6rem; }
  .smpa-thumb { width: 100%; }
  .smpa-actions { justify-content: flex-start; }
  .smpa-skel { grid-template-columns: 44px 1fr; }
  .smpa-skel__thumb { grid-column: 2; }
  .smpa-skel__lines { grid-column: 2; }
  .smpa-drawer__panel { width: 100%; }
  .smpa-preview { grid-template-columns: 1fr; }
  .smpa-preview__thumb { width: 100%; }
}

/* ── Confirm dialog content (rendered inside #adm-confirm, outside the page) ── */
.smpa-confirm { display: flex; gap: 0.8rem; align-items: center; }
.smpa-confirm__thumb { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--adm-border); flex: 0 0 auto; }

/* search input: make room for the icon (beats admin.css specificity) */
body.adm-body .adm-content #admin-sample-classes .adm-toolbar__search .form-control { padding-left: 2.3rem; }
