/* ── MCCodesMVC — game.css ── */

/* ─── CSS Variables (used by Twig inline styles & stat_bar()) ─── */
:root {
  --bg:           #07070f;
  --bg-2:         #0e0e1e;
  --bg-3:         #141428;
  --accent:       #dc2626;
  --accent-2:     #991b1b;
  --green:        #10b981;
  --yellow:       #f59e0b;
  --blue:         #3b82f6;
  --red:          #ef4444;
  --brave:        #f97316;
  --text:         #e2e8f0;
  --text-muted:   #5a6478;
  --border:       #1e1e38;
  --radius:       8px;
  --shadow:       0 4px 24px rgba(0,0,0,0.55);
}

/* ─── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #f87171; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: 1rem; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a48; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #333360; }

/* ─── Cards ──────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card--warn   { border-color: rgba(245,158,11,.5); }
.card--danger { border-color: rgba(239,68,68,.5); }
.card--success { border-color: rgba(16,185,129,.5); }

.card__header {
  padding: .65rem 1rem;
  font-weight: 600;
  font-size: .875rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: #0b0b1a;
  border-left: 3px solid var(--accent);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.card--warn   .card__header { border-left-color: var(--yellow); }
.card--danger .card__header { border-left-color: var(--red); }
.card--success .card__header { border-left-color: var(--green); }

.card__body   { padding: 1rem; }
.card__footer {
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  background: #0b0b1a;
}
.card.p-0 .card__body { padding: 0; }
.text-center { text-align: center; }

/* ─── Dashboard Grid ─────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* ─── Forms ──────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group label {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.form-group small { font-size: .76rem; color: var(--text-muted); }
.form-vertical { display: flex; flex-direction: column; gap: .9rem; }
.form-row  { display: flex; gap: .5rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-group--full { grid-column: 1 / -1; }

.form-control {
  background: #090916;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: .5rem .75rem;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(220,38,38,.15);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control--sm { padding: .3rem .5rem; font-size: .875rem; }
textarea.form-control { resize: vertical; }
select.form-control { cursor: pointer; }
.radio-group { display: flex; gap: 1.5rem; padding: .3rem 0; }
.radio-group label { display: flex; align-items: center; gap: .35rem; cursor: pointer; color: var(--text); font-size: .9rem; }

/* ─── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem 1.1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .2s;
  white-space: nowrap;
  letter-spacing: .01em;
}
.btn:hover { text-decoration: none; }
.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(220,38,38,.35);
}
.btn--primary:hover {
  background: #ef4444;
  box-shadow: 0 0 22px rgba(220,38,38,.55);
}
.btn--danger  { background: var(--red);   color: #fff; border-color: var(--red); }
.btn--danger:hover  { background: #dc2626; }
.btn--success { background: var(--green); color: #fff; border-color: var(--green); }
.btn--success:hover { background: #059669; }
.btn--outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn--outline:hover { background: var(--bg-3); border-color: #2a2a48; }
.btn--ghost   { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--ghost:hover { color: var(--text); }
.btn--sm  { padding: .3rem .7rem; font-size: .8rem; }
.btn--xs  { padding: .18rem .45rem; font-size: .75rem; }
.btn--lg  { padding: .65rem 1.5rem; font-size: 1rem; }
.btn--full { width: 100%; }
.btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* ─── Alerts & Flash ─────────────────────────── */
.flash-messages { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border: 1px solid;
}
.alert--success { background: rgba(16,185,129,.1);  border-color: rgba(16,185,129,.3);  color: #6ee7b7; }
.alert--error   { background: rgba(239,68,68,.1);   border-color: rgba(239,68,68,.3);   color: #fca5a5; }
.alert--warning { background: rgba(245,158,11,.1);  border-color: rgba(245,158,11,.3);  color: #fcd34d; }
.alert--info    { background: rgba(59,130,246,.1);  border-color: rgba(59,130,246,.3);  color: #93c5fd; }
.alert__close {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 1.2rem; line-height: 1; padding: 0 0 0 .5rem; opacity: .6;
}
.alert__close:hover { opacity: 1; }

/* ─── Toast Notifications ────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 9999;
}
.toast {
  background: #111124;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,.65);
  animation: toast-in .25s ease;
}
.toast--success { border-left: 3px solid var(--green); }
.toast--error   { border-left: 3px solid var(--accent); }
.toast--info    { border-left: 3px solid var(--blue); }
.toast--warning { border-left: 3px solid var(--yellow); }
.toast--hide    { animation: toast-out .3s ease forwards; }
.toast__icon  { font-size: .9rem; margin-top: .15rem; }
.toast__body  { flex: 1; }
.toast__title { display: block; font-weight: 600; font-size: .8rem; color: var(--text); }
.toast__msg   { font-size: .78rem; color: var(--text-muted); }
.toast__close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0; }

@keyframes toast-in  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }

/* ─── Tables ─────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th {
  padding: .5rem .85rem;
  text-align: left;
  background: #0b0b1a;
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: .55rem .85rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td      { background: rgba(255,255,255,.02); }

.stat-table { width: 100%; font-size: .875rem; }
.stat-table td { padding: .4rem .5rem; }
.stat-table td:first-child { color: var(--text-muted); width: 40%; }

/* ─── Stat Bars (used by stat_bar() PHP function) ─── */
.stat-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 6px;
  overflow: hidden;
  margin: 2px 0;
}
.stat-bar { height: 100%; border-radius: 6px; transition: width .6s ease; }
.stat-bar--green  { background: linear-gradient(90deg, #059669, #10b981); }
.stat-bar--red    { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.stat-bar--blue   { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.stat-bar--yellow { background: linear-gradient(90deg, #b45309, #f59e0b); }
.stat-bar--purple { background: linear-gradient(90deg, #c2410c, #f97316); }

/* ─── Badges ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge--staff   { background: rgba(153,27,27,.2);  color: #fca5a5; border-color: rgba(153,27,27,.4); }
.badge--warn    { background: rgba(245,158,11,.2);  color: #fcd34d; border-color: rgba(245,158,11,.4); }
.badge--danger  { background: rgba(239,68,68,.2);   color: #fca5a5; border-color: rgba(239,68,68,.4); }
.badge--success { background: rgba(16,185,129,.2);  color: #6ee7b7; border-color: rgba(16,185,129,.4); }
.badge--pin, .badge--lock { background: none; padding: 0; border: none; }

/* ─── Page Header ─────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: .5rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--border);
}
.page-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.015em;
}
.page-header__actions { display: flex; gap: .5rem; }

/* ─── Info Bar ────────────────────────────────── */
.info-bar {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem 1rem;
  font-size: .875rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: var(--text-muted);
}
.info-bar strong { color: var(--text); }

/* ─── Search Bar ──────────────────────────────── */
.search-bar { display: flex; gap: .5rem; }
.search-bar .form-control { flex: 1; }

/* ─── Pagination ──────────────────────────────── */
.pagination { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding-top: .75rem; }

/* ─── Online List ─────────────────────────────── */
.online-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.online-player {
  font-size: .78rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: .2rem .6rem;
  border-radius: 20px;
  color: var(--text-muted);
  transition: all .15s;
}
.online-player:hover { border-color: rgba(220,38,38,.5); color: var(--text); }
.online-player--staff { background: rgba(220,38,38,.12); border-color: rgba(220,38,38,.3); color: #fca5a5; }

/* ─── Quick Links ─────────────────────────────── */
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.quick-link {
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: .75rem .5rem;
  border-radius: var(--radius);
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  transition: all .2s;
  display: block;
}
.quick-link:hover {
  background: rgba(220,38,38,.1);
  border-color: rgba(220,38,38,.4);
  color: var(--accent);
}

/* ─── Forum ───────────────────────────────────── */
.forum-row { display: flex; justify-content: space-between; align-items: center; }
.forum-title { font-weight: 600; font-size: 1rem; }
.forum-stats { display: flex; gap: 1.5rem; font-size: .8rem; color: var(--text-muted); }

/* ─── Forum Posts ─────────────────────────────── */
.post-card { display: flex; }
.post-card__sidebar {
  width: 120px;
  flex-shrink: 0;
  background: #0b0b1a;
  padding: .75rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.post-author { font-weight: 700; font-size: .875rem; }
.post-level  { font-size: .72rem; color: var(--text-muted); }
.post-avatar { margin: .5rem auto; border-radius: 6px; max-width: 60px; max-height: 60px; }
.post-card__body { flex: 1; padding: .75rem 1rem; }
.post-meta { font-size: .75rem; margin-bottom: .5rem; color: var(--text-muted); }
.post-content { font-size: .875rem; white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.post-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.post-list li { font-size: .85rem; }

/* ─── Results ─────────────────────────────────── */
.result-card { border-width: 2px; }
.result-card--won,
.result-card--success { border-color: var(--green) !important; }
.result-card--lost,
.result-card--fail    { border-color: var(--red) !important; }
.result-card--jail    { border-color: var(--yellow) !important; }
.result-icon { font-size: 3rem; margin-bottom: .5rem; }
.battle-log {
  background: #0b0b1a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
  text-align: left;
  font-size: .8rem;
  max-height: 200px;
  overflow-y: auto;
}
.battle-log__line { padding: .15rem 0; border-bottom: 1px solid rgba(255,255,255,.04); color: var(--text-muted); }

/* ─── Profile ─────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.profile-pic  { margin-bottom: .75rem; }

/* ─── Balance Display ─────────────────────────── */
.balance-display { font-size: 2rem; font-weight: 700; color: var(--yellow); margin-bottom: .5rem; }

/* ─── Mail ────────────────────────────────────── */
.mail-row--unread td { font-weight: 600; color: var(--text); }
.mail-body { white-space: pre-wrap; font-size: .9rem; line-height: 1.7; }

/* ─── Stat Value ──────────────────────────────── */
.stat-value { font-size: 2.4rem; font-weight: 800; color: var(--accent); line-height: 1.1; }

/* ─── Fight Table ─────────────────────────────── */
.fight--win  td { background: rgba(16,185,129,.07); }
.fight--loss td { background: rgba(239,68,68,.07);  }

/* ─── Inline Form ─────────────────────────────── */
.inline-form { display: flex; gap: .5rem; align-items: center; }

/* ─── Misc Helpers ────────────────────────────── */
.text-muted  { color: var(--text-muted) !important; }
.float-right { float: right; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }
.p-0  { padding: 0 !important; }
.hidden { display: none !important; }

/* ─── Modal ───────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.modal__box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 560px;
  max-width: 95vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
}
.modal__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.modal__close { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; }
.modal__close:hover { color: var(--text); }
.modal__body { padding: 1.25rem; }

/* ─── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  #sidebar { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .post-card__sidebar { width: 80px; }
  .form-grid { grid-template-columns: 1fr; }
}
