/* ==========================================================================
   NeuroOS — Cognitive Sovereignty & Subconscious Reprogramming Suite
   Deep obsidian theme with electric violet, cyan, amber, and emerald accents
   ========================================================================== */

:root {
  --bg-main: #060913;
  --bg-card: rgba(14, 20, 38, 0.75);
  --bg-card-hover: rgba(22, 32, 60, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(139, 92, 246, 0.4);
  --primary: #8b5cf6;
  --primary-glow: rgba(139, 92, 246, 0.25);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.25);
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.25);
  --emerald: #10b981;
  --rose: #f43f5e;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(6, 182, 212, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Glassmorphism Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* Header & Nav */
.header-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(6, 9, 19, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff, #c4b5fd, #67e8f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 1rem;
  margin: 1rem 0 2rem 0;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(139, 92, 246, 0.3);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.15));
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Studio Sections */
.studio-pane {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.studio-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Input & Select */
input, select, textarea {
  width: 100%;
  background: rgba(10, 15, 30, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-main);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Gamma Wave Visualizer Pulse */
.gamma-pulse-orb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, #8b5cf6 0%, #06b6d4 60%, transparent 100%);
  margin: 1.5rem auto;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.6);
  position: relative;
  transition: all 0.1s ease;
}

.gamma-pulse-active {
  animation: gammaPulseAnim 0.025s infinite alternate; /* 40Hz feel */
}

@keyframes gammaPulseAnim {
  0% { transform: scale(0.96); opacity: 0.85; filter: hue-rotate(0deg); }
  100% { transform: scale(1.04); opacity: 1; filter: hue-rotate(25deg); }
}

/* Bilateral Eye Tracker Dot */
.bilateral-track {
  width: 100%;
  height: 48px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.bilateral-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #06b6d4;
  box-shadow: 0 0 15px #06b6d4;
  position: absolute;
  top: 12px;
  left: 10px;
}

.bilateral-dot-running {
  animation: bilateralSweep 1.8s infinite ease-in-out alternate;
}

@keyframes bilateralSweep {
  0% { left: 12px; }
  100% { left: calc(100% - 36px); }
}

/* Mind Map Canvas */
#mindmap-canvas {
  width: 100%;
  height: 520px;
  background: radial-gradient(circle at center, #0e1529 0%, #050711 100%);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  cursor: grab;
}

#mindmap-canvas:active {
  cursor: grabbing;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-purple { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-cyan { background: rgba(6, 182, 212, 0.15); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-gold { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.3); }

/* Range Slider */
input[type=range] {
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  height: 8px;
  border-radius: 4px;
  border: none;
  padding: 0;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  cursor: pointer;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}