/* -----------------------------------------------------------------------
   retro.software — main stylesheet
   Design: dark bg + raised cards + monospace accents
   ----------------------------------------------------------------------- */

:root {
  --bg:         #f4f5f7;
  --bg-2:       #ffffff;
  --bg-3:       #eaecf0;
  --bg-card:    #ffffff;
  --border:     #dde1e9;
  --border-2:   #c2c8d4;
  --accent:     #5046e4;
  --accent-2:   #3b34c0;
  --accent-glow:rgba(80,70,228,0.12);
  --green:      #16a34a;
  --red:        #dc2626;
  --yellow:     #d97706;
  --text-1:     #111827;
  --text-2:     #374151;
  --text-3:     #6b7280;
  --mono:       'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --sans:       -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:     8px;
  --radius-sm:  4px;
  --shadow:     0 1px 6px rgba(0,0,0,0.10);
  --shadow-lg:  0 4px 20px rgba(0,0,0,0.14);
}

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

html { font-size: 16px; }

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

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

code, .mono {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-3);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
}

/* -----------------------------------------------------------------------
   Layout
   ----------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 32px;
}

.main-content { flex: 1; padding: 32px 20px; }

/* -----------------------------------------------------------------------
   Header
   ----------------------------------------------------------------------- */

.site-header {
  background: var(--bg-2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}

.site-logo {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo:hover { color: var(--text-1); }
.logo-bracket { color: var(--accent); }

.platform-bar {
  background: var(--bg-2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  position: sticky;
  top: 58px;
  z-index: 99;
}

.platform-bar-inner {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 6px 0;
}
.platform-bar-inner::-webkit-scrollbar { display: none; }

.nav-platform {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--text-2);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-platform:hover { background: var(--bg-3); color: var(--text-1); }
.nav-platform.active { color: var(--accent); background: var(--accent-glow); }
.nav-icon { font-size: 22px; line-height: 1; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text-1); }

.btn-upload {
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.btn-upload:hover { background: var(--accent-2); color: #fff; }

.btn-admin {
  font-size: 14px;
  color: var(--text-3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.btn-admin:hover { color: var(--text-2); border-color: var(--border-2); }

/* -----------------------------------------------------------------------
   Flash
   ----------------------------------------------------------------------- */

.flash {
  padding: 10px 0;
  font-size: 13px;
}
.flash .container { padding-top: 0; padding-bottom: 0; }
.flash-success { background: rgba(62,207,142,0.12); color: var(--green); border-bottom: 1px solid rgba(62,207,142,0.2); }
.flash-error   { background: rgba(248,113,113,0.12); color: var(--red);   border-bottom: 1px solid rgba(248,113,113,0.2); }
.flash-info    { background: rgba(124,106,247,0.12); color: var(--accent); border-bottom: 1px solid var(--accent-glow); }

/* -----------------------------------------------------------------------
   Cards
   ----------------------------------------------------------------------- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-sm {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* -----------------------------------------------------------------------
   Home page
   ----------------------------------------------------------------------- */

.home-hero {
  text-align: center;
  padding: 56px 20px 48px;
}
.home-hero-title {
  font-family: var(--mono);
  font-size: 42px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.home-hero-title .accent { color: var(--accent); }
.home-hero-sub {
  font-size: 17px;
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto 28px;
}
.home-hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 13px; font-weight: 600;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-2); color: #fff; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-3);
  color: var(--text-2);
  font-size: 13px; font-weight: 500;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { color: var(--text-1); border-color: var(--border-2); }

.home-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-num  { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--text-1); }
.stat-lbl  { font-size: 13px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }

/* Platform grid */
.platforms-section { margin-bottom: 48px; }
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  display: block;
}
.platform-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow), var(--shadow);
  transform: translateY(-1px);
  color: var(--text-1);
}
.platform-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
}
.platform-count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-3);
}

/* Recent files */
.recent-section { margin-bottom: 48px; }

.file-list { display: flex; flex-direction: column; gap: 6px; }

.file-row {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px 10px 10px;
  transition: border-color 0.15s;
}
.file-row:hover { border-color: var(--border-2); }

.file-row-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
  flex-shrink: 0;
}
.file-row-thumb-placeholder {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  flex-shrink: 0;
}

.file-row-title { font-size: 15px; font-weight: 500; color: var(--text-1); }
.file-row-title a { color: var(--text-1); }
.file-row-title a:hover { color: var(--accent); }
.file-row-meta  { font-size: 13px; color: var(--text-3); margin-top: 3px; }

.badge {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-platform { background: var(--bg-3); color: var(--text-2); border: 1px solid var(--border); }
.badge-size     { background: transparent; color: var(--text-3); }
.badge-new      { background: rgba(62,207,142,0.15); color: var(--green); border: 1px solid rgba(62,207,142,0.3); }
.badge-pending  { background: rgba(251,191,36,0.15); color: var(--yellow); border: 1px solid rgba(251,191,36,0.3); }

.file-date { font-size: 13px; color: var(--text-3); white-space: nowrap; }

/* -----------------------------------------------------------------------
   Platform / category page
   ----------------------------------------------------------------------- */

.page-header { margin-bottom: 28px; }
.page-title  { font-size: 22px; font-weight: 700; color: var(--text-1); margin-bottom: 6px; }
.page-sub    { font-size: 13px; color: var(--text-3); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--border-2); }

