:root {
  color-scheme: dark;
  --bc-bg: #101113;
  --bc-panel: #191a1e;
  --bc-panel-2: #202126;
  --bc-line: #34353c;
  --bc-text: #f5f5f6;
  --bc-muted: #a6a8b0;
  --bc-accent: #dc143c;
  --bc-accent-hover: #f12a50;
  --bc-success: #46c980;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bc-bg); color: var(--bc-text); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.hidden { display: none !important; }
.bc-muted { color: var(--bc-muted); }

.bc-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  font-weight: 650;
}
.bc-button.primary { background: var(--bc-accent); color: white; }
.bc-button.primary:hover { background: var(--bc-accent-hover); }
.bc-button.secondary { background: var(--bc-panel-2); border-color: var(--bc-line); color: var(--bc-text); }
.bc-button.danger { background: #8a1c31; color: white; }
.bc-button:disabled { opacity: .55; cursor: progress; }
.bc-icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--bc-line);
  border-radius: 6px;
  background: var(--bc-panel-2);
  color: var(--bc-text);
  cursor: pointer;
  font-size: 22px;
}

/* Admin */
.bc-admin-body { min-height: 100vh; }
.bc-admin-topbar {
  min-height: 68px;
  padding: 0 24px;
  border-bottom: 1px solid var(--bc-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #15161a;
}
.bc-admin-topbar > div { display: flex; align-items: baseline; gap: 12px; }
.bc-admin-topbar strong { font-size: 19px; }
.bc-admin-topbar span { color: var(--bc-muted); }
.bc-admin-topbar nav { display: flex; align-items: center; gap: 12px; }
.bc-admin-topbar a { color: var(--bc-muted); text-decoration: none; }
.bc-admin-topbar a:hover { color: var(--bc-text); }
.bc-admin-main { width: min(1500px, calc(100vw - 32px)); margin: 24px auto 48px; }
.bc-panel { background: var(--bc-panel); border: 1px solid var(--bc-line); border-radius: 8px; padding: 18px; }
.bc-login-panel { width: min(420px, 100%); }
.bc-panel h1, .bc-panel p { margin: 0; }
.bc-panel h1 { font-size: 19px; }
.bc-panel p { color: var(--bc-muted); margin-top: 5px; line-height: 1.45; }
.bc-form { display: grid; gap: 14px; margin-top: 18px; }
.bc-form label, .bc-import-grid label { display: grid; gap: 6px; color: #d3d4d8; font-size: 13px; }
.bc-form input, .bc-import-grid input, .bc-import-grid select, .bc-admin-deck-row input, .bc-admin-deck-row select {
  min-width: 0;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--bc-line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--bc-text);
  background: #111216;
}
.bc-error { min-height: 20px; color: #ff748b !important; }
.bc-admin-columns { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.bc-folder-admin { position: sticky; top: 18px; }
.bc-admin-content { display: grid; gap: 18px; }
.bc-section-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.bc-admin-tree { display: grid; gap: 5px; margin-top: 18px; }
.bc-admin-folder-row {
  min-height: 40px;
  padding-left: calc(var(--depth) * 17px + 8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #292a30;
}
.bc-admin-folder-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-admin-folder-row > div { display: flex; gap: 3px; }
.bc-admin-folder-row button {
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--bc-muted);
  cursor: pointer;
}
.bc-admin-folder-row button:hover { background: var(--bc-panel-2); color: var(--bc-text); }
.bc-import-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; margin-top: 18px; }
.bc-file-field input { padding: 6px; }
.bc-progress { height: 4px; margin-top: 16px; overflow: hidden; background: #2b2c32; }
.bc-progress span { display: block; width: 0; height: 100%; background: var(--bc-accent); transition: width .2s ease; }
.bc-status { min-height: 22px; font-size: 13px; }
.bc-admin-presentations { display: grid; gap: 8px; margin-top: 16px; }
.bc-admin-deck-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(170px, 260px) 130px auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #2c2d33;
  background: #15161a;
  border-radius: 6px;
}
.bc-admin-deck-info { min-width: 0; display: grid; gap: 5px; }
.bc-admin-deck-info input { font-weight: 650; }
.bc-admin-deck-info span { color: var(--bc-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.bc-dialog { width: min(440px, calc(100vw - 24px)); border: 1px solid var(--bc-line); border-radius: 8px; padding: 20px; background: var(--bc-panel); color: var(--bc-text); }
.bc-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.bc-dialog h2 { margin: 0; font-size: 20px; }
.bc-dialog p { min-height: 20px; margin: 0; }
.bc-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }

/* Student library */
.bc-library-body { min-height: 100vh; }
.bc-library-topbar {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--bc-line);
  background: #15161a;
}
.bc-brand, .bc-user-line { display: flex; align-items: center; gap: 11px; }
.bc-brand strong { font-size: 20px; }
.bc-brand span { padding-left: 11px; border-left: 1px solid var(--bc-line); color: var(--bc-muted); }
.bc-user-line { color: var(--bc-muted); }
.bc-library-shell { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.bc-library-sidebar { padding: 24px 16px; border-right: 1px solid var(--bc-line); background: #141519; }
.bc-sidebar-head { padding: 0 8px 18px; }
.bc-sidebar-head h1 { margin: 0; font-size: 19px; }
.bc-sidebar-head span { color: var(--bc-muted); font-size: 13px; }
.bc-folder-tree { display: grid; gap: 4px; }
.bc-folder-button {
  width: 100%;
  min-height: 40px;
  padding: 8px 9px 8px calc(9px + var(--depth) * 16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 5px;
  color: #c7c8ce;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.bc-folder-button:hover { background: #202126; }
.bc-folder-button.active { background: #2a2024; color: white; box-shadow: inset 3px 0 var(--bc-accent); }
.bc-folder-button small { color: #777982; }
.bc-library-content { min-width: 0; padding: 30px clamp(20px, 4vw, 56px) 56px; }
.bc-content-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.bc-eyebrow { margin: 0 0 5px; color: var(--bc-accent); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.bc-content-head h2 { margin: 0; font-size: 25px; }
.bc-search { width: min(280px, 40vw); display: grid; gap: 5px; color: var(--bc-muted); font-size: 12px; }
.bc-search input { height: 40px; border: 1px solid var(--bc-line); border-radius: 6px; background: #17181c; color: white; padding: 8px 11px; }
.bc-deck-list { display: grid; gap: 9px; }
.bc-deck-row {
  min-height: 104px;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 10px;
  border: 1px solid #2c2d33;
  border-radius: 7px;
  background: #17181c;
}
.bc-deck-row:hover { border-color: #474851; background: #1b1c21; }
.bc-deck-row img { width: 142px; aspect-ratio: 16 / 9; object-fit: cover; background: #090a0c; border-radius: 4px; }
.bc-deck-copy { min-width: 0; }
.bc-deck-copy h3 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.bc-deck-copy p { margin: 6px 0 0; color: var(--bc-muted); font-size: 13px; }
.bc-play-button {
  min-width: 128px;
  min-height: 42px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 6px;
  text-decoration: none;
  background: var(--bc-accent);
  color: white;
}
.bc-play-button:hover { background: var(--bc-accent-hover); }
.bc-play-button span { font-size: 13px; }
.bc-empty-library { min-height: 220px; display: grid; place-content: center; text-align: center; gap: 8px; border: 1px dashed var(--bc-line); color: var(--bc-muted); }
.bc-empty-library strong { color: var(--bc-text); }

/* Protected viewer */
.bc-viewer-body { width: 100vw; height: 100vh; overflow: hidden; background: #000; user-select: none; }
.bc-secure-stage { position: fixed; inset: 0; overflow: hidden; background: #000; }
.bc-secure-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; transition: opacity .12s linear; }
.bc-secure-stage iframe.concealed { opacity: 0; pointer-events: none; }
.bc-viewer-header {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(4, 5, 7, .84);
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .2s ease;
}
.bc-secure-stage:hover .bc-viewer-header, .bc-viewer-header:focus-within { opacity: 1; }
.bc-viewer-header > div { display: flex; gap: 12px; min-width: 0; }
.bc-viewer-header span { color: #b8bac1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-viewer-controls {
  position: absolute;
  z-index: 25;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 7px;
  background: rgba(12, 13, 16, .88);
  backdrop-filter: blur(12px);
  opacity: .25;
  transition: opacity .2s ease;
}
.bc-viewer-controls:hover, .bc-viewer-controls:focus-within { opacity: 1; }
.bc-viewer-controls button { width: 44px; height: 40px; border: 0; border-radius: 5px; background: #27292f; color: white; font-size: 23px; cursor: pointer; }
.bc-viewer-controls button:hover { background: #393b43; }
.bc-viewer-controls button.close { background: #5d1724; }
.bc-watermark-layer { position: absolute; z-index: 15; inset: 0; pointer-events: none; overflow: hidden; }
.bc-watermark-layer span {
  position: absolute;
  max-width: 48vw;
  color: rgba(255, 255, 255, .34);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
  font-size: clamp(12px, 1.15vw, 19px);
  font-weight: 750;
  line-height: 1.35;
  transform: rotate(-18deg);
  transition: left .5s ease, top .5s ease;
  white-space: nowrap;
}
.bc-secure-gate { position: absolute; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; background: #07080a; }
.bc-gate-box { width: min(520px, 100%); text-align: center; }
.bc-lock-mark { width: 58px; height: 58px; margin: 0 auto 20px; display: grid; place-items: center; border: 2px solid var(--bc-accent); color: white; font-weight: 800; }
.bc-gate-box h1 { margin: 0; font-size: 25px; }
.bc-gate-box > p, #extensionHelp p { color: var(--bc-muted); line-height: 1.55; }
#extensionHelp { margin-top: 20px; }
.bc-gate-box .bc-button { margin-top: 14px; }
.bc-text-link { display: block; margin-top: 18px; color: var(--bc-muted); }

@media (max-width: 980px) {
  .bc-admin-columns { grid-template-columns: 1fr; }
  .bc-folder-admin { position: static; }
  .bc-import-grid { grid-template-columns: 1fr 1fr; }
  .bc-admin-deck-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .bc-admin-topbar { padding: 12px 16px; align-items: start; }
  .bc-admin-topbar > div { display: grid; gap: 2px; }
  .bc-admin-topbar nav a { display: none; }
  .bc-admin-main { width: min(100% - 20px, 1500px); margin-top: 10px; }
  .bc-import-grid, .bc-admin-deck-row { grid-template-columns: 1fr; }
  .bc-library-topbar { padding: 0 14px; }
  .bc-user-line span { display: none; }
  .bc-library-shell { grid-template-columns: 1fr; }
  .bc-library-sidebar { border-right: 0; border-bottom: 1px solid var(--bc-line); padding: 16px 12px; }
  .bc-folder-tree { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bc-folder-button { padding-left: 9px; }
  .bc-library-content { padding: 22px 14px 40px; }
  .bc-content-head { align-items: stretch; display: grid; }
  .bc-search { width: 100%; }
  .bc-deck-row { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; }
  .bc-deck-row img { width: 104px; }
  .bc-play-button { grid-column: 1 / -1; }
  .bc-watermark-layer span { font-size: 11px; max-width: 85vw; }
}

@media print {
  .bc-viewer-body * { visibility: hidden !important; }
  .bc-viewer-body::after { content: "Contenido protegido · Infosquad"; visibility: visible; position: fixed; inset: 0; display: grid; place-items: center; background: white; color: black; }
}
