/* --- CORE VARIABLES --- */
:root {
  --bg: #050505;
  --surface: #111111;
  --text: #e0e0e0;
  --text-muted: #888888;
  --text-white: #ffffff;
  --accent: #00d4ff;
  --accent-hover: #00b8d4;
  --accent-secondary: #bd00ff;
  --neon-cyan: #00d4ff;
  --chat-user-bg: #00d4ff;
  --chat-bot-bg: #1a1a1a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- 1. SLEEK TOP NAVIGATION --- */
.top-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000; /* High z-index to sit above particles */
  background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%);
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.nav-tag {
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
}

.nav-links a:hover {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* --- 2. UNIFIED HERO SECTION --- */
.cyber-header {
  height: 85vh;
  min-height: 600px;
  background-color: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
}

.hero-content {
  max-width: 900px;
  padding: 2rem 2rem 6rem 2rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInUp 1.2s ease-out;
}

.neon-title {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: #fff;
  text-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
  background: linear-gradient(180deg, #ffffff 0%, #a0a0a0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 1.4rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
  max-width: 700px;
  font-weight: 300;
}

/* Search Bar Inside Hero */
.search-container-hero {
  width: 100%;
  max-width: 550px;
  position: relative;
}

.search-box {
  position: relative;
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 50px;
  display: flex;
  align-items: center;
  padding: 15px 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
  background: rgba(20, 20, 20, 0.9);
  transform: scale(1.02);
}

.search-icon {
  color: var(--accent);
  font-size: 1.2rem;
  margin-right: 15px;
}

#neuralSearch {
  background: transparent;
  border: none;
  color: #fff;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  width: 100%;
  outline: none;
  letter-spacing: 1px;
}

#neuralSearch::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.search-beam {
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  height: 2px;
  width: 0%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transition: width 0.3s ease;
}

.search-box:focus-within .search-beam {
  width: 80%;
}

/* --- MAIN LAYOUT --- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 100px 20px;
  position: relative;
  z-index: 2;
  margin-top: -60px; /* Overlap the hero slightly */
}

.main-section {
  margin-bottom: 120px;
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
  gap: 20px;
}

.section-header h2 {
  font-size: 1.8rem;
  color: #fff;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
  background: none;
  border: none;
  width: auto;
  padding: 0;
}

.header-line {
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  width: 100%;
  opacity: 0.3;
}

/* --- 3. THE LAB (Status Cards) --- */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px; /* Ensure gap is present */
  margin-bottom: 20px;
}

