/* ============================================================
   STBAMBU — CSS
   Fuentes: Bebas Neue + DM Sans (Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0a0a0f;
  --surface:  #13131a;
  --border:   #1e1e2e;
  --text:     #e8e8f0;
  --muted:    #55556a;
  --nf:       #e50914;
  --prime:    #00a8e0;
  --crunchy:  #f47521;
  --disney:   #113ccf;
  --hbo:      #7b2fff;
  --paramou:  #3151ed;
  --universal:#0057a8;
  --green:    #22c55e;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── SCROLLBAR ─────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--nf); border-radius: 3px; }

/* ══════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════ */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: rgba(10,10,15,0.97);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.nav-logo {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.6rem;
  letter-spacing: 2px;
  color: var(--nf);
  text-decoration: none;
}
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-user  { font-size: .85rem; color: var(--muted); }
.nav-link {
  font-size: .85rem;
  padding: .4rem .9rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all .2s;
  white-space: nowrap;
}
.nav-link:hover  { border-color: var(--muted); }
.nav-admin       { color: #f59e0b; border-color: rgba(245,158,11,.3); }
.nav-logout      { color: #f87171; }

/* ══════════════════════════════════════════
   HERO
   ══════════════════════════════════════════ */
.hero {
  padding: 3.5rem 2rem 2rem;
  text-align: center;
}
.hero h1 {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  letter-spacing: 3px;
  line-height: 1;
  margin-bottom: .75rem;
}
.hero h1 span { color: var(--nf); }
.hero p { color: var(--muted); font-size: .95rem; }

/* ══════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════ */
.section {
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.section-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.4rem;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* ══════════════════════════════════════════
   SERVICIOS (tarjetas simples)
   ══════════════════════════════════════════ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
  margin-bottom: 2.5rem;
}
.svc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.svc-card:hover  { border-color: var(--muted); transform: translateY(-1px); }
.svc-card.active { border-color: var(--accent-clr, var(--nf)); background: rgba(255,255,255,.03); }

.svc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-netflix   { background: var(--nf); }
.dot-prime     { background: var(--prime); }
.dot-crunchy   { background: var(--crunchy); }
.dot-disney    { background: var(--disney); }
.dot-hbomax    { background: var(--hbo); }
.dot-paramount { background: var(--paramou); }
.dot-universal { background: var(--universal); }

.svc-name { font-size: .9rem; font-weight: 600; }
.svc-tag  { font-size: .72rem; color: var(--muted); margin-top: 2px; }

/* ══════════════════════════════════════════
   PANEL DE CÓDIGO
   ══════════════════════════════════════════ */
.code-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}
.code-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--nf), #ff4d4d, transparent);
}
.code-panel h2 {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.5rem;
  letter-spacing: 2px;
  margin-bottom: 1.25rem;
}

/* ── FORM ── */
.form-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.form-group { display: flex; flex-direction: column; gap: .4rem; flex: 1; min-width: 180px; }
.form-group label { font-size: .78rem; color: var(--muted); font-weight: 500; }
.form-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .65rem 1rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  outline: none;
  transition: border .2s;
  width: 100%;
}
.form-input:focus  { border-color: var(--nf); }
.form-input[readonly] { color: var(--muted); cursor: default; }
.form-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .65rem 1rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  outline: none;
  transition: border .2s;
  width: 100%;
  cursor: pointer;
}
.form-select:focus { border-color: var(--nf); }

code.code-display {
  font-family: monospace;
  background: rgba(255,255,255,.06);
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .85rem;
  letter-spacing: 2px;
  color: var(--text);
}

