/* =========================================================
   Gamers4Life Cloud — Design System
   (shares the same visual language as the main site)
   ========================================================= */

:root {
  --bg: #0a0d14;
  --bg-alt: #0f1420;
  --surface: #151b28;
  --surface-2: #1b2333;
  --border: #262f42;
  --text: #eef1f8;
  --text-dim: #9aa5bd;
  --text-faint: #6b7488;

  --accent: #7c5cff;
  --accent-2: #22d3c9;
  --accent-grad: linear-gradient(135deg, #7c5cff 0%, #22d3c9 100%);
  --danger: #ff5470;
  --success: #2ecc71;

  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

/* Background is built from several soft, slowly-drifting glows plus a faint
   dot grid. On a small screen the card fills most of the view and the
   backdrop barely shows; on a large monitor the card only ever covers a
   fraction of the viewport, so the backdrop needs to read as an intentional
   scene rather than a mostly-empty rectangle around a floating box. */
@keyframes bg-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(3%, 2%) scale(1.08); }
}
@keyframes bg-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-3%, -2%) scale(1.1); }
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 15.5px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  position: relative;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
body::before {
  background-image:
    radial-gradient(ellipse 60% 50% at 12% 8%, rgba(124,92,255,0.22), transparent 60%),
    radial-gradient(ellipse 55% 45% at 88% 18%, rgba(34,211,201,0.14), transparent 60%),
    radial-gradient(ellipse 50% 55% at 20% 92%, rgba(34,211,201,0.12), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 95%, rgba(124,92,255,0.16), transparent 60%);
  animation: bg-drift-1 22s ease-in-out infinite;
}
body::after {
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 0%, transparent 75%);
  animation: bg-drift-2 28s ease-in-out infinite;
}
.cloud-topbar, .cloud-main { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }
h2 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; margin: 0 0 6px; }
p { color: var(--text-dim); }

/* ---------- Topbar ---------- */
.cloud-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,13,20,0.7);
  backdrop-filter: blur(10px);
}
.cloud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}
.cloud-brand .mark {
  height: 30px;
  padding: 0 7px;
  border-radius: 8px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  color: #0a0d14; font-size: 11px; font-weight: 800;
}
.cloud-brand span.sub { color: var(--text-faint); font-weight: 500; font-size: 13px; margin-left: 4px; }
.cloud-topbar nav { display: flex; align-items: center; gap: 18px; }
.cloud-topbar nav a { color: var(--text-dim); font-size: 14px; font-weight: 500; }
@media (max-width: 640px) {
  .cloud-topbar { flex-wrap: wrap; row-gap: 10px; padding: 14px 20px; }
  .cloud-topbar nav { flex-wrap: wrap; row-gap: 8px; column-gap: 16px; width: 100%; }
}
.cloud-topbar nav a:hover { color: var(--text); }

/* ---------- Layout wrapper ----------
   Always vertically centered with a guaranteed minimum height. Before this,
   short pages (like an empty file list) only pinned themselves to the top,
   leaving a huge dead gap below on any screen taller than the card — which
   looked especially bad on wide/tall monitors. Centering unconditionally
   means every page looks intentional regardless of content length or
   screen size; on tall content it simply behaves like a normal top-aligned
   scroll (min-height never clips anything). */
.cloud-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 20px;
  min-height: calc(100vh - 68px);
}

/* ---------- Card container (keeps the historical `.container` class name) ----------
   Widths use clamp() so the card scales up on large monitors instead of
   staying pinned at a small fixed size — a 440px box on a 27" screen reads
   as "lost", not "centered". The glow ring adds presence so the card feels
   like a deliberate focal point rather than a plain box floating in the
   backdrop. */
.container {
  position: relative;
  width: 100%;
  max-width: clamp(380px, 34vw, 520px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 34px;
  box-shadow:
    0 20px 50px -20px rgba(0,0,0,0.6),
    0 0 0 1px rgba(124,92,255,0.05),
    0 0 90px -30px rgba(124,92,255,0.35);
}
.container::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(124,92,255,0.5), rgba(34,211,201,0.15) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.container.wide { max-width: clamp(640px, 55vw, 1040px); }
.container.xwide { max-width: clamp(760px, 65vw, 1280px); }

.container h2 { font-size: 24px; text-align: center; }
.container > p:first-of-type { text-align: center; }

/* ---------- Forms ---------- */
label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
/* Any ordinary text-entry input gets the dark field style — using :not()
   here (instead of listing every type) means a field type we add later
   (url, tel, number, search, …) is never accidentally left unstyled with
   unreadable black-on-dark browser-default text, which is what happened
   to the "Button-Link" field before this fix. */
input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,92,255,0.18);
}
input[type="file"] { padding: 10px 14px; cursor: pointer; }
/* Hints the browser to draw native controls (date picker, calendar icon,
   dropdown arrows, "Datei auswählen"-Button) in a dark-friendly palette
   instead of the default black-on-dark that's otherwise hard to read. */
:root { color-scheme: dark; }

input[type="submit"], button {
  font-family: inherit;
  cursor: pointer;
}

input[type="submit"] {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 999px;
  background: var(--accent-grad);
  color: #0a0d14;
  font-weight: 700;
  font-size: 15px;
  transition: transform .2s ease, box-shadow .2s ease;
}
input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(124,92,255,0.5);
}

