
/* Complete theme overhaul to match sophisticated black modern aesthetic */
/* CSS Variables for Professional Black Theme */
:root {
  --primary-bg: #000000;
  --secondary-bg: #0a0a0a;
  --tertiary-bg: #111111;
  --accent-blue: #00d4ff;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --card-bg: rgba(17, 17, 17, 0.95);
  --border-color: rgba(255, 255, 255, 0.1);
  --glow-color: rgba(0, 212, 255, 0.3);
  --font-heading: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --radius: 0.5rem;
}

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

body {
  font-family: var(--font-body);
  background: var(--primary-bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* Planet Background Layer */
.planet-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -4;
  background: url("../public/images/earth-4k-bg.png") no-repeat;
  background-size: cover;
  background-position: center bottom;
  opacity: 0.3;
  filter: blur(0.5px);
  animation: planetFloat 60s ease-in-out infinite alternate;
}

.planet-background::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse 60% 40% at 50% 80%, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
  animation: planetGlow 8s ease-in-out infinite alternate;
}

.planet-background::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 40%, rgba(0, 0, 0, 0.7) 100%);
}

/* Additional Earth atmosphere glow layer */
.earth-atmosphere {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -3;
  background: radial-gradient(
    ellipse 80% 50% at 50% 85%,
    rgba(135, 206, 235, 0.04) 0%,
    rgba(0, 191, 255, 0.02) 30%,
    transparent 60%
  );
  animation: atmosphereGlow 12s ease-in-out infinite alternate;
}

/* Sophisticated Background Effects */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -2;
  background: radial-gradient(1px 1px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 40px 70px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(0.5px 0.5px at 90px 40px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(0.5px 0.5px at 130px 80px, rgba(0, 212, 255, 0.3), transparent),
    radial-gradient(1px 1px at 160px 30px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(0.5px 0.5px at 200px 20px, rgba(139, 92, 246, 0.3), transparent);
  background-repeat: repeat;
  background-size: 400px 200px;
  animation: subtleTwinkle 8s ease-in-out infinite alternate;
}

.nebula {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse 800px 600px at 20% 10%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse 600px 800px at 80% 90%, rgba(139, 92, 246, 0.02) 0%, transparent 50%),
    radial-gradient(ellipse 1000px 400px at 50% 50%, rgba(6, 182, 212, 0.01) 0%, transparent 60%);
  animation: subtleNebulaDrift 30s ease-in-out infinite alternate;
}

/* Bio-inspired molecular patterns */
.bio-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3Ccircle cx='10' cy='10' r='1'/%3E%3Ccircle cx='50' cy='50' r='1'/%3E%3Cpath d='M30 10 L30 50 M10 30 L50 30' stroke='%23ffffff' stroke-width='0.5' stroke-opacity='0.1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  animation: bioPatternFloat 40s linear infinite;
}

/* Header Styles */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 2rem 0;
}

.nav {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

/* Made nav-brand a clickable link with hover effects */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  cursor: pointer;
}

.nav-brand:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.nav-brand:hover .nasa-logo {
  transform: scale(1.1);
}

.nasa-logo {
  font-size: 1.5rem;
  filter: grayscale(1) brightness(2);
  transition: transform 0.3s ease;
}

.brand-text {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.nav-brand:hover .brand-text {
  color: var(--accent-blue);
}

/* Added navigation menu styles */
.nav-menu {
  display: flex;
  gap: 2rem;
  margin-left: auto;
}

.nav-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: 1rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--accent-blue);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-blue);
}

/* Main Content */
.main {
  padding-top: 5rem;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 2rem;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.9;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
}

/* Search Container */
.search-container {
  margin: 3rem 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.search-box {
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
}

.search-box:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}

.search-input {
  flex: 1;
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  font-family: var(--font-body);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  padding: 1rem 1.5rem;
  background: var(--accent-blue);
  border: none;
  color: var(--primary-bg);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.search-btn:hover {
  background: var(--accent-cyan);
}

.search-icon {
  font-size: 1.2rem;
}

/* Quick Filters */
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.filter-pill {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 2rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.filter-pill:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.05);
}

/* Loading Animation */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(10px);
}

.loading-animation {
  text-align: center;
}

.orbit {
  width: 80px;
  height: 80px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  position: relative;
  margin: 0 auto 2rem;
  animation: rotate 2s linear infinite;
}

.satellite {
  width: 8px;
  height: 8px;
  background: var(--accent-blue);
  border-radius: 50%;
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
}