/* ── BOTONES ── */
.btn {
  padding: .65rem 1.4rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary          { background: var(--nf); color: #fff; width: 100%; justify-content: center; }
.btn-primary:hover    { background: #c4070f; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(229,9,20,.3); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary.btn-inline { width: auto; }
.btn-sm { padding: .3rem .75rem; font-size: .78rem; border-radius: 6px; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-danger  { background: rgba(239,68,68,.15); color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-toggle  { background: rgba(0,168,224,.12); color: #60c8f0; border: 1px solid rgba(0,168,224,.2); }
.btn-toggle:hover { background: rgba(0,168,224,.2); }

/* ── RESULTADO ── */
.result-box { margin-top: 1.25rem; display: none; }

.result-loading {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  color: var(--muted);
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-error {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  color: #f87171;
  font-size: .9rem;
}
.result-success {
  background: rgba(34,197,94,.07);
  border: 1px solid rgba(34,197,94,.25);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.result-success .label {
  font-size: .75rem;
  color: var(--green);
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: .5rem;
}
.code-display-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.code-value {
  font-family: 'Bebas Neue', cursive;
  font-size: 3rem;
  letter-spacing: 8px;
  color: #fff;
  line-height: 1;
}
.btn-copy {
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .4rem .8rem;
  color: var(--text);
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: 'DM Sans', sans-serif;
}
.btn-copy:hover  { background: rgba(255,255,255,.13); }
.btn-copy.copied { border-color: var(--green); color: var(--green); }

/* ══════════════════════════════════════════
   HISTORIAL / TABLA
   ══════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 480px; }
thead tr { background: var(--surface); }
th { padding: .75rem 1rem; text-align: left; color: var(--muted); font-weight: 500; font-size: .78rem; letter-spacing: .5px; white-space: nowrap; }
td { padding: .7rem 1rem; border-top: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,.02); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Badges servicio ── */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 5px; font-size: .72rem; font-weight: 700; letter-spacing: .5px; white-space: nowrap; }
.badge-netflix     { background: rgba(229,9,20,.15);   color: #f87171; }
.badge-prime       { background: rgba(0,168,224,.15);  color: #60c8f0; }
.badge-crunchyroll { background: rgba(244,117,33,.15); color: #fb923c; }
.badge-disney      { background: rgba(17,60,207,.15);  color: #818cf8; }
.badge-hbomax      { background: rgba(123,47,255,.15); color: #c084fc; }
.badge-paramount   { background: rgba(49,81,237,.15);  color: #818cf8; }
.badge-universal   { background: rgba(0,87,168,.15);   color: #60a5fa; }

/* ── Badges rol ── */
.badge-admin { background: rgba(245,158,11,.12); color: #f59e0b; border: 1px solid rgba(245,158,11,.25); border-radius: 5px; padding: .2rem .6rem; font-size: .72rem; font-weight: 700; }
.badge-user  { background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: .2rem .6rem; font-size: .72rem; font-weight: 700; }

/* ── Status ── */
.status { display: inline-block; padding: .2rem .55rem; border-radius: 5px; font-size: .75rem; font-weight: 500; white-space: nowrap; }
.status-success { background: rgba(34,197,94,.12);  color: var(--green); }
.status-error   { background: rgba(239,68,68,.12);  color: #f87171; }
.status-pending { background: rgba(234,179,8,.12);  color: #fbbf24; }

.inline-code {
  font-family: monospace;
  background: rgba(255,255,255,.06);
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .9rem;
  letter-spacing: 2px;
}
.text-muted { color: var(--muted); font-size: .85rem; }
.row-inactive td { opacity: .45; }

/* ══════════════════════════════════════════
   ALERTAS
   ══════════════════════════════════════════ */
.alert { padding: .75rem 1rem; border-radius: 8px; font-size: .875rem; margin-bottom: 1rem; }
.alert-error   { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25); color: #f87171; }
.alert-success { background: rgba(34,197,94,.08);  border: 1px solid rgba(34,197,94,.25);  color: #86efac; }

/* ══════════════════════════════════════════
   ADMIN
   ══════════════════════════════════════════ */
.admin-container { padding: 2rem; max-width: 1100px; margin: 0 auto; }
.page-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 2rem;
  letter-spacing: 3px;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.page-title span { color: var(--nf); }

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.2rem;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; text-align: center; }
.stat-num  { font-family: 'Bebas Neue', cursive; font-size: 2.5rem; letter-spacing: 2px; color: var(--nf); line-height: 1; }
.stat-label { font-size: .75rem; color: var(--muted); margin-top: .25rem; }

/* ══════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background-image: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(229,9,20,.08), transparent);
}
.login-wrapper {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.login-logo {
  font-family: 'Bebas Neue', cursive;
  font-size: 2.6rem;
  letter-spacing: 4px;
  color: var(--nf);
}
.login-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--nf), #ff4d4d, transparent);
}
.login-subtitle {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.3rem;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.login-form .form-group { margin-bottom: 1rem; flex: unset; min-width: unset; }
.btn-submit {
  width: 100%;
  margin-top: .5rem;
  padding: .75rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: var(--nf);
  color: #fff;
  letter-spacing: .5px;
  transition: background .2s, transform .15s;
}
.btn-submit:hover  { background: #c4070f; transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }

.login-platforms {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: center;
}
.login-platforms span {
  font-size: .7rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: .2rem .7rem;
  border-radius: 20px;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-user { display: none; }
  .hero { padding: 2.5rem 1.25rem 1.5rem; }
  .section { padding: 1.25rem; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; }
  .form-group { min-width: unset; }
  .code-panel { padding: 1.25rem; }
  .code-value { font-size: 2.2rem; letter-spacing: 5px; }
  .admin-container { padding: 1.25rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-title { font-size: 1.6rem; }
  .login-card { padding: 1.5rem; }
  .login-logo { font-size: 2rem; }
}

@media (max-width: 480px) {
  .nav-logo { font-size: 1.3rem; }
  .nav-link  { padding: .35rem .7rem; font-size: .8rem; }
  .hero h1 { letter-spacing: 2px; }
  .services-grid { gap: .5rem; }
  .svc-card { padding: .75rem; gap: .5rem; }
  .svc-name { font-size: .82rem; }
  .code-value { font-size: 1.8rem; letter-spacing: 4px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-num   { font-size: 2rem; }
  .login-wrapper { gap: 1rem; }
  .login-logo { font-size: 1.8rem; }
  .login-card { padding: 1.25rem; }
  .login-platforms span { font-size: .65rem; }
  .actions { flex-direction: column; }
  .btn-sm   { text-align: center; }
}