/* ============================================
   Duel Revolution Bug Tracker - Stylesheet
   Dark retro game theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-body: #0a0a0a;
  --bg-card: #1a1a1a;
  --bg-input: #252525;
  --border: #333;
  --text: #e0e0e0;
  --text-muted: #999;
  --accent: #ff6b35;
  --accent-hover: #ff8c5a;

  /* Status */
  --status-open: #3498db;
  --status-confirmed: #f39c12;
  --status-in-progress: #9b59b6;
  --status-fixed: #2ecc71;
  --status-wont-fix: #95a5a6;
  --status-duplicate: #e74c3c;

  /* Severity */
  --severity-cosmetic: #95a5a6;
  --severity-minor: #3498db;
  --severity-major: #f39c12;
  --severity-game-breaking: #e74c3c;

  /* Category */
  --cat-battle: #e74c3c;
  --cat-ui: #3498db;
  --cat-network: #9b59b6;
  --cat-audio: #f39c12;
  --cat-visual: #2ecc71;
  --cat-gameplay: #e67e22;
  --cat-account: #1abc9c;
  --cat-other: #95a5a6;

  --font-pixel: 'Press Start 2P', monospace;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1200px;
  --radius: 4px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
}

/* ---- Container ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- Header ---- */
.header {
  background: var(--bg-card);
  border-bottom: 2px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header__logo {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
}

.header__logo a {
  color: var(--accent);
}

/* ---- Nav ---- */
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-muted);
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: all 0.15s;
}

.nav a:hover,
.nav a.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255, 107, 53, 0.1);
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 48px 16px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 16px;
  line-height: 1.8;
}

.hero p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto 24px;
}

/* ---- Stats Row ---- */
.stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0;
}

.stats-row .card {
  flex: 1;
  min-width: 140px;
  text-align: center;
  padding: 16px;
}

.stats-row .card__number {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

.stats-row .card__label {
  color: var(--text-muted);
  font-size: 13px;
}

/* ---- Buttons ---- */
.btn {
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 10px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  line-height: 1.4;
}

.btn:hover {
  border-color: var(--text-muted);
  background: var(--bg-input);
  color: var(--text);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn--secondary {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.btn--secondary:hover {
  background: rgba(255, 107, 53, 0.1);
  color: var(--accent-hover);
}

.btn--small {
  font-size: 8px;
  padding: 6px 10px;
}

.btn--danger {
  background: var(--status-duplicate);
  border-color: var(--status-duplicate);
  color: #fff;
}

.btn--danger:hover {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: border-color 0.15s, background 0.15s;
}

.report-card:hover {
  border-color: var(--accent);
  background: #1e1e1e;
}

.report-card__votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
  padding-top: 2px;
}

.report-card__vote-count {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent);
}

.report-card__body {
  flex: 1;
  min-width: 0;
}

.report-card__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.report-card__title a {
  color: var(--text);
}

.report-card__title a:hover {
  color: var(--accent);
}

.report-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.report-card__id {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-muted);
}

