/* GamezBrowser Ticket Portal — Discord-inspired dark theme */

:root {
  color-scheme: dark;
  --bg: #313338;
  --bg-dark: #1e1f22;
  --bg-card: #2b2d31;
  --bg-hover: #35373c;
  --border: #3f4147;
  --text: #dbdee1;
  --text-dim: #949ba4;
  --white: #f2f3f5;
  --blurple: #5865f2;
  --blurple-hover: #4752c4;
  --green: #23a55a;
  --red: #f23f43;
  --link: #00a8fc;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'gg sans', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--link); }

/* ---- top bar ---- */
.topbar {
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-size: 18px; font-weight: 700; color: var(--white); }
.userbox { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; }
.user-name { font-weight: 600; color: var(--white); }
.user-id {
  color: var(--text-dim);
  font-size: 12px;
  font-family: Consolas, monospace;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  user-select: all;   /* one click selects the whole ID */
}

/* ---- layout ---- */
.page {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px;
}
.page-title { color: var(--white); font-size: 24px; margin-bottom: 20px; }

.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 20px;
  border-top: 1px solid var(--border);
}
.footer a { color: var(--text-dim); }

/* ---- hero (logged out) ---- */
.hero {
  text-align: center;
  padding: 80px 20px;
}
.hero h1 { color: var(--white); font-size: 32px; margin-bottom: 12px; }
.hero p { color: var(--text-dim); max-width: 480px; margin: 0 auto 28px; line-height: 1.5; }

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--blurple);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--blurple-hover); }
.btn-discord { font-size: 17px; }
.btn-small { padding: 6px 14px; font-size: 13px; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg-hover); }

.hint { color: var(--text-dim); font-size: 14px; margin-top: 24px; }

/* ---- admin search ---- */
.admin-search { position: relative; margin-bottom: 28px; }

#ticket-search {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  padding: 13px 16px;
  outline: none;
  transition: border-color .15s;
}
#ticket-search:focus { border-color: var(--blurple); }
#ticket-search::placeholder { color: var(--text-dim); }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  max-height: 420px;
  overflow-y: auto;
}

.search-item {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.search-item:last-child { border-bottom: none; }
a.search-item:hover { background: var(--bg-hover); }
.search-item.is-open { opacity: .8; cursor: default; }

.search-item-top { display: flex; align-items: center; gap: 10px; }
.search-id { font-family: Consolas, monospace; font-weight: 700; color: var(--white); }
.search-date { margin-left: auto; color: var(--text-dim); font-size: 12px; }
.search-meta { color: var(--text-dim); font-size: 13px; margin-top: 3px; }
.search-snippet {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-card);
  border-left: 3px solid var(--blurple);
  border-radius: 4px;
  padding: 6px 10px;
}
.search-empty { padding: 16px; color: var(--text-dim); text-align: center; }

.search-del {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.search-del:hover {
  background: rgba(242, 63, 67, .12);
  border-color: var(--red);
  color: var(--red);
}

/* ---- ticket list ---- */
.ticket-list { display: flex; flex-direction: column; gap: 10px; }

.ticket-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  text-decoration: none;
  color: var(--text);
  transition: background .15s, border-color .15s;
}
a.ticket-card:hover { background: var(--bg-hover); border-color: var(--blurple); }
.ticket-card.is-open { opacity: .85; cursor: default; }

.ticket-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ticket-id { font-weight: 700; color: var(--white); font-family: Consolas, monospace; }
.ticket-type { color: var(--text-dim); font-size: 14px; }

.ticket-side { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.ticket-date { color: var(--text-dim); font-size: 13px; }
.chev { color: var(--text-dim); font-size: 20px; }

.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-open   { background: rgba(35,165,90,.15);  color: var(--green); }
.badge-closed { background: rgba(242,63,67,.15);  color: var(--red); }

.empty {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-dim);
}

/* ---- centered card (errors / 403) ---- */
.center-card {
  max-width: 440px;
  margin: 12vh auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 32px;
  text-align: center;
}
.center-card h1 { color: var(--white); font-size: 22px; margin-bottom: 12px; }
.center-card p { color: var(--text-dim); margin-bottom: 16px; line-height: 1.5; }

@media (max-width: 560px) {
  .ticket-card { flex-direction: column; align-items: flex-start; }
  .hero { padding: 48px 12px; }
}
