/* ============================================================
   EGL Nurture Signal — tema "mission control"
   Marca:  primario #DB0F6C · secundario #0586B1 · fondo #100D3A
   ============================================================ */

:root {
  --bg:        #100D3A;
  --bg-soft:   #17134a;
  --panel:     #1a1551;
  --card:      #1f1a5e;
  --card-2:    #241e6b;
  --line:      rgba(255, 255, 255, 0.09);
  --line-2:    rgba(255, 255, 255, 0.16);

  --primary:   #DB0F6C;
  --primary-2: #ff2e86;
  --primary-soft: rgba(219, 15, 108, 0.16);
  --secondary: #0586B1;
  --secondary-2: #2bb6e0;
  --secondary-soft: rgba(5, 134, 177, 0.16);

  --text:  #ECEAFB;
  --muted: #9c97c8;
  --hot:   #ff3d88;
  --ok:    #2bb6e0;
  --warn:  #f4b740;

  --display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  --glow: 0 0 0 1px var(--primary-soft), 0 14px 38px -16px rgba(219, 15, 108, 0.55);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(820px 520px at 8% -12%, rgba(219, 15, 108, 0.20), transparent 60%),
    radial-gradient(760px 520px at 102% -6%, rgba(5, 134, 177, 0.18), transparent 58%),
    radial-gradient(900px 700px at 50% 120%, rgba(5, 134, 177, 0.10), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--secondary-2); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary-2); }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: 2rem; margin: 0 0 .8rem; }
h2 { font-size: 1.3rem; margin: 0 0 .6rem; }
h3 { font-size: 1.02rem; margin: 0 0 .5rem; }
small { color: var(--muted); font-weight: 400; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.6rem;
  background: rgba(16, 13, 58, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--display); font-weight: 800; font-size: 1.2rem;
  color: var(--text); letter-spacing: -0.03em;
}
.brand:hover { color: var(--text); }
.topbar nav { display: flex; gap: .35rem; }
.topbar nav a {
  color: var(--muted); font-weight: 600; font-size: .92rem;
  padding: .4rem .85rem; border-radius: 999px; position: relative;
}
.topbar nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.topbar nav a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #b00b58);
  box-shadow: 0 8px 20px -10px var(--primary);
}

/* ── Layout ─────────────────────────────────────────────── */
.container { max-width: 1140px; margin: 0 auto; padding: 2.2rem 1.6rem 3rem; }
.foot {
  text-align: center; color: var(--muted); font-size: .82rem;
  padding: 2.5rem 1rem; border-top: 1px solid var(--line); margin-top: 2rem;
}