.loading-text {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 2rem 2rem;
  /* margin-top: 4rem; */
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-section p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.footer-logos {
  display: flex;
  gap: 2rem;
}

.footer-logo {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Search Page Specific Styles */
.search-main {
  padding-top: 5rem;
}

.search-header {
  padding: 3rem 0 2rem;
  text-align: center;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.query-display {
  max-width: 900px;
  margin: 0 auto;
}

.query-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: var(--accent-blue);
  font-style: italic;
}

.query-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
}

.response-content {
  padding: 3rem 0;
}

.response-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 3rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Summary Section */
.summary-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.summary-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2.5rem;
  position: relative;
}

.summary-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  border-radius: var(--radius) var(--radius) 0 0;
}

.summary-title {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.summary-text {
  line-height: 1.7;
  color: var(--text-secondary);
}

.summary-paragraph {
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.summary-paragraph:last-child {
  margin-bottom: 0;
}

.findings-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
}

.findings-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.findings-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.finding-item {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  line-height: 1.6;
  position: relative;
  padding-left: 1.5rem;
}

.finding-item:last-child {
  border-bottom: none;
}

.finding-item::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 1rem;
  color: var(--accent-blue);
  font-weight: 500;
}

/* References Sidebar */
.references-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  height: fit-content;
  position: sticky;
  top: 6rem;
}

.references-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
}

.references-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.references-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.reference-item {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: calc(var(--radius) * 0.75);
  transition: all 0.3s ease;
}

.reference-item:hover {
  border-color: var(--accent-blue);
  background: rgba(0, 212, 255, 0.02);
}

.reference-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.reference-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.reference-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.reference-source {
  font-weight: 500;
  color: var(--accent-purple);
}

.reference-year {
  color: var(--text-muted);
}

.reference-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.reference-link:hover {
  color: var(--accent-cyan);
  transform: translateX(2px);
}

.related-topics-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
}

.related-title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.related-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.related-tag {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
  transition: all 0.3s ease;
  cursor: pointer;
}

.related-tag:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.05);
}

/* Research page styles */
.research-main {
  padding-top: 5rem;
  min-height: 100vh;
}

.research-header {
  padding: 3rem 0 2rem;
  text-align: center;
}

.page-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.research-search-container {
  max-width: 700px;
  margin: 2rem auto;
}

.research-search-container .search-box {
  border-radius: 2rem;
  text-align: center;
  
}

.research-layout {
  display: flex;
  gap: 3rem;
  margin-top: 3rem;
}

/* Filters Sidebar */
.filters-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  height: fit-content;
  position: sticky;
  top: 6rem;
  transition: transform 0.3s ease;
}

.filters-sidebar.closed {
  transform: translateX(-120%);
}

.filter-section {
  background: transparent;
  border: none;
  padding: 0;
}

.filter-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.filter-group {
  margin-bottom: 2rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
}
.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    appearance: none; /* hide default styles */
    border: 2px solid rgba(255, 255, 255, 0.2); /* light but not pure white */
    border-radius: 4px;
    background-color: var(--secondary-bg);
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.1); /* subtle highlight */
}
/* Hover effect */
.filter-checkbox input[type="checkbox"]:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 6px var(--glow-color);
}

/* Checked state */
.filter-checkbox input[type="checkbox"]:checked {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Checkmark */
.filter-checkbox input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 9px;
    border: solid #ffffff; /* white checkmark */
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg); /* perfectly centered */
}

.filter-checkbox:hover {
  color: var(--text-primary);
}

.filter-reset-btn {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1.5rem;
}

.filter-reset-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.05);
}

/* Research Controls */
.research-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-family: var(--font-body);
    color: var(--text-secondary);
}

.results-count {
    font-size: 0.95rem;
}

/* Sort controls container */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

/* Label */
.sort-controls label {
    color: var(--text-secondary);
}

/* Custom select */
.sort-select {
    appearance: none; /* Remove default arrow */
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    padding: 0.35rem 0.8rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    min-width: 150px;
    position: relative;
}

/* Hover/focus effect */
.sort-select:hover,
.sort-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 6px var(--glow-color);
    outline: none;
}

/* Add a custom arrow */
.sort-select::after {
    content: '▼';
    position: absolute;
    right: 1rem;
    pointer-events: none;
}

/* For better spacing inside the select in some browsers */
.sort-select option {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
}


/* Research Content */
.research-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  position: fixed;
  top: 5.5rem;
  left: 1rem;
  z-index: 1001;
  background: var(--accent-blue);
  color: var(--primary-bg);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

/* Research Grid */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.research-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.research-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.1);
}

.research-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.research-category {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
}

.research-status {
  font-size: 0.85rem;
  font-weight: 500;
}

