/* public/css/style.css
   Theme aligned with the yugends.fr / yugenbc.fr landings:
   dark navy gradient bg, #0096FF accent, Outfit / Montserrat / LexendDeca
   fonts, card gradients with subtle 2px rgba borders, radial blue blobs. */

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  src: local("Roboto"), url(/changelog/fonts/roboto-v30-latin-regular.woff2) format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400;
  src: local("Montserrat"), url(/changelog/fonts/Montserrat-Regular.woff2) format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Lexend Deca";
  font-style: normal;
  font-weight: 400;
  src: url(/changelog/fonts/LexendDeca.ttf) format("truetype");
  font-display: swap;
}

:root {
  /* Match the landing palette */
  --blue: #0096FF;
  --blue-soft: #58d1ef;
  --white: #ffffff;
  --text-dim: #9094a3;
  --color-background-body: radial-gradient(167.05% 112.26% at 50% -12.26%, #030E1A 0%, #060B1A 24.77%, #0D1731 100%);
  --background-card: radial-gradient(100% 100% at 50% 0%, #0F2B47 0%, #031628 100%);
  --background-card-flat: #0a1a2e;
  --gradient-button: radial-gradient(100% 100% at 50% 0%, #124271 0%, #062340 0.01%, #031323 100%);

  --outfit:    "Outfit", sans-serif;
  --montserrat: "Montserrat", sans-serif;
  --LexendDeca: "Lexend Deca", sans-serif;
  --Oswald:    "Oswald", sans-serif;

  --added:    #10b981;
  --modified: #3b82f6;
  --fixed:    #f59e0b;
  --removed:  #ef4444;

  --border-faint: 2px solid rgba(144, 148, 163, 0.20);
  --shadow-card: 1px 1px 22px #1c1c1c;
}

* { box-sizing: border-box; max-width: 100%; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}
/* Stars-tile background — same as the landing's html+body rule */
html, body {
  background: url("/changelog/images/background.png"), #19295A 0% 0% / 8.523206412792206px 8.523206412792206px repeat;
  background-blend-mode: multiply;
}
body {
  color: var(--white);
  font-family: var(--outfit);
  font-size: 16px;
  line-height: 1.55;
  position: relative;
  z-index: 0;
}

/* Radial blue blobs behind everything (same as landing) */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 2058px;
  opacity: 0.7;
  background: radial-gradient(50% 50% at 50% 50%, rgba(39, 104, 211, 0.80) 0%, rgba(29, 69, 134, 0.80) 30.73%, rgba(11, 24, 37, 0) 100%);
  filter: blur(695px);
  width: 41rem;
  height: 50rem;
  pointer-events: none;
}
body::before { top: 9rem; left: -18rem; }
body::after  { top: -10rem; right: -18rem; }

a { color: inherit; }

/* --- Topbar -------------------------------------------------------------- */
/* Horizontal padding mirrors the landing's `.container { width: 78.25rem; margin: auto }`:
   on wide viewports content starts at (100vw - 78.25rem) / 2 from the edge,
   on narrow ones it falls back to a 16px minimum. */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  padding-bottom: 16px;
  padding-left:  max(16px, calc((100vw - 78.25rem) / 2));
  padding-right: max(16px, calc((100vw - 78.25rem) / 2));
  background: rgba(6, 18, 32, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(144, 148, 163, 0.15);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  color: var(--white);
  text-decoration: none;
  font-family: var(--LexendDeca);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}
.brand:hover { color: var(--blue); }

.btn-back {
  padding: 6px 14px;
  font-size: 0.875rem;
  border: 1px solid rgba(0, 150, 255, 0.3);
  background: rgba(0, 150, 255, 0.06);
  color: var(--blue);
}
.btn-back:hover {
  border-color: var(--blue);
  background: rgba(0, 150, 255, 0.12);
  color: var(--white);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--background-card-flat);
  border: var(--border-faint);
  border-radius: 999px;
  font-family: var(--montserrat);
  font-size: 0.875rem;
}
.user-chip img { width: 22px; height: 22px; border-radius: 50%; }
.user-chip span { color: var(--white); }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 12px;
  border: var(--border-faint);
  background: var(--gradient-button);
  color: var(--white);
  text-decoration: none;
  font-family: var(--montserrat);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
  color: var(--white);
}
.btn-primary {
  background: linear-gradient(90deg, #0096FF 0%, #2768d3 100%);
  border-color: rgba(255, 255, 255, 0.12);
}
.btn-primary:hover { box-shadow: 0 6px 18px rgba(0, 150, 255, 0.35); }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--white); }
.btn-steam {
  background: #1a3a5e;
  border-color: rgba(0, 150, 255, 0.4);
}
.btn-steam:hover { background: #21476f; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.btn-danger {
  background: linear-gradient(90deg, #ef4444 0%, #b91c1c 100%);
  border-color: rgba(255, 255, 255, 0.1);
}
.btn-danger:hover { box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35); }

