/* ==========================================================================
   Proyecto Base de Datos · Grupo 31 — tema oscuro
   ========================================================================== */
:root {
  color-scheme: dark;
  --fondo: #14181c;
  --fondo-2: #1b2128;
  --panel: #20272f;
  --panel-2: #2a323c;
  --borde: #2f3944;
  --texto: #dfe5eb;
  --suave: #8f9eac;
  --tenue: #66737f;
  --enlace: #8fd0f5;
  --enlace-hover: #c4e7fb;
  --acento: #3ccf8e;
  --acento-osc: #2aa872;
  --acento-2: #f5a54a;
  --bueno: #3ccf6e;
  --medio: #f2c94c;
  --malo: #ef5b5b;
  --radio: 10px;
  --sombra: 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  color: var(--texto);
  background:
    radial-gradient(1200px 500px at 70% -200px, rgba(60, 207, 142, .08), transparent 70%),
    radial-gradient(900px 400px at 0% -150px, rgba(245, 165, 74, .06), transparent 70%),
    var(--fondo);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

h1, h2, h3 { color: #fff; letter-spacing: -.01em; }
h1 { margin: 0.15rem 0 0.4rem; font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 1.15; }

/* --- Barra superior ------------------------------------------------------ */
.barra {
  position: sticky; top: 0; z-index: 10;
  background: rgba(20, 24, 28, .88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--borde);
}
.barra-int {
  max-width: 1180px; margin: 0 auto; padding: 0.75rem 1.25rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; align-items: center; justify-content: space-between;
}
.marca { color: #fff; font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: .6rem; }
.marca:hover { color: #fff; }
.marca-grupo { color: var(--suave); font-weight: 500; }
.marca-logo {
  width: 26px; height: 18px; display: inline-block; border-radius: 4px;
  background:
    radial-gradient(circle at 25% 50%, var(--acento-2) 0 4px, transparent 4.5px),
    radial-gradient(circle at 50% 50%, var(--acento) 0 4px, transparent 4.5px),
    radial-gradient(circle at 75% 50%, var(--enlace) 0 4px, transparent 4.5px);
}
.barra nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.barra nav a {
  color: var(--suave); font-size: .92rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; padding: .35rem .7rem; border-radius: 6px;
}
.barra nav a:hover { color: #fff; background: var(--panel); }
.barra nav a.activo { color: #fff; background: var(--panel-2); }

main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.25rem 3.5rem; flex: 1; }
footer {
  text-align: center; color: var(--tenue); font-size: .85rem; padding: 1.25rem;
  border-top: 1px solid var(--borde); display: flex; flex-direction: column; gap: .15rem;
}
.pie-nota { font-size: .78rem; }

.sub { color: var(--suave); margin-top: 0; }
.tipo {
  margin: 0; font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--acento);
}
.volver { margin: 0 0 1rem; font-size: .9rem; }
.volver a { color: var(--suave); }
.volver a:hover { color: #fff; }
.seccion {
  font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--suave);
  border-bottom: 1px solid var(--borde); padding-bottom: .5rem; margin: 2.2rem 0 1rem;
}

/* --- Notas (colores por puntaje) ------------------------------------------ */
.nota {
  display: inline-block; min-width: 2.6em; text-align: center; font-weight: 700;
  padding: .05rem .5rem; border-radius: 999px; font-variant-numeric: tabular-nums;
  border: 1px solid currentColor;
}
.nota-buena { color: var(--bueno); background: rgba(60, 207, 110, .12); }
.nota-media { color: var(--medio); background: rgba(242, 201, 76, .12); }
.nota-mala  { color: var(--malo);  background: rgba(239, 91, 91, .12); }

/* --- Inicio ---------------------------------------------------------------- */
.hero { padding: 1.5rem 0 .5rem; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); max-width: 18em; }
.hero p { color: var(--suave); max-width: 48rem; font-size: 1.05rem; }
.hero .nota { font-size: .85rem; margin: 0 .1rem; }

.cifras {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: .75rem; margin: 1.25rem 0 1.75rem;
}
.cifras div, .puntajes div {
  background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: .85rem 1rem; display: flex; flex-direction: column; gap: .15rem;
}
.cifras strong, .puntajes strong { font-size: 1.55rem; color: #fff; line-height: 1.2; }
.cifras strong.nota, .puntajes strong.nota {
  border: 0; background: none; padding: 0; text-align: left; min-width: 0; border-radius: 0;
}
.cifras strong.nota-buena, .puntajes strong.nota-buena { color: var(--bueno); }
.cifras strong.nota-media, .puntajes strong.nota-media { color: var(--medio); }
.cifras strong.nota-mala,  .puntajes strong.nota-mala  { color: var(--malo); }
.cifras span, .puntajes span { color: var(--suave); font-size: .85rem; }

.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: 1rem; }
.tarjeta {
  position: relative; display: flex; flex-direction: column; gap: .3rem;
  background: linear-gradient(160deg, var(--panel), var(--fondo-2));
  border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1.2rem 1.2rem 1rem; color: inherit; overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tarjeta:hover { color: inherit; border-color: var(--acento); transform: translateY(-3px); box-shadow: var(--sombra); }
.tarjeta-num { font-size: .8rem; font-weight: 700; color: var(--acento-2); letter-spacing: .1em; }
.tarjeta h2 { margin: 0; font-size: 1.2rem; }
.tarjeta p { margin: 0; color: var(--suave); flex: 1; }
.tarjeta-ir { color: var(--acento); font-weight: 600; font-size: .9rem; margin-top: .5rem; }

/* --- Formularios ------------------------------------------------------------ */
.formulario {
  background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1rem 1.1rem; margin: 1rem 0 1.25rem;
  display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end;
}
.campos { display: flex; flex-wrap: wrap; gap: .75rem 1rem; flex: 1; }
.campo { display: flex; flex-direction: column; min-width: 10rem; flex: 1; }
.campo label { font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); margin-bottom: .3rem; }
.campo input, .campo select, .barra-busqueda input {
  padding: .55rem .7rem; font-size: 1rem; color: var(--texto);
  background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 6px; width: 100%;
}
.campo input:focus, .campo select:focus, .barra-busqueda input:focus {
  outline: 2px solid var(--acento); outline-offset: 0; border-color: var(--acento);
}
input::placeholder { color: var(--tenue); }
.err-campo { color: var(--malo); font-size: .85rem; margin-top: .2rem; }

button {
  background: var(--acento); color: #0b1a12; border: 0; border-radius: 6px; font-weight: 700;
  padding: .6rem 1.25rem; font-size: 1rem; cursor: pointer; transition: background .15s;
}
button:hover { background: var(--acento-osc); }

.con-principal { flex-direction: column; align-items: stretch; }
.barra-busqueda { display: flex; gap: .5rem; }
.barra-busqueda input { flex: 1; min-width: 0; padding: .75rem 1rem; font-size: 1.1rem; }
.barra-busqueda button { padding: .75rem 1.5rem; font-size: 1.05rem; }
.filtros {
  display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end;
  padding-top: .8rem; border-top: 1px solid var(--borde);
}
.filtros-titulo { width: 100%; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--tenue); }
.filtros .campo { flex: 0 1 15rem; min-width: 11rem; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.error { color: var(--malo); background: rgba(239, 91, 91, .1); border: 1px solid rgba(239, 91, 91, .35); padding: .75rem .9rem; border-radius: 6px; width: 100%; }
.conteo, .vacio { color: var(--suave); }
.nulo { color: var(--tenue); }

/* --- Tablas ----------------------------------------------------------------- */
.tabla { overflow-x: auto; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--fondo-2); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .55rem .8rem; text-align: left; border-bottom: 1px solid var(--borde); vertical-align: middle; }
th {
  background: var(--panel); font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--suave); white-space: nowrap; position: sticky; top: 0;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--panel); }
