/* GSP Design System (mobile-first, brand-aligned) */
:root {
  /* Brand (from your logo) */
  --gsp-red: #e83f39;      /* GATHER red */
  --gsp-blue: #39a0ed;     /* SOCIALIZE blue */
  --gsp-teal: #00bfb1;     /* PLAY teal */
  --gsp-yellow: #ffc000;   /* EVENTS bar yellow */

  /* Core UI */
  --bg: #0f1720;           /* Dark navy background */
  --panel: #111827;        /* Card panel */
  --panel-2: #0c121a;      /* Inputs / inner */
  --border: #1f2937;       /* Soft border */
  --text: #e8ecf1;         /* Base text */
  --text-weak: #cfd6de;    /* Secondary */
  --text-strong: #ffffff;  /* Highlights */

  /* Status colors */
  --success-green: #1aa799;      /* Global success */
  --success-green-bg: rgba(26, 167, 153, 0.12);
  --error-red: #e83f39;
  --error-red-bg: rgba(232, 63, 57, 0.12);

  /* Accent + focus */
  --yellow: var(--gsp-yellow);
  --yellow-hover: #e0ac00;
  --ring: rgba(255, 192, 0, 0.35);

  /* Radius/shadows */
  --radius: 12px;
  --shadow-1: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.25);

  /* Spacing */
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
}