/* --- Layout -------------------------------------------------------------- */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 36px 20px 100px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-text { display: flex; flex-direction: column; gap: 6px; }
.page-header h1 {
  margin: 0;
  font-family: var(--LexendDeca);
  font-weight: 700;
  font-size: 2.25rem;
  color: var(--white);
  line-height: 1.15;
}
.subtitle {
  color: var(--text-dim);
  font-family: var(--montserrat);
  margin: 0;
  font-size: 0.95rem;
}

/* --- Filters ------------------------------------------------------------- */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--background-card);
  padding: 16px;
  border-radius: 16px;
  border: var(--border-faint);
  margin-bottom: 32px;
  box-shadow: var(--shadow-card);
}
.filters select,
.filters input[type="search"],
.filters input[type="text"],
.filters input[type="date"] {
  flex: 1;
  min-width: 140px;
  padding: 10px 14px;
  background: rgba(3, 22, 40, 0.7);
  color: var(--white);
  border: var(--border-faint);
  border-radius: 10px;
  font-family: var(--montserrat);
  font-size: 0.95rem;
  outline: none;
}
.filters select:focus,
.filters input:focus { border-color: var(--blue); }

/* --- Version cards ------------------------------------------------------- */
.version-card {
  background: var(--background-card);
  border: var(--border-faint);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}
.version-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.server-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--white);
  font-family: var(--montserrat);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.version-number {
  font-family: var(--Oswald), var(--montserrat);
  font-weight: 600;
  color: var(--blue);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}
.badge-current {
  background: linear-gradient(90deg, #10b981, #059669);
  color: var(--white);
  font-family: var(--montserrat);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.version-date {
  color: var(--text-dim);
  font-family: var(--montserrat);
  font-size: 0.875rem;
  margin-left: auto;
}
.version-title {
  font-family: var(--LexendDeca);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--white);
  margin: 4px 0 18px;
}

.change-group {
  font-family: var(--Oswald), var(--montserrat);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 22px 0 10px;
  padding-left: 10px;
  border-left: 4px solid var(--blue);
}
.change-added    { border-color: var(--added);    color: var(--added);    }
.change-modified { border-color: var(--modified); color: var(--modified); }
.change-fixed    { border-color: var(--fixed);    color: var(--fixed);    }
.change-removed  { border-color: var(--removed);  color: var(--removed);  }

.change-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.change-list > li {
  padding: 10px 0 10px 18px;
  position: relative;
  border-top: 1px solid rgba(144, 148, 163, 0.10);
  font-family: var(--montserrat);
  font-size: 1rem;
  color: var(--white);
  line-height: 1.55;
}
.change-list > li:first-child { border-top: none; }
.change-list > li::before {
  content: "›";
  color: var(--blue);
  position: absolute;
  left: 0;
  top: 10px;
  font-weight: 700;
}
.entry-content { word-break: break-word; }
.entry-content p { margin: 0 0 6px; }
.entry-content p:last-child { margin-bottom: 0; }
.entry-content a { color: var(--blue); text-decoration: underline; text-decoration-color: rgba(0, 150, 255, 0.4); }
.entry-content a:hover { text-decoration-color: var(--blue); }
.entry-content code {
  background: rgba(3, 22, 40, 0.8);
  border: 1px solid rgba(0, 150, 255, 0.2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
}
.entry-content pre {
  background: rgba(3, 22, 40, 0.9);
  border: var(--border-faint);
  padding: 12px 14px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.875rem;
}
.entry-content pre code { background: none; border: none; padding: 0; }
.entry-content blockquote {
  border-left: 3px solid var(--blue);
  margin: 8px 0;
  padding: 4px 14px;
  color: var(--text-dim);
  background: rgba(0, 150, 255, 0.05);
  border-radius: 0 8px 8px 0;
}

/* --- Entry media --------------------------------------------------------- */
.entry-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.media-item {
  margin: 0;
  border: var(--border-faint);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(3, 22, 40, 0.6);
}
.media-item img,
.media-item video {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #000;
}
.media-item figcaption {
  font-family: var(--montserrat);
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 6px 10px;
  border-top: 1px solid rgba(144, 148, 163, 0.10);
}

.empty {
  text-align: center;
  color: var(--text-dim);
  font-family: var(--montserrat);
  padding: 36px 20px;
}

/* --- Language picker ----------------------------------------------------- */
.lang-picker select {
  padding: 7px 10px;
  background: var(--background-card-flat);
  color: var(--white);
  border: var(--border-faint);
  border-radius: 10px;
  font-family: var(--montserrat);
  font-size: 0.9rem;
  cursor: pointer;
}

/* --- Admin table --------------------------------------------------------- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--background-card);
  border: var(--border-faint);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  font-family: var(--montserrat);
}
.admin-table th,
.admin-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(144, 148, 163, 0.10);
  font-size: 0.95rem;
}
.admin-table thead th {
  background: rgba(0, 150, 255, 0.05);
  color: var(--blue);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-table tbody tr:hover { background: rgba(0, 150, 255, 0.04); }
.admin-table .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.translation-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 150, 255, 0.12);
  border: 1px solid rgba(0, 150, 255, 0.3);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 600;
}
.translation-badge-empty {
  background: transparent;
  border-color: rgba(144, 148, 163, 0.2);
  color: var(--text-dim);
}

/* --- Admin form (edit.ejs) ---------------------------------------------- */
.edit-form {
  background: var(--background-card);
  border: var(--border-faint);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.edit-form h2 {
  font-family: var(--LexendDeca);
  font-weight: 700;
  color: var(--white);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.edit-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--montserrat);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.edit-form input,
.edit-form select,
.edit-form textarea {
  padding: 10px 14px;
  background: rgba(3, 22, 40, 0.7);
  color: var(--white);
  border: var(--border-faint);
  border-radius: 10px;
  font-family: var(--montserrat);
  font-size: 0.95rem;
  outline: none;
}
.edit-form input:focus,
.edit-form select:focus,
.edit-form textarea:focus { border-color: var(--blue); }
.edit-form textarea { resize: vertical; min-height: 100px; }

.checkbox {
  flex-direction: row !important;
  align-items: center;
  font-weight: 500 !important;
  color: var(--white) !important;
}
.checkbox input { width: 16px; height: 16px; }

.hint, .hint-inline {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 400;
  font-family: var(--montserrat);
}

/* --- Lang tabs ----------------------------------------------------------- */
.lang-tabs-container {
  background: rgba(3, 22, 40, 0.4);
  border: var(--border-faint);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 20px;
}
.lang-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.lang-tab {
  background: transparent;
  border: 1px solid rgba(144, 148, 163, 0.2);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--montserrat);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lang-tab:hover { border-color: var(--blue); color: var(--white); }
.lang-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.lang-panel { display: none; }
.lang-panel.active { display: block; }
.required-mark { color: #f59e0b; }
.translation-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--added);
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
}

/* --- Entry block (admin edit) ------------------------------------------- */
.entry-block {
  background: rgba(3, 22, 40, 0.5);
  border: var(--border-faint);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}
.entry-block-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}
.media-section { margin-top: 12px; }
.media-upload-label {
  display: inline-block;
  padding: 8px 16px;
  border: 1px dashed rgba(0, 150, 255, 0.4);
  border-radius: 10px;
  cursor: pointer;
  color: var(--blue);
  font-family: var(--montserrat);
  font-size: 0.9rem;
}
.media-upload-label:hover { background: rgba(0, 150, 255, 0.06); border-color: var(--blue); }
.media-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.media-preview {
  border: var(--border-faint);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(3, 22, 40, 0.6);
}
.media-preview img,
.media-preview video {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #000;
}
.media-preview-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.media-preview-info input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(144, 148, 163, 0.2);
  color: var(--white);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
}
.media-preview-info small { color: var(--text-dim); font-size: 0.75rem; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(144, 148, 163, 0.15);
}