.research-card-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
}

.research-card-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex-grow: 1;
}

.research-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.meta-label {
  color: var(--text-muted);
}

.meta-value {
  color: var(--text-secondary);
  font-weight: 500;
}

.research-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.research-card-btn{
  margin-top: 1rem;
  padding: 0.5rem 1rem;

  border: none;
  border-radius: var(--radius);
  color: var(--primary-bg);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.pagination-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-btn:hover:not(.disabled) {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.05);
}

.pagination-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #000;
}

.pagination-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-ellipsis {
  color: var(--text-muted);
  padding: 0 0.5rem;
}

.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Knowledge Hub styles */
.knowledge-main {
  padding-top: 5rem;
  min-height: 100vh;
}

.knowledge-header {
  padding: 3rem 2rem 2rem;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}

.knowledge-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.control-group label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.control-select {
  padding: 0.5rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 150px;
}

.control-btn {
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.control-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.05);
}

.knowledge-container {
  display: flex;
  height: calc(100vh - 300px);
  min-height: 600px;
}

/* Legend Sidebar */
.legend-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.5);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.legend-sidebar.closed {
  transform: translateX(-120%);
}

.legend-section {
  margin-bottom: 2rem;
}

.legend-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent-blue);
  margin-bottom: 1rem;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #000;
}

.legend-item span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.legend-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Node Details Panel */
.node-details {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.node-details-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.node-details-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.node-details-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

/* Graph Container */
.graph-container {
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
  flex-grow: 1;
}

#knowledgeGraph {
  width: 100%;
  height: 100%;
}

.graph-node circle {
  transition: all 0.2s ease;
}

.graph-link {
  transition: all 0.3s ease;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.overlay.active {
  display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .response-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .nav {
    padding: 0 2rem;
  }

  .hero {
    padding: 1rem;
    min-height: 90vh;
  }

  .hero-title {
    font-size: clamp(2rem, 10vw, 4rem);
  }

  .quick-filters {
    gap: 0.5rem;
  }

  .filter-pill {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .query-title {
    font-size: clamp(1.5rem, 8vw, 2.5rem);
  }

  .summary-card,
  .findings-card,
  .references-card,
  .related-topics-card {
    padding: 1.5rem;
  }

  .response-layout {
    padding: 0 1rem;
  }

  .references-sidebar {
    gap: 1.5rem;
  }

  .research-layout {
    display: block;
  }

  .filters-sidebar {
    position: fixed;
    left: 0;
    top: 5rem;
    bottom: 0;
    height: auto;
    z-index: 1000;
    transform: translateX(-100%);
    border-radius: 0;
    max-width: 80%;
  }

  .filters-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle-btn {
    display: flex;
  }

  .knowledge-container {
    display: block;
  }

  .legend-sidebar {
    position: fixed;
    left: 0;
    top: 5rem;
    bottom: 0;
    height: auto;
    z-index: 1000;
    transform: translateX(-100%);
    border-radius: 0;
    border-right: none;
    max-width: 80%;
  }

  .legend-sidebar.open {
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .nav-menu {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.85rem;
  }

  .research-grid {
    grid-template-columns: 1fr;
  }

  .research-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .knowledge-controls {
    flex-direction: column;
    gap: 1rem;
  }

  .control-group {
    width: 100%;
  }

  .control-select {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .summary-card,
  .findings-card,
  .references-card,
  .related-topics-card {
    padding: 1.25rem;
  }

  .reference-item {
    padding: 1.25rem;
  }

  .related-tags {
    gap: 0.25rem;
  }

  .related-tag {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .stars {
    background-size: 200px 100px;
  }
}

/* Animations */
@keyframes subtleTwinkle {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes subtleNebulaDrift {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  50% {
    transform: translateX(20px) translateY(-10px) rotate(1deg);
  }
}

@keyframes bioPatternFloat {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100px);
  }
}

@keyframes planetFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.02);
  }
}

@keyframes planetGlow {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@keyframes atmosphereGlow {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}












/* Scroll Bar  */
/* Tiny dark-themed scrollbar */
::-webkit-scrollbar {
  width: 6px;       /* very thin scrollbar */
  height: 6px;      /* for horizontal scroll */
}

::-webkit-scrollbar-track {
  background: var(--tertiary-bg);   /* track color */
  border-radius: var(--radius);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-cyan);   /* thumb color */
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);   /* hover color */
}

::-webkit-scrollbar-corner {
  background: var(--tertiary-bg);   /* corner for two scrollbars */
}


.research-main{
  margin-bottom: 3rem;
}