.two-col {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

/* Sidebar */
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.sidebar-head {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.sidebar-item {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s, color 0.1s;
}
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item:hover { background: var(--bg-3); color: var(--text-1); }
.sidebar-item.active { color: var(--accent); background: var(--accent-glow); }
.sidebar-count {
  float: right;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  margin-top: 1px;
}

/* File detail */
.file-detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.file-info-card { margin-bottom: 20px; }
.meta-row {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.meta-row:last-child { border-bottom: none; }
.meta-key { color: var(--text-3); min-width: 100px; flex-shrink: 0; }
.meta-val { color: var(--text-1); word-break: break-all; }

.file-description {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.tags-list { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tag {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: border-color 0.15s, color 0.15s;
}
a.tag:hover { border-color: var(--accent); color: var(--accent); }

/* Screenshot gallery */
.screenshot-gallery { display: flex; gap: 8px; flex-wrap: wrap; }
.screenshot-thumb {
  width: 160px; height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  cursor: zoom-in;
  transition: border-color 0.15s, transform 0.15s;
}
.screenshot-thumb:hover { border-color: var(--accent); transform: scale(1.03); }

/* Download button */
.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  margin-bottom: 12px;
}
.btn-download:hover { background: var(--accent-2); color: #fff; }

/* -----------------------------------------------------------------------
   Forms
   ----------------------------------------------------------------------- */

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.retro-input {
  display: block;
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.retro-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.retro-input::placeholder { color: var(--text-3); }
textarea.retro-input { resize: vertical; min-height: 90px; }
select.retro-input { cursor: pointer; }

.retro-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-3);
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color 0.15s, background 0.15s;
}
.retro-btn:hover { border-color: var(--border-2); background: var(--bg-2); }
.retro-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.retro-btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

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

/* -----------------------------------------------------------------------
   Search
   ----------------------------------------------------------------------- */

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}
.search-bar .retro-input { flex: 1; font-size: 14px; }

/* -----------------------------------------------------------------------
   Admin layout
   ----------------------------------------------------------------------- */

.admin-wrap { display: flex; min-height: calc(100vh - 52px); gap: 0; }

.admin-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 24px 0;
}

.admin-nav-group { margin-bottom: 6px; }
.admin-nav-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: 8px 18px 4px;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 15px;
  color: var(--text-2);
  transition: background 0.1s, color 0.1s;
}
.admin-nav-link:hover { background: var(--bg-3); color: var(--text-1); }
.admin-nav-link.active { color: var(--accent); background: var(--accent-glow); }

.admin-main { flex: 1; padding: 28px 32px; overflow: auto; }

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
  font-size: 15px;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-3); }

.btn-approve {
  background: rgba(62,207,142,0.15);
  color: var(--green);
  border: 1px solid rgba(62,207,142,0.3);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s;
}
.btn-approve:hover { background: rgba(62,207,142,0.25); }

.btn-reject {
  background: rgba(248,113,113,0.12);
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s;
}
.btn-reject:hover { background: rgba(248,113,113,0.22); }

.btn-delete {
  background: transparent;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: var(--sans);
  transition: color 0.15s, border-color 0.15s;
}
.btn-delete:hover { color: var(--red); border-color: rgba(248,113,113,0.4); }

/* Review grid */
.review-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  margin-bottom: 28px;
}

.review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.approve-card { border-color: rgba(62,207,142,0.2); }
.reject-card  { border-color: rgba(248,113,113,0.2); }
.action-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.approve-card h3 { color: var(--green); }
.reject-card h3  { color: var(--red); }

/* Dashboard stats */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.dash-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.dash-stat-num { font-family: var(--mono); font-size: 32px; font-weight: 700; color: var(--text-1); }
.dash-stat-lbl { font-size: 13px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 6px; }

/* -----------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------- */

.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 18px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.footer-logo { font-family: var(--mono); font-weight: 700; color: var(--text-2); }
.footer-sep  { color: var(--border-2); }
.footer-inner a { color: var(--text-3); }
.footer-inner a:hover { color: var(--accent); }

/* -----------------------------------------------------------------------
   Utilities
   ----------------------------------------------------------------------- */
.text-muted  { color: var(--text-3); }
.text-mono   { font-family: var(--mono); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-8 { margin-top: 8px; }
.mb-8 { margin-bottom: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* Lightbox */
#lightbox {
  display: none;
  position: fixed; inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
#lightbox.open { display: flex; }

#lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
  cursor: zoom-out;
}

#lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: var(--radius);
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
  display: block;
}

#lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #fff;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #111;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
}
#lightbox-close:hover { background: #f0f0f0; }

/* Pagination */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 24px; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.pagination a { color: var(--text-2); border: 1px solid var(--border); background: var(--bg-card); }
.pagination a:hover { color: var(--text-1); border-color: var(--border-2); }
.pagination .current { background: var(--accent); color: #fff; border: none; }
.pagination .dots { color: var(--text-3); border: none; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
  font-size: 14px;
}
.empty-state-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.5; }

/* Alert boxes */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-success { background: rgba(62,207,142,0.1);  color: var(--green);  border: 1px solid rgba(62,207,142,0.2); }
.alert-error   { background: rgba(248,113,113,0.1); color: var(--red);    border: 1px solid rgba(248,113,113,0.2); }
.alert-info    { background: rgba(124,106,247,0.1); color: var(--accent); border: 1px solid var(--accent-glow); }

/* Input checkbox style */
input[type="checkbox"] { accent-color: var(--accent); }