/* ---- Badges ---- */
.badge {
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 4px 8px;
  border-radius: 3px;
  display: inline-block;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Status badges */
.badge--status-open {
  background: rgba(52, 152, 219, 0.15);
  color: var(--status-open);
  border: 1px solid rgba(52, 152, 219, 0.3);
}
.badge--status-confirmed {
  background: rgba(243, 156, 18, 0.15);
  color: var(--status-confirmed);
  border: 1px solid rgba(243, 156, 18, 0.3);
}
.badge--status-in_progress {
  background: rgba(155, 89, 182, 0.15);
  color: var(--status-in-progress);
  border: 1px solid rgba(155, 89, 182, 0.3);
}
.badge--status-fixed {
  background: rgba(46, 204, 113, 0.15);
  color: var(--status-fixed);
  border: 1px solid rgba(46, 204, 113, 0.3);
}
.badge--status-wont_fix {
  background: rgba(149, 165, 166, 0.15);
  color: var(--status-wont-fix);
  border: 1px solid rgba(149, 165, 166, 0.3);
}
.badge--status-duplicate {
  background: rgba(231, 76, 60, 0.15);
  color: var(--status-duplicate);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Severity badges */
.badge--severity-cosmetic {
  background: rgba(149, 165, 166, 0.15);
  color: var(--severity-cosmetic);
  border: 1px solid rgba(149, 165, 166, 0.3);
}
.badge--severity-minor {
  background: rgba(52, 152, 219, 0.15);
  color: var(--severity-minor);
  border: 1px solid rgba(52, 152, 219, 0.3);
}
.badge--severity-major {
  background: rgba(243, 156, 18, 0.15);
  color: var(--severity-major);
  border: 1px solid rgba(243, 156, 18, 0.3);
}
.badge--severity-game_breaking {
  background: rgba(231, 76, 60, 0.15);
  color: var(--severity-game-breaking);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Category badges */
.badge--category-battle {
  background: rgba(231, 76, 60, 0.1);
  color: var(--cat-battle);
}
.badge--category-ui {
  background: rgba(52, 152, 219, 0.1);
  color: var(--cat-ui);
}
.badge--category-network {
  background: rgba(155, 89, 182, 0.1);
  color: var(--cat-network);
}
.badge--category-audio {
  background: rgba(243, 156, 18, 0.1);
  color: var(--cat-audio);
}
.badge--category-visual {
  background: rgba(46, 204, 113, 0.1);
  color: var(--cat-visual);
}
.badge--category-gameplay {
  background: rgba(230, 126, 34, 0.1);
  color: var(--cat-gameplay);
}
.badge--category-account {
  background: rgba(26, 188, 156, 0.1);
  color: var(--cat-account);
}
.badge--category-other {
  background: rgba(149, 165, 166, 0.1);
  color: var(--cat-other);
}

/* ---- Forms ---- */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.form-section h2 {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input.invalid,
.form-group select.invalid,
.form-group textarea.invalid {
  border-color: var(--status-duplicate);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--status-duplicate);
  margin-top: 4px;
  display: none;
}

.form-group.has-error .form-error {
  display: block;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---- Steps to Reproduce ---- */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.steps-container .step-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.steps-container .step-item .step-number {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--accent);
  min-width: 24px;
  text-align: center;
}

.steps-container .step-item input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
}

.steps-container .step-item input:focus {
  outline: none;
  border-color: var(--accent);
}

.steps-container .step-item .step-remove {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
}

.steps-container .step-item .step-remove:hover {
  border-color: var(--status-duplicate);
  color: var(--status-duplicate);
  background: rgba(231, 76, 60, 0.1);
}

.step-add-btn {
  align-self: flex-start;
  margin-top: 8px;
}

/* ---- Screenshot Preview ---- */
.screenshot-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.screenshot-preview__item {
  position: relative;
  aspect-ratio: 16/10;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-input);
}

.screenshot-preview__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Battle Details (conditional) ---- */
.battle-details {
  display: none;
}

.battle-details.visible {
  display: block;
}

/* ---- Report Detail ---- */
.report-detail {
  max-width: 900px;
  margin: 24px auto;
}

.report-detail__header {
  margin-bottom: 24px;
}

.report-detail__header h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.report-detail__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.report-detail__meta {
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.report-detail__section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.report-detail__section h2 {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--accent);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.report-detail__section p,
.report-detail__section ol,
.report-detail__section ul {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.report-detail__section ol {
  padding-left: 20px;
}

.report-detail__section ol li {
  margin-bottom: 4px;
}

.report-detail__screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.report-detail__screenshots img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
}

.report-detail__screenshots img:hover {
  border-color: var(--accent);
}

/* ---- Vote Button ---- */
.vote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.vote-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.vote-btn--voted {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 107, 53, 0.1);
  cursor: default;
}

.vote-btn__arrow {
  font-size: 14px;
  line-height: 1;
}

.vote-btn__count {
  font-family: var(--font-pixel);
  font-size: 10px;
}

/* ---- Filter Bar ---- */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-bar select,
.filter-bar input {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
}

.filter-bar select:focus,
.filter-bar input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-bar select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* ---- Search ---- */
.search-form {
  display: flex;
  gap: 8px;
}

.search-form input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
}

.search-form input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 24px 0;
}

.pagination a,
.pagination span {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: all 0.15s;
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination .active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ---- Banners ---- */
.error-banner,
.success-banner {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-banner {
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #e74c3c;
}

.success-banner {
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.3);
  color: #2ecc71;
}

/* ---- Admin Table ---- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  font-family: var(--font-pixel);
  font-size: 8px;
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-input);
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.admin-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* ---- Admin Stats ---- */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.admin-stats .card {
  text-align: center;
  padding: 16px;
}

.admin-stats .card__number {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}

.admin-stats .card__label {
  color: var(--text-muted);
  font-size: 13px;
}

/* ---- Export Textarea ---- */
.export-textarea {
  width: 100%;
  min-height: 400px;
  padding: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.export-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- Duplicate Field ---- */
.duplicate-field {
  display: none;
}

.duplicate-field.visible {
  display: block;
}

/* ---- Footer ---- */
.footer {
  margin-top: auto;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.footer a {
  color: var(--text-muted);
}

.footer a:hover {
  color: var(--accent);
}

/* ---- 404 Page ---- */
.page-404 {
  text-align: center;
  padding: 80px 16px;
}

.page-404 h1 {
  font-family: var(--font-pixel);
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 16px;
}

.page-404 p {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 24px;
}

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

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text);
}

/* ---- Utility ---- */
.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden {
  display: none !important;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .hero h1 {
    font-size: 11px;
  }

  .hero {
    padding: 32px 16px;
  }

  .stats-row {
    flex-direction: column;
  }

  .stats-row .card {
    min-width: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .report-card {
    flex-direction: column;
    gap: 10px;
  }

  .report-card__votes {
    flex-direction: row;
    gap: 6px;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar select,
  .filter-bar input {
    width: 100%;
  }

  .search-form {
    flex-direction: column;
  }

  .screenshot-preview {
    grid-template-columns: 1fr 1fr;
  }

  .admin-table {
    display: block;
    overflow-x: auto;
  }

  .report-detail__meta {
    flex-direction: column;
    gap: 6px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