/* generic buttons (used for navigation actions rendered via <button>) */
button:not(#logout-btn) {
  padding: 12px 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
button:not(#logout-btn):hover {
  border-color: var(--accent);
  color: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px rgba(124,92,255,0.45);
}
#logout-btn {
  padding: 10px 20px;
  border: 1px solid rgba(255,84,112,0.4);
  border-radius: 999px;
  background: transparent;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}
#logout-btn:hover { background: rgba(255,84,112,0.1); }

.back-to-login-btn { margin-top: 18px; width: 100%; }

/* ---------- Alerts / messages ----------
   These class names are echoed directly by the PHP files, so they must
   stay exactly as-is: .success-message, .error-message, .message,
   .message.error, .message.success                                     */
.success-message,
.error-message,
.message,
p.message,
div.message {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  text-align: center;
  border: 1px solid transparent;
}
.success-message,
.message.success,
p.success,
.message p.success {
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.35);
  color: #4ee08a;
}
.error-message,
.message.error,
p.error,
.message p.error,
#info-message,
#rar-message {
  background: rgba(255, 84, 112, 0.12);
  border-color: rgba(255, 84, 112, 0.35);
  color: #ff8098;
}
.message:empty { display: none; }

/* ---------- Links under forms ---------- */
.register-link {
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 10px;
}

/* ---------- Dashboard action list ---------- */
.action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 26px;
}
.action-grid a { text-decoration: none; }
.action-grid button {
  width: 100%;
  padding: 14px 18px;
  text-align: left;
  font-size: 14.5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 14px;
}
.btn-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-grad);
  color: #0a0d14;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon svg { width: 19px; height: 19px; }
.welcome-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 6px;
}
.welcome-box strong { color: var(--accent-2); }

.admin-divider {
  margin: 26px 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

/* ---------- File list (files.php) ---------- */
.filter-row {
  display: flex;
  gap: 14px 24px;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 26px;
  text-align: left;
}
.filter-row form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.filter-row label { margin-bottom: 6px; }
/* !important on margin-bottom: the global text-input selector further up
   (input:not(...):not(...):not(...):not(...)) stacks four :not() clauses,
   which gives it higher specificity than a single class like `.filter-row
   input` even though this rule comes later in the file. Without !important
   that global 18px margin-bottom silently wins on the date field (but not
   on the <select>, which is matched by the low-specificity `select`
   selector instead), so the two form groups in this row ended up different
   heights and their labels no longer lined up. */
.filter-row select,
.filter-row input { margin-bottom: 0 !important; width: auto; min-width: 170px; }
.filter-row button {
  padding: 12px 18px;
}
@media (max-width: 640px) {
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-row form { width: 100%; }
  .filter-row select,
  .filter-row input { min-width: 0; width: 100%; }
  .filter-row button { width: 100%; }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.empty-state .icon {
  width: 44px; height: 44px;
  margin: 0 auto 14px;
  border-radius: 12px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  color: #0a0d14;
}
.empty-state .icon svg { width: 20px; height: 20px; }
.empty-state p { margin: 0; color: var(--text-dim); }

ul.uploaded-files { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.file-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: left;
}
/* Top row (filename + delete icon), built with flexbox instead of the old
   float:right — floats without a clearfix were the cause of the layout
   coming apart ("verrutscht") whenever a filename was long or the window
   narrow. The date always gets forced onto its own line via flex-basis.
   Uses its own class (not ".file-item > div") so it can't accidentally
   out-specificity ".file-description" (a sibling div that must stay
   display:none until toggled). */
.file-item .file-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 14px;
}
.file-item a { font-weight: 600; color: var(--text); }
.file-item a:hover { color: var(--accent-2); }
.file-item .date { flex-basis: 100%; font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.delete-link {
  color: var(--danger) !important;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  padding: 0 4px;
  flex-shrink: 0;
}
.delete-link:hover { color: #ff8098 !important; }
.toggle-description {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--accent-2);
  cursor: pointer;
}
.toggle-description:hover { text-decoration: underline; }
.file-description {
  display: none;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-faint);
}
.file-description.show { display: block; }

/* ---------- Groups (groups.php) ---------- */
.groups-container {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.group-column {
  flex: 1;
  min-width: 160px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
}
.group-column h3 { font-size: 15px; margin: 0 0 10px; color: var(--accent-2); }
.group-column ul { list-style: none; padding: 0; margin: 0; }
.group-column li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.group-column li:last-child { border-bottom: none; }
.search-bar { margin-bottom: 20px; }
.search-bar form { display: flex; gap: 10px; }
.search-bar input { margin-bottom: 0; }
.back-button { margin-top: 26px; text-align: center; }

/* ---------- Progress bar (upload.php) ---------- */
#progressContainer {
  margin-top: 8px;
  margin-bottom: 20px;
}
#progressStatus { font-size: 13px; color: var(--text-faint); margin-bottom: 6px; }
#progressContainer > div:last-child {
  background: var(--surface-2) !important;
  border-radius: 999px;
  overflow: hidden;
  height: 8px !important;
}
#progressBar {
  height: 8px !important;
  border-radius: 999px;
  background: var(--accent-grad) !important;
}

/* ---------- Game-card editor (games_edit.php) ---------- */
.game-edit-block {
  padding: 18px 20px;
  margin-bottom: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.game-edit-block h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  color: var(--accent-2);
  margin: 0 0 14px;
}
.game-edit-block label { margin-bottom: 6px; }
.game-edit-block input,
.game-edit-block textarea { background: var(--surface); }

/* ---------- Footer nav buttons ---------- */
.container > a > button,
.container > button {
  margin-top: 8px;
}
