/* Cross Domain Reasoning Repository - Global Styles */

:root {
  /* Color Palette - Light Theme */
  --bg-primary: #fdfdfd;
  --bg-secondary: #f6f8fa;
  --bg-card: #ffffff;
  --bg-sidebar: #fafbfc;
  --bg-code: #f3f4f6;
  --bg-highlight: #f0f7ff;
  --border-light: #e5e7eb;
  --border-dark: #d1d5db;
  
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-link: #0366d6;
  --text-link-hover: #024ea4;
  
  --accent-primary: #1e3a8a;
  --accent-secondary: #2563eb;
  --accent-badge: #eff6ff;
  --accent-badge-text: #1d4ed8;
  
  --callout-info-bg: #eff6ff;
  --callout-info-border: #3b82f6;
  --callout-warning-bg: #fffbeb;
  --callout-warning-border: #f59e0b;
  --callout-danger-bg: #fef2f2;
  --callout-danger-border: #ef4444;
  --callout-success-bg: #f0fdf4;
  --callout-success-border: #22c55e;

  /* Typography */
  --font-serif: "Charter", "Bitstream Charter", "Sitka Text", "Cambria", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;

  /* Spacing & Sizing */
  --max-content-width: 1200px;
  --paper-max-width: 880px;
  --header-height: 64px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #161b22;
  --bg-sidebar: #0d1117;
  --bg-code: #1c2128;
  --bg-highlight: #1f293d;
  --border-light: #30363d;
  --border-dark: #484f58;
  
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --text-link: #58a6ff;
  --text-link-hover: #79c0ff;
  
  --accent-primary: #388bfd;
  --accent-secondary: #58a6ff;
  --accent-badge: #1f293d;
  --accent-badge-text: #79c0ff;
  
  --callout-info-bg: #0c2d6b20;
  --callout-info-border: #388bfd;
  --callout-warning-bg: #5c3b0020;
  --callout-warning-border: #d29922;
  --callout-danger-bg: #67060c20;
  --callout-danger-border: #f85149;
  --callout-success-bg: #11341920;
  --callout-success-border: #3fb950;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-brand:hover {
  text-decoration: none;
  color: var(--accent-secondary);
}

.brand-icon {
  min-width: 32px;
  height: 28px;
  padding: 0 4px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-badge);
  color: var(--accent-badge-text);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.25rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-dark);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-light);
  padding: 3.5rem 1.5rem;
}

.hero-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.hero-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Main Container & Layout */
.main-container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  flex: 1;
  width: 100%;
}

/* Search & Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 450px;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

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

.topic-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topic-tag-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topic-tag-btn:hover, .topic-tag-btn.active {
  background: var(--accent-badge);
  color: var(--accent-badge-text);
  border-color: var(--accent-secondary);
}

/* Featured Paper Card */
.featured-paper {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-secondary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-paper:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.paper-badge-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-featured {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

[data-theme="dark"] .badge-featured {
  background: #78350f40;
  color: #fcd34d;
  border-color: #92400e;
}

.badge-report {
  background: var(--accent-badge);
  color: var(--accent-badge-text);
  border: 1px solid var(--border-light);
}

.paper-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.paper-title a {
  color: var(--text-primary);
}

.paper-title a:hover {
  color: var(--accent-secondary);
  text-decoration: none;
}

.paper-authors {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.paper-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.paper-abstract {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.paper-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-secondary);
  color: #ffffff;
  border: 1px solid transparent;
}

.btn-primary:hover {
  background: var(--text-link-hover);
  color: #ffffff;
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-dark);
  text-decoration: none;
}

/* Paper Grid List */
.papers-section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.paper-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.paper-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.paper-card:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-md);
}

/* Footer */
.site-footer {
  margin-top: auto;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 2.5rem 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

/* Utility & Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.85rem;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-wrapper {
    max-width: 100%;
  }
}

