/* ============================================================
   CineEC — Hoja de estilos principal
   Paleta: negro profundo · dorado andino · blanco cálido
   ============================================================ */

:root {
  --bg:        #0d0d0f;
  --bg-card:   #16161a;
  --bg-modal:  #1c1c22;
  --gold:      #c8962c;
  --gold-lt:   #e5b54a;
  --text:      #f0ede8;
  --text-dim:  #9a9690;
  --border:    #2a2a32;
  --red:       #c0392b;
  --green:     #27ae60;
  --radius:    10px;
  --shadow:    0 8px 32px rgba(0,0,0,.55);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; min-height: 100vh; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-lt); }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  background: rgba(13,13,15,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  padding: .85rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  font-size: 1.35rem; font-weight: 700; color: var(--gold);
  letter-spacing: .04em;
}
.nav-user { display: flex; align-items: center; gap: 1rem; color: var(--text-dim); font-size: .9rem; }

/* ── Botones ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--gold); color: #0d0d0f;
  padding: .65rem 1.5rem; border-radius: var(--radius);
  font-weight: 700; font-size: .95rem; border: none; cursor: pointer;
  transition: background .2s;
}
.btn-primary:hover { background: var(--gold-lt); color: #0d0d0f; }
.btn-full { width: 100%; text-align: center; }

.btn-outline-sm {
  border: 1px solid var(--border); color: var(--text-dim);
  padding: .35rem .9rem; border-radius: 6px; font-size: .85rem;
  background: transparent; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-outline-sm:hover { border-color: var(--gold); color: var(--gold); }

.btn-watch {
  flex: 1; background: var(--gold); color: #0d0d0f;
  border: none; border-radius: 7px; padding: .5rem .8rem;
  font-weight: 700; cursor: pointer; font-size: .85rem;
  transition: background .2s;
}
.btn-watch:hover { background: var(--gold-lt); }

.btn-download {
  flex: 1; background: transparent; color: var(--gold);
  border: 1.5px solid var(--gold); border-radius: 7px; padding: .5rem .8rem;
  font-weight: 600; cursor: pointer; font-size: .85rem;
  transition: background .2s, color .2s;
}
.btn-download:hover { background: var(--gold); color: #0d0d0f; }

.btn-play {
  background: rgba(200,150,44,.9); color: #0d0d0f;
  border: none; border-radius: 8px; padding: .7rem 1.4rem;
  font-weight: 700; font-size: 1rem; cursor: pointer;
  transform: scale(.95); transition: transform .2s, background .2s;
}
.btn-play:hover { transform: scale(1); background: var(--gold-lt); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0d0d0f 0%, #1a1206 50%, #0d0d0f 100%);
  border-bottom: 1px solid var(--border);
  padding: 3rem 1.5rem;
  text-align: center;
}
.hero h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  background: linear-gradient(90deg, var(--gold), var(--gold-lt));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: .75rem;
}
.hero p { color: var(--text-dim); max-width: 600px; margin: 0 auto; }

/* ── Catálogo ─────────────────────────────────────────────── */
.catalog { max-width: 1280px; margin: 2.5rem auto; padding: 0 1.5rem 3rem; }
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.movie-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.movie-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.movie-poster { position: relative; aspect-ratio: 2/3; overflow: hidden; background: #111; }
.movie-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 4rem; background: #1a1a22; }

.movie-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s;
}
.movie-card:hover .movie-overlay { opacity: 1; }

.movie-info { padding: 1rem; }
.movie-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; line-height: 1.3; }
.movie-meta { font-size: .78rem; color: var(--text-dim); display: flex; flex-wrap: wrap; gap: .3rem .7rem; margin-bottom: .5rem; }
.badge { background: rgba(200,150,44,.15); color: var(--gold); border: 1px solid rgba(200,150,44,.3); border-radius: 4px; padding: .15rem .5rem; font-size: .75rem; }
.movie-desc { font-size: .82rem; color: var(--text-dim); line-height: 1.5; margin: .5rem 0 .8rem; }
.movie-actions { display: flex; gap: .5rem; }

.empty-state { color: var(--text-dim); text-align: center; padding: 3rem; grid-column: 1/-1; }

/* ── Auth ─────────────────────────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-wrap { width: 100%; max-width: 420px; padding: 1.5rem; }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .logo-icon { font-size: 3rem; }
.auth-logo h1 { font-size: 2rem; color: var(--gold); }
.auth-logo p { color: var(--text-dim); font-size: .9rem; }

.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.auth-card h2 { font-size: 1.3rem; margin-bottom: 1.5rem; }
.auth-switch { text-align: center; margin-top: 1.25rem; color: var(--text-dim); font-size: .9rem; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .85rem; color: var(--text-dim); margin-bottom: .35rem; }
.field input {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 7px; padding: .65rem .9rem; color: var(--text);
  font-size: .95rem; transition: border-color .2s;
}
.field input:focus { outline: none; border-color: var(--gold); }

.alert { padding: .7rem 1rem; border-radius: 7px; font-size: .88rem; margin-bottom: 1rem; }
.alert-error  { background: rgba(192,57,43,.15); border: 1px solid rgba(192,57,43,.4); color: #e87b6e; }
.alert-success{ background: rgba(39,174,96,.15);  border: 1px solid rgba(39,174,96,.4);  color: #5cdb95; }

/* ── Modal ────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.8); }
.modal-content {
  position: relative; z-index: 1;
  background: var(--bg-modal); border: 1px solid var(--border);
  border-radius: 12px; width: 92vw; max-width: 900px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-sm { max-width: 480px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1.05rem; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 1.2rem; cursor: pointer; padding: .2rem .5rem; }
.modal-close:hover { color: var(--text); }

/* ── Video Player ─────────────────────────────────────────── */
.player-wrap { position: relative; background: #000; }
.player-wrap video {
  width: 100%; display: block;
  /* Bloquear descarga nativa */
  -webkit-user-select: none; user-select: none;
}
/* Bloquear pointer events sobre controles (parcialmente) en algunos browsers */
.player-wrap::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
}

.watermark {
  display: none;
  position: absolute;
  color: rgba(255,255,255,.18);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .05em;
  pointer-events: none;
  user-select: none;
  z-index: 10;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  transition: top .5s, bottom .5s, left .5s, right .5s;
  white-space: nowrap;
}

.player-notice { padding: .6rem 1.25rem; font-size: .8rem; color: var(--text-dim); background: rgba(200,150,44,.07); border-top: 1px solid var(--border); }
.player-error {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 2rem; background: rgba(10,10,10,.95); color: #e87b6e;
  font-size: 1rem; line-height: 1.5; z-index: 5;
}
.player-error.hidden { display: none; }
.player-error { padding: 3rem 2rem; text-align: center; color: #e87b6e; }

/* ── Descarga info ─────────────────────────────────────────── */
.download-info { padding: 1.5rem 1.25rem; }
.download-info p { margin-bottom: .75rem; line-height: 1.6; }
.expire-note { color: var(--text-dim); font-size: .9rem; }
.small-note { font-size: .78rem; color: var(--text-dim); margin-top: .75rem; }

/* ── Admin table ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--gold); font-weight: 600; background: var(--bg-card); }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
  .movie-info h3 { font-size: .9rem; }
  .nav-inner { padding: .7rem 1rem; }
}

/* Desactivar selección de texto en el player */
#playerModal { -webkit-user-select: none; user-select: none; }
