/* ==========================================
   ESTÁNDAR GLOBAL - ERROR 404 (Estética Retro 2000)
   ========================================== */

:root {
  --bg: #020715;
  --panel: #071536;
  --panel2: #0b1d45;
  --blue: #087cff;
  --cyan: #69edff;
  --pink: #ff67dc;
  --text: #edf5ff;
  --muted: #9db3d8;
  --border: #1768c5;
  --green: #8dffb2;
}

/* Reset básico y scroll (Corregido con asterisco) */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body {
  margin: 0;
  color: var(--text);
  font: 14px Tahoma, Verdana, sans-serif;
  background: radial-gradient(ellipse at 50% -10%, #103a83 0, transparent 50%),
              radial-gradient(#12336a 1px, transparent 1px), 
              #020715;
  background-size: auto, 9px 9px, auto;
}

a { color: inherit; }
button, input, select { font: inherit; }

/* ==========================================
   CABECERA PRINCIPAL (TOPBAR)
   ========================================== */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(#087df3, #0046bb 48%, #001742);
  border-bottom: 3px solid var(--cyan);
  box-shadow: 0 5px 20px #000a;
}
.topin {
  max-width: 1420px;
  margin: auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  font-size: 25px;
  font-weight: bold;
  white-space: nowrap;
  text-shadow: 2px 2px #00102e;
}
.brand span { color: var(--cyan); }
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: normal;
  margin-top: 3px;
}
.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}
.nav a, .nav button {
  padding: 9px 12px;
  text-decoration: none;
  font-weight: bold;
  color: white;
  background: linear-gradient(#398de9, #123b80);
  border: 1px solid #8fc9ff;
  box-shadow: inset 1px 1px #ffffff66;
}
.nav a:hover, .nav a[aria-current="page"] {
  background: linear-gradient(#ff73dc, #8e218b);
  border-color: var(--pink);
}

/* ==========================================
   ESTRUCTURA GENERAL Y LAYOUT
   ========================================== */
.page-wrapper { max-width: 1420px; margin: 0 auto; position: relative; }
.shell {
  max-width: 1220px;
  margin: 20px auto;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 16px;
}

/* Barra lateral de navegación / menú */
.side {
  position: sticky;
  top: 78px;
  align-self: start;
  background: #07132f;
  border: 1px solid var(--border);
  box-shadow: 0 0 15px #007bff55;
  padding: 10px;
}
.bar {
  padding: 8px 10px;
  background: linear-gradient(90deg, #00133c, #0069e8, #00133c);
  font-weight: bold;
  border-bottom: 1px solid #318aff;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.side a {
  display: block;
  text-decoration: none;
  padding: 10px;
  margin-top: 5px;
  background: linear-gradient(90deg, #0b2049, #07132f);
  border: 1px solid #173f78;
  color: #dcecff;
}
.side a:hover, .side a.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: #0b2c60;
}
.side .sidehead {
  margin: 15px 4px 6px;
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.side .tiny { color: var(--muted); font-size: 11px; line-height: 1.5; }

/* Contenido principal */
.main { min-width: 0; }
.crumb { font-size: 11px; color: #a5caff; margin: 0 0 12px; }

/* Heroes / Cabeceras de sección */
.hero {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background: radial-gradient(ellipse at 88% 0, #086bdf 0, transparent 45%), linear-gradient(120deg, #071333, #09295c);
  border: 1px solid #258dff;
  box-shadow: 0 0 20px #006bff44;
}
.hero:after {
  content: "404";
  position: absolute;
  right: 22px;
  bottom: -30px;
  font-size: 100px;
  font-weight: bold;
  color: #83dfff0d;
  pointer-events: none;
}
.eyebrow { color: var(--cyan); font-weight: bold; letter-spacing: 2px; font-size: 11px; }
.hero h1 { font-size: clamp(27px, 4vw, 42px); margin: 10px 0; text-shadow: 3px 3px #000; position: relative; }
.hero p { max-width: 680px; color: #c7dcff; line-height: 1.6; margin: 0; }

/* ==========================================
   COMPONENTES: TARJETAS (CARDS), FILTROS Y BOTONES
   ========================================== */
.toolbar {
  margin: 14px 0;
  background: #071432;
  border: 1px solid #1756a1;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 190px 150px;
  gap: 8px;
}
.field {
  width: 100%;
  min-width: 0;
  padding: 10px;
  background: #020b20;
  border: 1px solid #326db0;
  color: #fff;
  outline: none;
}
.field:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px #4ce8ff25; }

.stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  margin: 15px 0;
}
.stats strong { color: var(--cyan); }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card {
  background: linear-gradient(145deg, #0a1d42, #050d22);
  border: 1px solid #174e91;
  box-shadow: inset 0 1px #ffffff0a;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: #47dfff; transform: translateY(-2px); }
.cardtop { padding: 13px 13px 9px; display: flex; gap: 11px; align-items: center; }
.appicon {
  width: 52px; height: 52px; flex: 0 0 52px;
  display: grid; place-items: center; font-size: 27px;
  background: linear-gradient(145deg, #123e80, #07122d);
  border: 1px solid #287ad5;
  box-shadow: inset 0 0 12px #007bff33;
}
.appname { min-width: 0; }
.appname h2 { font-size: 15px; margin: 0 0 5px; overflow-wrap: anywhere; }
.category {
  display: inline-block; font-size: 10px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--cyan); border: 1px solid #1764ad; padding: 3px 5px;
}
.desc { font-size: 12px; color: #b6c8e8; line-height: 1.55; margin: 0; padding: 0 13px 12px; flex: 1; }
.specs { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 13px 12px; }
.spec { font-size: 10px; color: #d8e9ff; background: #0b2a51; border: 1px solid #1c5489; padding: 4px 6px; }
.cardfoot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 13px; border-top: 1px solid #16345d; background: #06102a;
}
.size { font-size: 11px; color: #a3badc; }
.download {
  border: 1px solid #8bf5ff; background: linear-gradient(#a9faff, #22bce5);
  color: #03142c; text-decoration: none; font-size: 11px; font-weight: bold; padding: 8px 10px; white-space: nowrap;
}
.download:hover { filter: brightness(1.1); }
.download.disabled { opacity: .45; cursor: not-allowed; border-color: #49617d; background: #24334b; color: #aebbd0; }

/* Paginación y Cajas de Propuesta */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 20px 0; }
.pagebtn { background: #071a3d; border: 1px solid #2262a8; color: #d9edff; padding: 8px 11px; cursor: pointer; }
.pagebtn:hover, .pagebtn.active { background: #087cff; border-color: var(--cyan); color: white; }
.pagebtn:disabled { opacity: .35; cursor: not-allowed; }
.empty { grid-column: 1/-1; padding: 30px; text-align: center; border: 1px dashed #2865a6; color: var(--muted); }

.uploadbox {
  margin-top: 16px; border: 1px dashed #2783d7; background: #06122c; padding: 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.uploadbox h3 { margin: 0 0 5px; color: var(--cyan); }
.uploadbox p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.button {
  display: inline-block; padding: 9px 12px; border: 1px solid #91f4ff; color: #03142c;
  background: linear-gradient(#a6faff, #26bce5); font-weight: bold; text-decoration: none;
}

.foot { text-align: center; color: #8fa9d1; font-size: 11px; line-height: 1.8; padding: 26px 10px; }
.foot a { color: var(--cyan); }

/* ==========================================
   RAILES / BANNERS LATERALES DE PLATAFORMAS (Separados y abiertos)
   ========================================== */
.platform-rail {
  position: absolute; top: 76px; z-index: 15; width: 112px;
  display: flex; flex-direction: column; gap: 8px; padding: 8px;
  background: linear-gradient(180deg, #050b22ee, #07163aee);
  border: 1px solid #2679db; border-radius: 7px; box-shadow: 0 0 18px #007bff45;
}
.rail-left { left: -10px; }
.rail-right { right: -10px; }
.rail-title { text-align: center; color: #a4f8ff; font: bold 9px Tahoma, Verdana, sans-serif; letter-spacing: 1px; padding: 4px 0 6px; border-bottom: 1px solid #3677d5; }
.brand-card {
  min-height: 65px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 4px; border: 1px solid #3677d5; border-radius: 4px; background: linear-gradient(145deg, #111d4c, #07112f);
  color: #e9faff; text-decoration: none; text-align: center; font-weight: bold; box-shadow: 0 0 6px #007bff35;
  transition: transform .15s, border-color .15s;
}
.brand-card:hover { transform: translateY(-2px); border-color: #73f4ff; }
.brand-card img { width: 26px; height: 26px; object-fit: contain; }
.brand-card span { font-size: 9px; overflow-wrap: anywhere; line-height: 1.1; }

/* ==========================================
   MEDIA QUERIES / RESPONSIVE DESIGN
   ========================================== */
@media(max-width: 1420px) { .platform-rail { display: none; } }
@media(max-width: 950px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar input { grid-column: 1/-1; }
}
@media(max-width: 680px) {
  .shell { grid-template-columns: 1fr; margin-top: 12px; }
  .side { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .side .bar, .side .sidehead, .side .tiny { grid-column: 1/-1; }
  .side a { margin: 0; }
  .nav { gap: 4px; }
  .nav a { padding: 8px; font-size: 12px; }
  .topin { gap: 10px; flex-wrap: wrap; }
  .brand { font-size: 22px; }
  .cards { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar input { grid-column: auto; }
  .hero { padding: 19px; }
  .hero:after { font-size: 70px; }
  .stats { align-items: flex-start; }
}
@media(prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
/* ==========================================
   WIDGETS DE INICIO: RELOJES, RADIO Y ACCESOS
   ========================================== */

/* Grilla principal de 2 columnas para el Inicio */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.card-body {
  padding: 13px;
}

/* Grilla de los Relojes (3 columnas) */
.clockgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

/* Tarjetas individuales de cada reloj */
.clock {
  padding: 10px 4px;
  text-align: center;
  background: #06122d;
  border: 1px solid #1c5291;
  box-shadow: inset 0 0 8px #00000088;
  border-radius: 3px;
}

.clock b {
  display: block;
  font-size: 11px;
  color: var(--cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.clock time {
  display: block;
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  font-size: 15px;
  color: #7df9ff;
  letter-spacing: 1px;
  text-shadow: 0 0 6px #00d2ff88;
}

.clock small {
  display: block;
  font-size: 9px;
  color: var(--pink);
  margin-top: 3px;
}

/* Widget de Radio */
.player {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #040c1e;
  border: 1px solid #163f75;
  padding: 10px;
  color: white;
}

.radio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.radio-controls .field {
  flex: 1;
  min-width: 160px;
}

/* Animación de disco girando */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Accesos directos */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.shortcut-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 12px;
  font-size: 13px;
}

.span-2 {
  grid-column: span 2;
}

/* Adaptación a dispositivos móviles */
@media (max-width: 768px) {
  .widgets-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: span 1;
  }
  .clockgrid {
    grid-template-columns: repeat(2, 1fr);
  }
}