/* CoSE / DeepSpaceAg Theme & Responsive Layout */
:root {
  --primary: #005696;
  --primary-dark: #003b68;
  --primary-light: #eef4f8;
  --accent: #e31837;
  --teal: #3FB6A8;
  --coral: #E85D50;
  --gold: #F59E0B;
  --dark: #0b192c;
  --dark-card: #13243c;
  --light: #f8fafc;
  --border: #e2e8f0;
  --border-dark: #1e3a5f;
  --text: #334155;
  --text-dark: #e2e8f0;
  --text-muted: #64748b;
  --radius: 10px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
  --bg: #070d18;
  --bg-card: #0f1c2e;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #1e3a5f;
  --primary-light: #162c46;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background-color: var(--light);
  line-height: 1.6;
}

[data-theme="dark"] body {
  background-color: var(--bg);
}

/* Layering CoSE rails above page components */
.topbar.cose-dark, .topbar.cose-light { z-index: 10001 !important; }
.sitebar.cose-dark, .sitebar.cose-light { z-index: 10000 !important; }
.map-scrim { z-index: 9999 !important; }

/* HERO HEADER */
header.hero {
  background: linear-gradient(135deg, #071527 0%, #0d274c 50%, #005696 100%);
  color: white;
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid rgba(63, 182, 168, 0.3);
}

header.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at top right, rgba(232, 93, 80, 0.18), transparent 65%);
  pointer-events: none;
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.badge-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: #e2e8f0;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1.2rem;
  color: #ffffff;
}

.hero .authors {
  font-size: 1.05rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.hero .affiliation {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 1.8rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--coral);
  color: white;
  border-color: var(--coral);
}
.btn-primary:hover {
  background: #d44d41;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-teal {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
.btn-teal:hover {
  background: #349b8f;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}
.btn-secondary:hover {
  background: #334155;
}

/* STICKY TOP NAVIGATION BAR */
nav.nav-bar {
  background: #09182b;
  border-bottom: 1px solid #1e3a5f;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0 1rem;
  scrollbar-width: none;
}
.nav-container::-webkit-scrollbar {
  display: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.1rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: #ffffff;
  border-bottom-color: var(--teal);
  background: rgba(63, 182, 168, 0.15);
}

.theme-toggle-btn {
  margin-left: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--teal);
  color: #ffffff;
}

/* Light Mode Overrides */
[data-theme="light"] body,
[data-theme="light"] .page {
  background-color: #f8fafc !important;
  color: #334155 !important;
}

[data-theme="light"] nav.nav-bar {
  background: #ffffff;
  border-bottom: 1px solid #cbd5e1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

[data-theme="light"] .nav-link {
  color: #475569;
}

[data-theme="light"] .nav-link:hover {
  color: #005696;
  background: #f1f5f9;
}

[data-theme="light"] .nav-link.active {
  color: #005696;
  border-bottom-color: #005696;
  background: #eef4f8;
  font-weight: 700;
}

[data-theme="light"] .theme-toggle-btn {
  background: #f1f5f9;
  color: #005696;
  border: 1.5px solid #005696;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .theme-toggle-btn:hover {
  background: #005696;
  color: #ffffff;
  box-shadow: 0 4px 8px rgba(0, 86, 150, 0.25);
}

[data-theme="light"] .card {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .card h3 {
  color: #005696 !important;
}

[data-theme="light"] .card h4 {
  color: #0f172a !important;
}

[data-theme="light"] .card p,
[data-theme="light"] .card li {
  color: #334155 !important;
}

[data-theme="light"] .abstract-box {
  background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 100%) !important;
  border: 1px solid #ccfbf1 !important;
  border-left: 4px solid #0d9488 !important;
  color: #1e293b !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .abstract-box h3 {
  color: #0d9488 !important;
}

[data-theme="light"] .abstract-box p {
  color: #334155 !important;
}

[data-theme="light"] .metric-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .metric-val {
  color: #0d9488 !important;
}

[data-theme="light"] .metric-label {
  color: #64748b !important;
}

[data-theme="light"] .section-header h2 {
  color: #005696 !important;
}

[data-theme="light"] .section-header p {
  color: #64748b !important;
}

[data-theme="light"] .control-panel {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .control-panel label,
[data-theme="light"] .control-panel span {
  color: #334155 !important;
}

[data-theme="light"] .control-panel select,
[data-theme="light"] .control-panel input[type="text"] {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .data-table th {
  background: #f1f5f9 !important;
  color: #005696 !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

[data-theme="light"] .data-table td {
  color: #334155 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .data-table tr:hover td {
  background: #f8fafc !important;
}

[data-theme="light"] #cy {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] footer.site-footer {
  background: #f1f5f9 !important;
  border-top: 1px solid #e2e8f0 !important;
  color: #64748b !important;
}

[data-theme="light"] footer.site-footer a {
  color: #005696 !important;
}


/* MAIN CONTAINER */
main.container {
  max-width: 1350px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* TAB PANELS */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* EXECUTIVE ABSTRACT CALLOUT */
.abstract-box {
  background: linear-gradient(to right, #0d2238, #132a48);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  color: #e2e8f0;
}

.abstract-box h3 {
  font-size: 1.15rem;
  color: var(--teal);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.abstract-box p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #cbd5e1;
}

/* KEY METRICS ROW */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background: #0f1c2e;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
}

.metric-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.metric-label {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 500;
}

/* SECTION HEADERS */
.section-header {
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

[data-theme="dark"] .section-header h2 {
  color: #60a5fa;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

/* CARDS & GRIDS */
.card {
  background: #0f1c2e;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  color: #e2e8f0;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: #38bdf8;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* CONTROL PANELS */
.control-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  background: #091524;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-dark);
  margin-bottom: 1.25rem;
}

.control-panel label {
  font-weight: 600;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.control-panel input, .control-panel select {
  background: #13243c;
  color: #f1f5f9;
  border: 1px solid #27456b;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.88rem;
}

/* BADGES */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(63, 182, 168, 0.15);
  color: var(--teal);
  border: 1px solid rgba(63, 182, 168, 0.3);
}

.badge-coral {
  background: rgba(232, 93, 80, 0.15);
  color: var(--coral);
  border-color: rgba(232, 93, 80, 0.3);
}

/* DATA TABLES */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 0.5rem;
}

.data-table th {
  background: #091524;
  color: #38bdf8;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border-dark);
  font-weight: 600;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

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

/* FOOTER */
footer.site-footer {
  background: #060e1a;
  border-top: 1px solid var(--border-dark);
  color: #94a3b8;
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.88rem;
  margin-top: 4rem;
}

footer.site-footer a {
  color: var(--teal);
  text-decoration: none;
}
footer.site-footer a:hover {
  text-decoration: underline;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.6rem; }
  .card-grid { grid-template-columns: 1fr; }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
}