/* EasyMDE override to match dark theme */
.EasyMDEContainer .CodeMirror {
  background: rgba(3, 22, 40, 0.7) !important;
  color: var(--white) !important;
  border: var(--border-faint) !important;
  border-radius: 10px !important;
}
.editor-toolbar {
  background: rgba(3, 22, 40, 0.5) !important;
  border: var(--border-faint) !important;
  border-bottom: none !important;
  border-radius: 10px 10px 0 0 !important;
}
.editor-toolbar button { color: var(--text-dim) !important; }
.editor-toolbar button:hover { background: rgba(0, 150, 255, 0.15) !important; color: var(--white) !important; }
.editor-preview, .editor-preview-side {
  background: rgba(3, 22, 40, 0.9) !important;
  color: var(--white) !important;
}

/* --- Lightbox ------------------------------------------------------------ */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(3, 8, 18, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}
#lightbox.open { display: flex; flex-direction: column; gap: 14px; }
#lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
  cursor: default;
}
.lightbox-caption {
  display: none;
  max-width: 80ch;
  text-align: center;
  font-family: var(--montserrat);
  font-size: 0.95rem;
  color: var(--white);
  opacity: 0.85;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.4);
  color: var(--white);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}
.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: var(--blue);
  color: var(--blue);
}

.lightbox-link img { cursor: zoom-in; }

/* --- Footer -------------------------------------------------------------- */
.footer {
  text-align: center;
  padding: 28px 20px 36px;
  margin-top: 40px;
  border-top: 1px solid rgba(144, 148, 163, 0.10);
  color: var(--text-dim);
  font-family: var(--montserrat);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.footer p { margin: 0; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 768px) {
  .topbar { padding-top: 12px; padding-bottom: 12px; padding-left: 16px; padding-right: 16px; }
  .container { padding: 24px 14px 60px; }
  .page-header h1 { font-size: 1.7rem; }
  .version-card { padding: 18px; }
  .version-title { font-size: 1.2rem; }
  .admin-table { font-size: 0.85rem; }
  .admin-table th, .admin-table td { padding: 10px 8px; }
}