/* Base */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}
a { color: var(--gsp-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header, .header-bar {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.header-inner, .header-bar > div {
  max-width: 1100px; margin: 0 auto;
  padding: var(--space-2) var(--space-3);
  display: flex; align-items: center; gap: var(--space-3);
}
.logo, .header-logo img { height: 42px; max-width: 100%; }
.header-right { margin-left: auto; color: var(--text-weak); font-size: 14px; }

/* Layout */
.container { max-width: 1100px; margin: 24px auto 80px; padding: 0 var(--space-3); }
.section { margin-top: var(--space-5); }
.grid { display: grid; gap: var(--space-4); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid-2 { grid-template-columns: 1.15fr 1fr; } }

/* Card */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: var(--space-4);
}

/* Headings & text */
.h1, h1 { margin: 0 0 var(--space-2); font-size: 28px; font-weight: 800; letter-spacing: .2px; color: var(--text-strong); }
.h2, h2 { margin: 0 0 var(--space-2); font-size: 20px; font-weight: 700; color: var(--text-strong); }
.p, .subtitle { margin: 0 0 var(--space-3); color: var(--text-weak); font-size: 15px; }

/* Form */
label {
  display: block; font-size: 12px; color: var(--text-weak);
  letter-spacing: .3px; margin-bottom: 6px; font-weight: 600;
}
.form-group { margin-bottom: var(--space-4); }
.input, textarea, select, input[type="date"], input[type="text"], input[type="email"],
input[type="tel"], input[type="file"] {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; outline: none; font-size: 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input:focus, textarea:focus, select:focus, input[type="date"]:focus,
input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, input[type="file"]:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 4px var(--ring);
}
textarea { min-height: 110px; resize: vertical; }
.small-text, .help { font-size: 12px; color: var(--text-weak); margin-top: 6px; }
.row { display: grid; gap: var(--space-3); }
@media (min-width: 680px) { .row.row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Buttons */
.btn, button[type="submit"], button[type="button"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 800; letter-spacing: .2px; border-radius: 10px; border: 0; cursor: pointer;
  padding: 12px 16px; transition: transform .05s ease, box-shadow .2s, background .2s, filter .2s;
  will-change: transform;
}
.btn:active, button[type="submit"]:active, button[type="button"]:active { transform: translateY(1px); }
.btn-primary, button[type="submit"] { background: var(--yellow); color: #000; box-shadow: var(--shadow-2); }
.btn-primary:hover, button[type="submit"]:hover:not(:disabled) { background: var(--yellow-hover); filter: brightness(.98); }
.btn-ghost, button[type="button"] { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover, button[type="button"]:hover:not(:disabled) { border-color: #2b3a4c; }
button[type="submit"]:disabled, button[type="button"]:disabled { background: #444; color: #888; cursor: not-allowed; box-shadow: none; }

/* Lists */
.list, .file-list {
  list-style: none; padding: 0; margin: 0;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-2);
}
.item, .file-list li {
  padding: 12px 10px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-weak); font-size: 14px;
}
.item:last-child, .file-list li:last-child { border-bottom: 0; }

/* Status messages (GLOBAL) */
.status {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: 10px;
  font-weight: 700;
  display: none;
  background: #0f1a24;
  border: 1px solid #213244;
  color: var(--text);
}
.status.success { background: var(--success-green-bg); border-color: var(--success-green); color: var(--success-green); }
.status.error { background: var(--error-red-bg); border-color: var(--error-red); color: #ff8884; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; font-size: 12px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text); background: #0f1a24; flex-shrink: 0;
}
.badge.posted { border-color: var(--success-green); color: var(--success-green); background: var(--success-green-bg); }
.badge.unposted { border-color: #4e3a11; color: #f6d37a; background: rgba(255, 192, 0, 0.14); }

/* Media grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.media-grid img { width: 100%; border-radius: 8px; display: block; }

/* Utilities */
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.text-center { text-align: center; }

/* Custom file input component (hidden native input + styled label/button) */
.file-field { display: flex; gap: 10px; align-items: center; }
.file-field .file-name { color: var(--text-weak); font-size: 13px; opacity: .9; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-input-hidden { position: absolute !important; left: -9999px !important; width: 0 !important; height: 0 !important; opacity: 0 !important; }
.file-field .file-btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 800; letter-spacing: .2px; border: 0; }
.file-field .file-btn.btn-primary { background: var(--yellow); color: #000; box-shadow: var(--shadow-2); }
.file-field .file-btn.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.file-field .file-btn:hover { filter: brightness(.98); }

/* Segmented upload progress (on-brand) */
.segmented-progress {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  width: 100%;
  height: 18px;
}
.segment {
  position: relative;
  background: #1f2937; /* var(--border) baseline */
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.segment-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--yellow);
  transition: width .25s ease, background-color .25s ease, opacity .25s ease;
}
.segment.success .segment-fill { width: 100%; background: var(--yellow); }
.segment.error .segment-fill { width: 100%; background: var(--error-red); }
.segment.pending .segment-fill { width: 30%; background: var(--yellow); opacity: .6; }

/* Tooltip for segment errors */
.segment.tooltip::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: 120%; transform: translateX(-50%);
  white-space: nowrap; font-size: 11px; color: #fff;
  background: rgba(20, 20, 20, 0.9); padding: 4px 8px; border-radius: 6px;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.segment.tooltip:hover::after { opacity: 1; }

/* Minimal admin tweaks using your brand system */
.admin-controls {
  display: grid;
  gap: 10px;
}
@media (min-width: 900px) {
  .admin-controls {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
  }
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}
.admin-table th, .admin-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  vertical-align: top;
}
.admin-table th {
  text-align: left;
  color: var(--text-weak);
  font-weight: 700;
}
.kv {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px;
  align-items: center;
}
.kv > label { margin: 0; }
.grid-3 { display: grid; gap: 10px; }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.kv-inline { display: flex; gap: 10px; align-items: center; }
.code {
  background: #0f1a24; border: 1px solid #213244; color: var(--text);
  padding: 8px 10px; border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 12px;
  overflow: auto;
}
.small { font-size: 12px; color: var(--text-weak); }
.badge.st { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); }
.badge.gsp { background: rgba(255,192,0,0.14); color: #f6d37a; border-color: #4e3a11; }
.badge.musingo { background: rgba(0,191,177,0.12); color: var(--gsp-teal); border-color: var(--gsp-teal); }
.badge.private { background: rgba(57,160,237,0.12); color: var(--gsp-blue); border-color: var(--gsp-blue); }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Per-file status badges (PHOTO uploads) — success = yellow, errors = red */
.file-status {
  display: inline-block;
  min-width: 72px;
  text-align: center;
  font-weight: 700;
  border-radius: 8px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}
.file-status.pending { border-color: var(--yellow); color: var(--yellow); background: rgba(255, 192, 0, 0.12); }
/* Important: individual file success in YELLOW (on-brand), not green */
.file-status.success { border-color: var(--yellow); color: #000; background: var(--yellow); }
.file-status.error { border-color: var(--error-red); color: #ff8884; background: var(--error-red-bg); }