.lab-card {
  background: #111;
  border: 1px solid #222;
  border-radius: 16px;
  padding: 30px;
  transition: transform 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.lab-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-icon {
  font-size: 1.8rem;
  color: var(--accent);
}

.status-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status-live {
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.lab-card h3 {
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.lab-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- 4. JOURNEY BANNER (Updated with Image) --- */
.journey-banner {
  background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
  border: 1px solid #333;
  border-radius: 20px;
  padding: 0; /* Remove padding to let image flush */
  display: flex;
  position: relative;
  overflow: hidden;
  min-height: 350px;
}

.journey-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  z-index: 2;
}

.journey-content {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
}

.journey-text {
  flex: 1;
  padding: 50px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.journey-text h2 {
  font-size: 2.2rem;
  color: #fff;
  margin-bottom: 20px;
  background: none;
  border: none;
  text-align: left;
  padding: 0;
  width: auto;
}

.journey-text p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.journey-text strong {
  color: var(--text-white);
}

.journey-image-container {
  flex: 1;
  min-width: 300px;
  position: relative;
  overflow: hidden;
}

.journey-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: transform 0.5s ease;
}

.journey-banner:hover .journey-image {
  transform: scale(1.05);
  opacity: 1;
}

/* --- 5. NEWS SECTION --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.news-card {
  background: #111;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 25px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  border-color: var(--accent-secondary);
  transform: translateY(-5px);
}

.news-card h3 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 15px;
  line-height: 1.4;
}

.news-card .summary {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  margin-top: auto;
}

.btn-summary {
  font-size: 0.85rem;
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-summary:hover {
  background: var(--accent);
  color: #000;
}

.load-more-container {
  text-align: center;
  margin-top: 40px;
}

/* --- 6. CHAT SECTION --- */
.chat-interface {
  background: #111;
  border-radius: 20px;
  padding: 25px;
  border: 1px solid #222;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.chat-header {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.chat-history {
  height: 400px;
  overflow-y: auto;
  border: 1px solid #222;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  max-width: 80%;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.msg-user {
  align-self: flex-end;
  background-color: var(--chat-user-bg);
  color: #000;
  border-bottom-right-radius: 2px;
}

.msg-bot {
  align-self: flex-start;
  background-color: var(--chat-bot-bg);
  color: #fff;
  border: 1px solid #333;
  border-bottom-left-radius: 2px;
}

.input-area {
  display: flex;
  gap: 15px;
}

.chat-input {
  flex-grow: 1;
  background: #0a0a0a;
  border: 1px solid #333;
  color: white;
  padding: 15px 25px;
  border-radius: 50px;
  font-size: 1rem;
  outline: none;
}

.chat-input:focus {
  border-color: var(--accent);
}

.btn-send {
  background: var(--accent);
  color: #000;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: transform 0.2s;
}

.btn-send:hover {
  transform: scale(1.1);
}

/* --- FOOTER --- */
footer {
  text-align: center;
  padding: 60px 20px;
  background: #050505;
  color: #444;
  font-size: 0.9rem;
  border-top: 1px solid #111;
}

/* --- MODAL --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #111;
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 40px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #666;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-content h3 {
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.modal-body {
  color: #ccc;
  line-height: 1.8;
  margin-bottom: 30px;
}

.btn-source {
  display: inline-flex;
  align-items: center;
  color: var(--accent-secondary);
  text-decoration: none;
  font-weight: 600;
  gap: 8px;
}

.btn-source:hover {
  text-decoration: underline;
}

/* --- BUTTONS --- */
.cyber-button {
  display: inline-flex;
  align-items: center;
  padding: 15px 35px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.cyber-button:hover {
  background: #fff;
  transform: translateX(5px);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.cyber-button.ghost {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.cyber-button.ghost:hover {
  background: var(--accent);
  color: #000;
}

.cyber-button i {
  margin-left: 10px;
}

/* --- TIMELINE / JOURNEY PAGE SPECIFIC --- */
/* These styles were missing, causing the journey page to break */

#timeline-grid.lab-grid {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 60px;
    position: relative;
    gap: 40px;
    justify-content: flex-start;
}

#timeline-grid.lab-grid::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 4px;
    background: rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
    border-radius: 2px;
}

#timeline-grid .lab-card {
    width: 100%;
    position: relative;
    margin: 0;
    border-left: 4px solid var(--accent);
    padding: 0; /* Reset padding for image layout */
    overflow: hidden;
}

#timeline-grid .lab-card::after {
    content: '';
    position: absolute;
    left: -48px;
    top: 30px;
    width: 16px;
    height: 16px;
    background: #0b0c15;
    border: 2px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    z-index: 2;
    transition: all 0.3s ease;
}

#timeline-grid .lab-card:hover::after {
    background: var(--accent);
    box-shadow: 0 0 25px var(--accent);
    transform: scale(1.2);
}

.lab-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    display: block;
}

.lab-card-text {
    padding: 25px;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .neon-title {
    font-size: 3rem;
  }
  
  .top-nav {
    padding: 20px;
    flex-direction: column;
    gap: 15px;
  }
  
  .nav-links {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-content {
    padding-top: 160px;
  }

  main {
    margin-top: 0;
  }
  
  .journey-banner {
    flex-direction: column;
  }
  
  .journey-image-container {
    height: 250px;
  }
  
  #timeline-grid.lab-grid {
    padding-left: 40px;
  }
  
  #timeline-grid.lab-grid::before {
    left: 10px;
  }
  
  #timeline-grid .lab-card::after {
    left: -38px;
  }
}

/* --- ANIMATIONS --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- TOGGLE SWITCH (Chat) --- */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.model-dropdown {
  background: #0d0d0d;
  color: #fff;
  border: 1px solid #333;
  padding: 5px 10px;
  border-radius: 4px;
}