td a { font-weight: 500; }
td a:hover { text-decoration: underline; }
.con-img { display: inline-flex; align-items: center; gap: .65rem; }

/* --- Imágenes (póster / retrato) ------------------------------------------- */
.img {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  background-color: var(--panel-2); background-size: cover; background-position: center top;
  border: 1px solid var(--borde); overflow: hidden; position: relative;
}
.img.cargada .ini { visibility: hidden; }
.img.cargada::before { display: none; }

.poster { border-radius: 4px; aspect-ratio: 2 / 3; }
.poster::before {           /* marcador: ícono de claqueta */
  content: ""; width: 46%; aspect-ratio: 1; opacity: .35;
  background:
    linear-gradient(var(--suave), var(--suave)) top / 100% 22% no-repeat,
    linear-gradient(var(--suave), var(--suave)) bottom / 100% 62% no-repeat;
  border-radius: 2px;
}
.avatar { border-radius: 50%; aspect-ratio: 1; }
.ini { font-weight: 700; color: var(--suave); letter-spacing: .02em; }

.poster.sm { width: 32px; }
.avatar.sm { width: 34px; }
.avatar.sm .ini { font-size: .7rem; }
.avatar.md { width: 44px; }
.avatar.md .ini { font-size: .8rem; }
.avatar.lg { width: 150px; box-shadow: var(--sombra); }
.avatar.lg .ini { font-size: 2.6rem; }
.poster.xl { width: 230px; border-radius: 8px; box-shadow: var(--sombra); }

/* --- Cabecera de páginas de detalle ---------------------------------------- */
.cabecera { display: flex; gap: 1.75rem; align-items: center; flex-wrap: wrap; }
.cabecera-texto { flex: 1; min-width: 16rem; }
.cabecera .cifras { margin-bottom: 0; }

/* --- Ficha de película ------------------------------------------------------ */
.ficha { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: start; }
.ficha-info { min-width: 0; }
.ficha .anho { color: var(--suave); font-weight: 400; }
.meta { color: var(--suave); margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.etiquetas { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.etiqueta {
  font-size: .8rem; font-weight: 600; padding: .2rem .65rem; border-radius: 999px;
  background: var(--panel-2); color: var(--texto); border: 1px solid var(--borde);
}
.etiqueta:hover { border-color: var(--acento); color: #fff; }
.personas { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; margin: .4rem 0 1rem; }
.personas-titulo { width: 100%; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--tenue); }
.persona { display: inline-flex; align-items: center; gap: .55rem; color: var(--texto); font-weight: 600; }
.persona:hover { color: #fff; }
.descripcion { max-width: 52rem; color: #c4ccd4; font-size: 1.02rem; }
.puntajes { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem; margin: 1.25rem 0 0; max-width: 36rem; }
.puntajes strong { font-size: 2rem; }

.reparto { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem; }
.reparto-item {
  display: flex; align-items: center; gap: .7rem; padding: .5rem .65rem;
  background: var(--fondo-2); border: 1px solid var(--borde); border-radius: var(--radio); color: var(--texto);
}
.reparto-item:hover { border-color: var(--acento); color: #fff; }
.reparto-texto { display: flex; flex-direction: column; min-width: 0; }
.reparto-texto strong { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reparto-texto small { color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Responsivo ------------------------------------------------------------- */
@media (max-width: 640px) {
  .ficha { grid-template-columns: 1fr; }
  .poster.xl { width: 160px; }
  .avatar.lg { width: 110px; }
  .barra-busqueda { flex-direction: column; }
}