/* ── Flash ──────────────────────────────────────────────── */
.flash {
  padding: .8rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.3rem;
  font-size: .92rem; font-weight: 500; border: 1px solid transparent;
}
.flash.ok { background: var(--secondary-soft); border-color: var(--secondary); color: #cdeefa; }
.flash.error { background: var(--primary-soft); border-color: var(--primary); color: #ffd3e6; }

/* ── Panels / cards ─────────────────────────────────────── */
.panel, .card-form, .side-card, .reco, .transcript {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.panel { margin-bottom: 1.6rem; }
.hint { color: var(--muted); font-size: .9rem; }
.small { font-size: .82rem; }
.muted { color: var(--muted); }
.empty {
  color: var(--muted); padding: 3rem; text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--radius); background: rgba(255,255,255,.02);
}

/* ── Forms ──────────────────────────────────────────────── */
input, textarea, select, button { font: inherit; }
input[type=text], input[type=url], input[type=search], input[type=password], textarea, select {
  width: 100%; margin-top: .3rem;
  background: rgba(0,0,0,.22);
  border: 1px solid var(--line-2); color: var(--text);
  border-radius: var(--radius-sm); padding: .65rem .8rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: #6f6aa0; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--secondary);
  box-shadow: 0 0 0 3px var(--secondary-soft);
}
textarea { resize: vertical; }
label { display: block; margin-bottom: .9rem; font-size: .88rem; color: var(--muted); font-weight: 500; }

button {
  background: rgba(255,255,255,.06); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: .65rem 1.1rem; cursor: pointer; font-weight: 600;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
button:hover { border-color: var(--line-2); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button.primary {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  border-color: transparent; color: #fff;
  box-shadow: 0 12px 26px -12px var(--primary);
}
button.primary:hover { box-shadow: 0 16px 34px -10px var(--primary); }
button.ghost { background: transparent; }
button.ghost:hover { border-color: var(--secondary); color: var(--secondary-2); }

.ingest { display: flex; gap: .6rem; margin: .4rem 0 .7rem; }
.ingest input { flex: 1; margin-top: 0; }
.ingest button { white-space: nowrap; }

/* ── Filters ────────────────────────────────────────────── */
.filters { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; }
.tabs a {
  color: var(--muted); padding: .4rem .9rem; border-radius: 999px;
  font-size: .87rem; font-weight: 600; border: 1px solid transparent;
}
.tabs a:hover { color: var(--text); border-color: var(--line-2); }
.tabs a.on { background: var(--secondary-soft); color: var(--secondary-2); border-color: var(--secondary); }
.search input { width: 240px; margin-top: 0; }

/* ── Grid de vídeos ─────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.2rem; }
.card {
  background: linear-gradient(180deg, var(--card), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: block; color: var(--text);
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: var(--glow); text-decoration: none; }
.card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; border-bottom: 1px solid var(--line); }
.card-body { padding: 1.05rem 1.1rem 1.2rem; }
.card-body h3 { margin: .5rem 0 .4rem; font-size: 1.05rem; }
.card-body .muted { font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: var(--muted); font-size: .76rem; margin-top: .7rem; font-family: var(--mono); }

/* ── Badges / tags ──────────────────────────────────────── */
.badge {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: .22rem .6rem; border-radius: 999px;
  font-family: var(--mono); border: 1px solid transparent;
}
.status-active { background: var(--secondary-soft); color: var(--secondary-2); border-color: rgba(5,134,177,.5); }
.status-pending_review { background: var(--primary-soft); color: var(--primary-2); border-color: rgba(219,15,108,.5); }
.status-archived { background: rgba(255,255,255,.06); color: var(--muted); border-color: var(--line-2); }
.badge.conf { background: var(--secondary-soft); color: var(--secondary-2); }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.tag {
  font-size: .73rem; font-weight: 600; padding: .2rem .55rem; border-radius: 7px;
  background: rgba(255,255,255,.06); color: var(--text);
}
.tag.dolor { background: var(--primary-soft); color: var(--primary-2); }
.tag.fase { background: var(--secondary-soft); color: var(--secondary-2); }
.tag.objecion { background: rgba(244,183,64,.16); color: var(--warn); }
.muted-tag { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); }

/* ── Detalle del vídeo ──────────────────────────────────── */
.back { display: inline-block; margin-bottom: 1.2rem; color: var(--muted); font-weight: 600; }
.back:hover { color: var(--secondary-2); }
.detail { display: grid; grid-template-columns: 1.9fr 1fr; gap: 1.4rem; }
.detail-side { display: flex; flex-direction: column; gap: 1.1rem; }
.vid-head { display: flex; gap: 1.1rem; margin-bottom: 1.3rem; }
.thumb { width: 190px; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.vid-head h1 { font-size: 1.5rem; margin: .35rem 0 .3rem; }
.ext { font-size: .86rem; font-weight: 600; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.tag-checks { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .9rem; }
.tag-check { display: flex; align-items: center; gap: .55rem; margin: 0; cursor: pointer; padding: .3rem .4rem; border-radius: 8px; }
.tag-check:hover { background: rgba(255,255,255,.04); }
.tag-check input { width: auto; margin: 0; accent-color: var(--primary); }
.tag-check small { margin-left: auto; font-family: var(--mono); font-size: .72rem; }
.add-tag { display: flex; gap: .5rem; margin-bottom: 1.1rem; }
.add-tag select { width: 130px; }
.transcript p { color: var(--muted); font-size: .88rem; max-height: 300px; overflow: auto; margin-top: .6rem; }
.transcript summary { cursor: pointer; font-weight: 600; color: var(--secondary-2); }
.status-actions { display: flex; flex-direction: column; gap: .55rem; margin-bottom: .3rem; }
.mini-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: .5rem .2rem; border-bottom: 1px solid var(--line); font-size: .85rem;
}
.mini-link:last-child { border-bottom: none; }
.mini-link code { font-size: .78rem; }
.hot { color: var(--hot); font-weight: 700; }

/* ── Recomendación ──────────────────────────────────────── */
.reco-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.reco-card {
  display: flex; gap: 1.1rem; margin: 1.1rem 0;
  background: rgba(0,0,0,.18); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem;
}
.reco-card img { width: 220px; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.why { font-size: .92rem; }
.why b { color: var(--primary-2); }
.reco-send { margin-top: 1.2rem; }
.alts { margin-top: 1.3rem; }
.alts h4 { font-family: var(--display); margin: 0 0 .6rem; color: var(--muted); }
.alt { display: block; padding: .65rem .9rem; background: rgba(0,0,0,.18); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .5rem; font-weight: 600; }
.alt:hover { border-color: var(--secondary); }

/* ── Tablas ─────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.table th { color: var(--muted); font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
.table tr:hover td { background: rgba(255,255,255,.025); }
.ellipsis { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
code {
  background: rgba(0,0,0,.3); padding: .12rem .45rem; border-radius: 6px;
  font-family: var(--mono); font-size: .82em; color: var(--secondary-2); border: 1px solid var(--line);
}

/* ── Detalle de link ────────────────────────────────────── */
.link-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.url-card { grid-column: 1 / -1; }
.side-card.full { grid-column: 1 / -1; }
.copy-row { display: flex; gap: .5rem; margin: .7rem 0 1.1rem; }
.copy-row input, .copy-row textarea { margin-top: 0; font-family: var(--mono); font-size: .85rem; }
.copy-row button { white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.stats > div {
  background: rgba(0,0,0,.2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .9rem .7rem; text-align: center;
}
.stats b { display: block; font-size: 1.35rem; font-family: var(--mono); font-weight: 700; color: var(--primary-2); }
.stats span { color: var(--muted); font-size: .73rem; }
.message-box { background: rgba(0,0,0,.22); padding: 1rem; border-radius: var(--radius-sm); white-space: pre-wrap; border: 1px solid var(--line); font-size: .92rem; }

/* ── Responsive ─────────────────────────────────────────── */
/* ── Login ──────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card {
  width: 100%; max-width: 380px;
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2rem; box-shadow: var(--shadow);
}
.auth-brand { font-family: var(--display); font-weight: 800; font-size: 1.3rem; margin-bottom: .3rem; }
.topbar nav a.logout { color: var(--muted); }
.topbar nav a.logout:hover { color: var(--hot); background: transparent; }

@media (max-width: 820px) {
  .detail, .link-detail { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .vid-head { flex-direction: column; }
  .thumb { width: 100%; }
  h1 { font-size: 1.6rem; }
  .container { padding: 1.4rem 1rem 2.5rem; }
}
