/* =========================================================
   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; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at top left, rgba(124,92,255,0.16), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(34,211,201,0.12), transparent 55%);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 15.5px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

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; }
.cloud-topbar nav a:hover { color: var(--text); }

/* ---------- Layout wrapper ---------- */
.cloud-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 20px;
}
.cloud-main.center { align-items: center; min-height: calc(100vh - 68px); }

/* ---------- Card container (keeps the historical `.container` class name) ---------- */
.container {
  width: 100%;
  max-width: 440px;
  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);
}
.container.wide { max-width: 760px; }
.container.xwide { max-width: 980px; }

.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;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 26px;
}
.filter-row form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.filter-row label { margin-bottom: 6px; }
.filter-row select,
.filter-row input { margin-bottom: 0; width: auto; min-width: 170px; }
.filter-row button {
  padding: 12px 18px;
}

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;
}
.file-item a { font-weight: 600; color: var(--text); }
.file-item a:hover { color: var(--accent-2); }
.file-item .date { display: block; font-size: 12.5px; color: var(--text-faint); margin-top: 4px; }
.delete-link {
  float: right;
  color: var(--danger) !important;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  padding: 0 4px;
}
.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;
}
