:root {
  /* Color Palette - Obsidian Gold */
  --bg-dark: #010103;
  --bg-panel: rgba(5, 5, 8, 0.85);
  --border-glass: rgba(212, 175, 55, 0.12);
  --border-highlight: rgba(212, 175, 55, 0.45);

  --accent-gold: #d4af37;
  --accent-spark: #fff7e0;
  --accent-secondary: #ffcc00;

  --text-primary: #ffffff;
  --text-secondary: #c0c0d0;
  --text-muted: #555566;

  --glow-gold: 0 0 15px rgba(212, 175, 55, 0.5), 0 0 30px rgba(212, 175, 55, 0.15);
  --glow-text: 0 0 8px rgba(212, 175, 55, 0.7);

  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --font-body: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Blobs */
.blob {
  position: absolute;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.5;
  border-radius: 50%;
  animation: float 10s infinite alternate ease-in-out;
}
.blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-gold), transparent 70%);
  top: -100px;
  left: -100px;
  opacity: 0.15;
}
.blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-gold), transparent 70%);
  bottom: -100px;
  right: -100px;
  animation-delay: -5s;
  opacity: 0.1;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 30px) scale(1.1); }
}

/* Glassmorphism */
.glass-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), inset 0 0 30px rgba(212, 175, 55, 0.03);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.glass-panel:hover {
  border-color: var(--border-highlight);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.08);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  padding: 24px;
  gap: 24px;
  max-width: 1800px;
  margin: 0 auto;
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
}
.gradient-text {
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 30px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}
.logo-icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-secondary));
  border-radius: 6px;
  box-shadow: var(--glow-gold);
}
.logo h2 {
  font-size: 1.2rem;
  letter-spacing: 1px;
}

.nav-links {
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-links li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links li .icon {
  width: 20px;
  height: 20px;
}
.nav-links li:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.nav-links li.active {
  color: var(--text-primary);
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.1), transparent);
  border-left: 3px solid var(--accent-gold);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border-glass);
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-heading);
  color: #000;
}
.user-info {
  display: flex;
  flex-direction: column;
}
.user-name {
  font-size: 0.9rem;
  font-weight: 600;
}
.user-role {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 8px;
}

/* Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.greeting h1 {
  font-size: 2rem;
  font-weight: 800;
}
.greeting p {
  color: var(--text-secondary);
  margin-top: 4px;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  flex: 1;
  max-width: 400px;
}
.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  width: 100%;
}
.glass-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text-primary);
  outline: none;
  transition: border 0.3s ease;
  font-family: var(--font-body);
  flex: 1;
}
.glass-input:focus {
  border-color: var(--accent-gold);
}

/* Buttons */
.btn-glow {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-secondary));
  border: none;
  border-radius: 12px;
  padding: 0 35px;
  height: 56px;
  color: #000;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: var(--glow-gold);
}
.btn-glow:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 10px 40px rgba(212, 175, 55, 0.4), 0 0 80px rgba(212, 175, 55, 0.1);
}
.btn-glow:active { transform: translateY(-1px); }

.btn-ghost {
  background: none;
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}
.btn-ghost:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.btn-outline-neon {
  background: transparent;
  border: 2px solid var(--accent-gold);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--accent-gold);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-outline-neon:hover {
  background: rgba(212, 175, 55, 0.1);
  box-shadow: var(--glow-gold);
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.stat-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.stat-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.08);
}
.stat-icon svg {
  width: 24px;
  height: 24px;
}
.stat-icon.cyan { color: var(--accent-gold); box-shadow: 0 0 15px rgba(212, 175, 55, 0.2) inset; }
.stat-icon.purple { color: var(--accent-gold); box-shadow: 0 0 15px rgba(212, 175, 55, 0.2) inset; }
.stat-icon.pink { color: var(--accent-secondary); box-shadow: 0 0 15px rgba(255, 204, 0, 0.2) inset; }

