:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface2: #1f1f1f;
  --border: #2a2a2a;
  --red: #e63946;
  --red-dim: #b52a35;
  --blue: #4a90d9;
  --gold: #f4c430;
  --text: #f0f0f0;
  --text-dim: #999;
  --text-muted: #666;
  --radius: 8px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

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

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

/* NAV */
nav {
  background: #0a0a0a;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .logo {
  font-weight: 700;
  font-size: 15px;
  color: var(--red);
  text-decoration: none;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

nav .logo span { color: var(--text-dim); font-weight: 400; }

nav .nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
  flex: 1;
}

nav .nav-links a {
  color: var(--text-dim);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

nav .nav-links a:hover,
nav .nav-links a.active {
  background: var(--surface2);
  color: var(--text);
  text-decoration: none;
}

/* HERO */
.hero {
  background: linear-gradient(180deg, #1a0005 0%, var(--bg) 100%);
  padding: 72px 24px 56px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(230, 57, 70, 0.15);
  border: 1px solid rgba(230, 57, 70, 0.4);
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  max-width: 800px;
  margin: 0 auto 20px;
}

.hero h1 em {
  color: var(--red);
  font-style: normal;
}

.hero p {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 620px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn:hover { text-decoration: none; opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--red); color: #fff; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-approve { background: #1a3d2b; color: #4caf7d; border: 1px solid #2a5c3e; }
.btn-reject { background: #3d1a1a; color: #e06060; border: 1px solid #5c2a2a; }
.btn-full { width: 100%; justify-content: center; }

/* MAIN LAYOUT */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.page-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  padding: 40px 0;
}

/* SIDEBAR */
.sidebar { position: sticky; top: 80px; align-self: start; }

.sidebar h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.filter-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
  font-family: var(--font);
}

.filter-btn:hover { background: var(--surface); color: var(--text); }
.filter-btn.active { background: var(--surface2); color: var(--text); border-color: var(--border); }

.filter-count {
  float: right;
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 100px;
  font-weight: 600;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ARGUMENTS LIST */
.arguments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.arguments-header h2 { font-size: 20px; font-weight: 700; }
.count-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 100px;
}

/* ARGUMENT CARD */
.argument-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color 0.15s;
}

.argument-card:hover { border-color: #3a3a3a; }

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.card-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
}

.category-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.cat-international-law { background: #1a2a4a; color: #6ba3e8; border: 1px solid #2a3f6a; }
.cat-human-rights-reports { background: #2a1a1a; color: #e88080; border: 1px solid #4a2a2a; }
.cat-ebu-precedent { background: #1a2a1a; color: #6ab86a; border: 1px solid #2a4a2a; }
.cat-ebu-rules { background: #1a2a1a; color: #6ab86a; border: 1px solid #2a4a2a; }
.cat-un-resolutions { background: #2a2a1a; color: #d4c860; border: 1px solid #4a4a2a; }
.cat-civilian-impact { background: #2a1a2a; color: #c080c0; border: 1px solid #4a2a4a; }
.cat-cultural-destruction { background: #2a1f1a; color: #d4956a; border: 1px solid #4a3020; }
.cat-general { background: var(--surface2); color: var(--text-dim); border: 1px solid var(--border); }

.card-description {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 16px;
}

.card-description.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  font-family: var(--font);
}

.sources-section { margin-top: 12px; }

.sources-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 5px;
  margin-right: 6px;
  margin-bottom: 6px;
  transition: all 0.15s;
}

.source-link:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }

.source-link svg { flex-shrink: 0; opacity: 0.6; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.petition-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.petition-check input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--red); }
.petition-check.checked { color: var(--text-dim); }

/* PETITION PAGE */
.petition-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 40px 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-body { padding: 20px; }

.petition-textarea {
  width: 100%;
  min-height: 400px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  padding: 14px;
  resize: vertical;
}

.petition-textarea:focus { outline: none; border-color: var(--blue); }

.petition-arg-item {
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.petition-arg-item:hover { border-color: #3a3a3a; }
.petition-arg-item.selected { border-color: var(--red); background: rgba(230,57,70,0.07); }

.petition-arg-item input[type=checkbox] { flex-shrink: 0; margin-top: 2px; accent-color: var(--red); }

.petition-arg-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.petition-arg-cat { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.broadcaster-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.broadcaster-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
}

.broadcaster-item strong { display: block; font-size: 12px; color: var(--text-dim); }

/* SUBMIT PAGE */
.form-page { padding: 40px 0; max-width: 720px; margin: 0 auto; }

.form-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.form-subtitle { color: var(--text-dim); margin-bottom: 32px; }

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.form-label .req { color: var(--red); margin-left: 3px; }

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

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

.form-textarea { min-height: 140px; resize: vertical; }
.form-select { appearance: none; cursor: pointer; }

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

.source-entry {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.source-remove {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.source-remove:hover { background: #3d1a1a; color: #e06060; border-color: #5c2a2a; }

.add-source {
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  padding: 10px;
  width: 100%;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}

.add-source:hover { border-color: var(--blue); color: var(--blue); }

/* INFO BOXES */
.info-box {
  background: rgba(74, 144, 217, 0.08);
  border: 1px solid rgba(74, 144, 217, 0.25);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

.info-box.warning {
  background: rgba(244, 196, 48, 0.08);
  border-color: rgba(244, 196, 48, 0.25);
  color: #c8a820;
}

.info-box.success {
  background: rgba(76, 175, 125, 0.08);
  border-color: rgba(76, 175, 125, 0.25);
  color: #4caf7d;
}

/* ADMIN PAGE */
.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.admin-tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font);
  transition: all 0.15s;
}

.admin-tab.active {
  color: var(--text);
  border-bottom-color: var(--red);
}

.admin-tab .tab-count {
  background: var(--red);
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 100px;
  margin-left: 6px;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}

.admin-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.admin-card-actions { display: flex; gap: 8px; flex-shrink: 0; }

.status-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 100px;
}

.status-pending { background: #2a2a1a; color: #d4c860; border: 1px solid #4a4a2a; }
.status-approved { background: #1a3d2b; color: #4caf7d; border: 1px solid #2a5c3e; }
.status-rejected { background: #3d1a1a; color: #e06060; border: 1px solid #5c2a2a; }

/* STATS BAR */
.stats-bar {
  display: flex;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
  justify-content: center;
}

.stat { text-align: center; }
.stat-number { font-size: 32px; font-weight: 800; color: var(--red); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 14px;
  z-index: 9999;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.25s;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid #4caf7d; }
.toast.error { border-left: 3px solid var(--red); }

/* LOGIN */
.login-page {
  max-width: 400px;
  margin: 80px auto;
  padding: 0 24px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state h3 { font-size: 18px; color: var(--text-dim); margin-bottom: 8px; }

/* LOADING */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  margin-top: 80px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

footer p + p { margin-top: 8px; }

/* NAV COLLAPSE WRAPPER */
.nav-collapse {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.nav-admin-btn { margin-left: auto; }

/* BURGER BUTTON */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-dim);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.burger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .petition-workspace { grid-template-columns: 1fr; }
  .broadcaster-grid { grid-template-columns: 1fr; }
  .source-entry { grid-template-columns: 1fr; }
  .source-entry .source-remove { width: 100%; }
  .stats-bar { flex-wrap: wrap; justify-content: center; }

  .burger { display: flex; }

  .nav-collapse {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #0a0a0a;
    border-bottom: 1px solid var(--border);
    padding: 8px 0 14px;
    z-index: 99;
    gap: 0;
  }
  .nav-collapse.open { display: flex; }

  nav .nav-links {
    flex-direction: column;
    gap: 0;
    margin: 0;
  }
  nav .nav-links li { width: 100%; }
  nav .nav-links a {
    display: block;
    padding: 12px 24px;
    border-radius: 0;
    font-size: 15px;
  }
  .nav-admin-btn {
    margin: 10px 16px 0;
    text-align: center;
  }
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* SEARCH + SORT BAR */
.search-sort-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

.search-wrapper {
  flex: 1;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

#search-input, .search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 9px 12px 9px 38px;
  transition: border-color 0.15s;
}

#search-input:focus, .search-input:focus { outline: none; border-color: var(--blue); }
#search-input::placeholder, .search-input::placeholder { color: var(--text-muted); }

.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 13px;
  padding: 9px 12px;
  cursor: pointer;
  appearance: none;
  white-space: nowrap;
}

.sort-select:focus { outline: none; border-color: var(--blue); }

/* VOTE BAR */
.vote-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: var(--font);
  transition: all 0.15s;
  user-select: none;
}

.vote-btn:hover { color: var(--text); border-color: #3a3a3a; }
.vote-btn.up.active  { background: rgba(76,175,125,0.12); border-color: #2a5c3e; color: #4caf7d; }
.vote-btn.down.active { background: rgba(230,57,70,0.1); border-color: #5c2a2a; color: #e06060; }

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.card-timestamp {
  font-size: 11px;
  color: var(--text-muted);
}

/* ADMIN SEARCH+SORT */
.admin-search-sort {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.admin-search-sort .search-wrapper { flex: 1; }

#admin-search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 9px 12px 9px 38px;
  transition: border-color 0.15s;
}

#admin-search-input:focus { outline: none; border-color: var(--blue); }
#admin-search-input::placeholder { color: var(--text-muted); }

/* VOTE COUNT IN ADMIN */
.admin-vote-count {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.admin-vote-count span { display: inline-flex; align-items: center; gap: 4px; }
.admin-vote-count .up-count { color: #4caf7d; }
.admin-vote-count .down-count { color: #e06060; }

/* PROFILE TAB */
.profile-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 500px;
}

.flag-preview {
  font-size: 32px;
  min-width: 44px;
  text-align: center;
  line-height: 1;
}

.profile-field-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 768px) {
  .search-sort-bar { flex-direction: column; align-items: stretch; }
  .admin-search-sort { flex-direction: column; }
  .card-meta-row { flex-direction: column; align-items: flex-start; }
}
