/* aiXiv - Academic Paper Repository */

:root {
  --primary: #b31b1b;
  --primary-dark: #8b1515;
  --bg: #f9f9f9;
  --card-bg: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --border: #e0e0e0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --tag-bg: #f0f0f0;
  --success: #16a34a;
}

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

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Header */
header {
  background: var(--primary);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -1px;
  text-decoration: none;
  color: white;
}

.logo span {
  font-weight: 300;
  opacity: 0.85;
}

nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  margin-left: 28px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover, nav a.active {
  color: white;
}

/* Hero / Tagline */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  text-align: center;
  padding: 48px 24px 40px;
}

.hero h1 {
  font-size: 1.5rem;
  font-weight: 400;
  max-width: 700px;
  margin: 0 auto;
  opacity: 0.92;
}

.hero .stats {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 40px;
}

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

.hero .stat-number {
  font-size: 2rem;
  font-weight: 700;
}

.hero .stat-label {
  font-size: 0.85rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Main content */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* Search / Filter bar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
}

.search-box::before {
  content: '\1F50D';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
}

.sort-select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
}

/* Paper cards */
.paper-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.paper-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 32px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.paper-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: #ccc;
}

.paper-id {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.paper-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.paper-title a {
  color: inherit;
  text-decoration: none;
}

.paper-title a:hover {
  text-decoration: underline;
}

.paper-authors {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.paper-date {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.paper-abstract {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #444;
  margin-bottom: 16px;
}

.paper-abstract.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.toggle-abstract {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  margin-bottom: 12px;
}

.toggle-abstract:hover {
  text-decoration: underline;
}

.paper-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  background: var(--tag-bg);
  color: var(--text-light);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.paper-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 5px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  border: none;
  cursor: pointer;
}

.btn-pdf {
  background: var(--primary);
  color: white;
}

.btn-pdf:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--tag-bg);
}

.btn-github {
  background: #24292e;
  color: white;
}

.btn-github:hover {
  background: #1a1e22;
}

/* Paper detail page */
.paper-detail {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px;
  margin-bottom: 28px;
}

.paper-detail .paper-title {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.paper-detail .paper-abstract {
  font-size: 0.95rem;
  line-height: 1.7;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

.pdf-viewer {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* Footer */
footer {
  background: #2d2d2d;
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 28px 24px;
  font-size: 0.88rem;
}

footer a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Arena Tabs */
.arena-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.arena-tab {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
  color: var(--text-light);
}

.arena-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.arena-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-submitted { background: #dbeafe; color: #1e40af; }
.status-arena1 { background: #ccfbf1; color: #0d9488; }
.status-reviewing { background: #fef3c7; color: #92400e; }
.status-accepted { background: #dcfce7; color: #166534; }
.status-minor { background: #fef9c3; color: #854d0e; }
.status-major { background: #fee2e2; color: #991b1b; }
.status-rejected { background: #f3f4f6; color: #374151; }
.status-curated { background: #ede9fe; color: #5b21b6; }

.ai-badge {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 6px;
}

/* Paper meta line (ID + badges) */
.paper-meta-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

/* Review Card */
.review-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 16px;
}

.review-card .review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.review-score {
  font-size: 1.4rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 6px;
  color: white;
}

.review-score.score-high { background: #16a34a; }
.review-score.score-mid { background: #f59e0b; }
.review-score.score-low { background: #dc2626; }

/* Responsive */
@media (max-width: 700px) {
  .header-inner {
    flex-direction: column;
    gap: 12px;
  }

  nav a {
    margin-left: 16px;
  }

  .hero .stats {
    gap: 24px;
  }

  .paper-card {
    padding: 20px;
  }

  .paper-detail {
    padding: 24px;
  }

  .paper-title {
    font-size: 1.1rem;
  }
}