.stat-details h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.stat-number {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-heading);
}
.stat-trend {
  font-size: 0.8rem;
  margin-top: 2px;
}
.stat-trend.positive { color: #34d399; }
.stat-trend.negative { color: #f87171; }
.stat-trend.neutral { color: var(--text-muted); }

/* Projects Section */
.projects-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Project Card */
.project-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  transition: transform 0.4s ease;
}
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.project-title {
  font-size: 1.1rem;
  font-weight: 700;
}
.project-tech {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Status Badges */
.status-badge {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-active {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.status-building {
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

/* Project Footer */
.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-glass);
  font-size: 0.75rem;
}
.btn-portal-small {
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-portal-small:hover {
  background: var(--accent-gold);
  color: #000;
}

/* AI Generator Section */
.ai-generator-section {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ai-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ai-controls {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.flex-grow { flex: 1; }
.btn-group {
  display: flex;
  gap: 8px;
}

/* AI Result Box */
.ai-result-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 24px;
}
h4.pink { color: var(--accent-secondary); font-size: 1.1rem; margin-bottom: 15px;}
.ai-content-markdown {
  line-height: 1.8;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* File Drop Zone */
.file-drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  border: 1px dashed var(--border-glass);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-muted);
}
.file-drop-zone:hover {
  border-color: var(--accent-gold);
  color: var(--text-secondary);
}
.file-drop-zone.dragover {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.05);
}
.file-drop-zone.file-loaded {
  border-color: #34d399;
  color: #34d399;
}
.btn-icon {
  background: none;
  border: none;
  color: var(--accent-secondary);
  cursor: pointer;
  font-size: 1rem;
}

/* Retention HUD */
.hud-analysis-box {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--accent-secondary);
  border-radius: 16px;
  padding: 24px;
  position: relative;
}
.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.badget-neon {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(212, 175, 55, 0.1);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  letter-spacing: 2px;
}
.close-hud {
  cursor: pointer;
  color: var(--accent-secondary);
  font-size: 1.2rem;
}
.hud-body {
  line-height: 1.8;
  color: var(--text-secondary);
}
.loading-text {
  color: var(--accent-gold);
  text-shadow: 0 0 5px var(--accent-gold);
}

/* Security Panel */
.system-health-panel {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  margin-top: 8px;
}
.health-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.status-indicator {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 700;
}
.status-indicator.online {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.health-log {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  max-height: 120px;
  overflow-y: auto;
}
.health-log p {
  padding: 3px 0;
  border-left: 2px solid var(--accent-gold);
  padding-left: 10px;
  margin-bottom: 4px;
}

/* System HUD */
.system-hud {
  margin-top: auto;
  padding-top: 20px;
}
.hud-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.radial-progress {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radial-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 6;
}
.radial-bar {
  fill: none;
  stroke: var(--accent-gold);
  stroke-width: 6;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 1s ease;
}
.hud-value {
  position: absolute;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--accent-gold);
  text-shadow: 0 0 5px var(--accent-gold);
}

/* Icon Utilities */
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.icon.cyan { color: var(--accent-gold); }
.icon.pink { color: var(--accent-secondary); }

/* Menu System */
.menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}
.menu-item:hover {
  color: var(--text-primary);
  background: rgba(212, 175, 55, 0.06);
}
.menu-item.active {
  color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.1);
  border-left: 3px solid var(--accent-gold);
}

/* Missions List */
.missions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.section-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.mission-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.completed { background: var(--accent-gold); }
.dot.building, .dot.in.progress { background: var(--accent-secondary); }

/* Container holographic */
.container-holo {
  display: contents;
}
.holographic-sidebar {
  position: relative;
  overflow: hidden;
}

/* Particles Canvas */
#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* Loader */
.loader {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.2);
  border-top: 3px solid #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Hologlide Button */
.hologlide-btn {
  position: relative;
  overflow: hidden;
}

/* Pulse Glow */
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.3)); }
  50% { filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.6)); }
}

.pulse-icon {
  animation: pulseGlow 3s ease-in-out infinite;
}

/* Fade In Animation */
.fade-in {
  animation: fadeInUp 0.6s ease-out both;
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .stats-row {
    grid-template-columns: 1fr;
  }
  .top-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .search-bar {
    max-width: 100%;
  }
  .ai-controls {
    flex-direction: column;
  }
}

/* Portal Footer Color */
.project-footer .cyan, .project-footer span {
  color: var(--accent-gold);
  font-family: var(--font-mono);
}
