/* ═══════════════════════════════════════════════
   TutuAI - Dark Futuristic Electronics Theme
   ═══════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f1a;
  --bg-card: rgba(15, 15, 30, 0.7);
  --bg-glass: rgba(15, 15, 30, 0.5);
  --neon-cyan: #00f0ff;
  --neon-green: #00ff88;
  --neon-purple: #a855f7;
  --neon-blue: #3b82f6;
  --text-primary: #e8e8f0;
  --text-secondary: #8888aa;
  --text-muted: #555570;
  --border-color: rgba(0, 240, 255, 0.12);
  --border-glow: rgba(0, 240, 255, 0.3);
  --shadow-neon: 0 0 20px rgba(0, 240, 255, 0.15);
  --shadow-neon-strong: 0 0 40px rgba(0, 240, 255, 0.25);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ═══════ SCROLLBAR ═══════ */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.4);
}

/* ═══════ CIRCUIT BACKGROUND ═══════ */
.circuit-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.circuit-svg {
  width: 100%;
  height: 100%;
  opacity: 0.15;
}

.trace {
  fill: none;
  stroke: var(--neon-cyan);
  stroke-width: 1.5;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: traceDraw 8s ease-in-out infinite;
}
.trace-1 { animation-delay: 0s; }
.trace-2 { animation-delay: 1.2s; }
.trace-3 { animation-delay: 2.4s; }
.trace-4 { animation-delay: 3.6s; }
.trace-5 { animation-delay: 4.8s; }
.trace-6 { animation-delay: 6s; }

@keyframes traceDraw {
  0%   { stroke-dashoffset: 1200; opacity: 0.3; }
  50%  { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -1200; opacity: 0.3; }
}

.node {
  fill: var(--neon-cyan);
  animation: nodePulse 3s ease-in-out infinite;
}

@keyframes nodePulse {
  0%, 100% { opacity: 0.3; r: 3; }
  50% { opacity: 1; r: 5; }
}

.component {
  fill: none;
  stroke: var(--neon-green);
  stroke-width: 1;
  animation: nodePulse 4s ease-in-out infinite;
}

/* Particles */
.particles {
  position: absolute;
  inset: 0;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--neon-cyan);
  border-radius: 50%;
  animation: particleFloat linear infinite;
  opacity: 0;
}

@keyframes particleFloat {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.8; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ═══════ NAVBAR ═══════ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Orbitron', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

.brand-icon {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}
.nav-links a:hover {
  color: var(--neon-cyan);
}

.nav-cta {
  background: rgba(0, 240, 255, 0.1) !important;
  color: var(--neon-cyan) !important;
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  transition: var(--transition);
}
.nav-cta:hover {
  background: rgba(0, 240, 255, 0.2) !important;
  box-shadow: var(--shadow-neon);
}

/* ═══════ HERO SECTION ═══════ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  padding: 100px 40px 60px;
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 600px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--neon-cyan);
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.hero-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
}

.title-line {
  display: block;
  color: var(--text-primary);
}

.title-highlight {
  display: block;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.4));
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--neon-cyan);
  margin-bottom: 16px;
  font-weight: 500;
}

.hero-description {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  color: #0a0a0f;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
}

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

/* Chip Animation (Hero Visual) */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-animation {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip {
  position: relative;
  width: 120px;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.chip-body {
  width: 80px;
  height: 100px;
  background: linear-gradient(145deg, #1a1a2e, #16213e);
  border: 2px solid var(--neon-cyan);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 20px rgba(0, 240, 255, 0.2),
    inset 0 0 20px rgba(0, 240, 255, 0.05);
}

.chip-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  color: var(--neon-cyan);
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
}

.chip-pins {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chip-pins-left {
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  padding-right: 2px;
}
.chip-pins-right {
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  padding-left: 2px;
}

.pin {
  width: 16px;
  height: 3px;
  background: linear-gradient(90deg, var(--neon-cyan), transparent);
  border-radius: 1px;
  animation: pinGlow 2s ease-in-out infinite;
}

.chip-pins-right .pin {
  background: linear-gradient(270deg, var(--neon-cyan), transparent);
}

.pin:nth-child(odd) { animation-delay: 0.3s; }
.pin:nth-child(even) { animation-delay: 0.6s; }

@keyframes pinGlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; box-shadow: 0 0 8px rgba(0, 240, 255, 0.5); }
}

.pulse-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--neon-cyan);
  animation: pulseExpand 3s ease-out infinite;
}
.ring-1 { width: 180px; height: 180px; animation-delay: 0s; }
.ring-2 { width: 230px; height: 230px; animation-delay: 1s; }
.ring-3 { width: 280px; height: 280px; animation-delay: 2s; }

@keyframes pulseExpand {
  0%   { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* ═══════ FEATURES SECTION ═══════ */
.features {
  padding: 100px 40px;
  position: relative;
  z-index: 1;
}

.section-title {
  text-align: center;
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 60px;
  color: var(--text-primary);
}

.highlight {
  color: var(--neon-cyan);
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  backdrop-filter: blur(10px);
  transition: var(--transition);
  cursor: default;
}
.feature-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-neon);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--neon-cyan);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ═══════ STATS SECTION ═══════ */
.stats {
  padding: 80px 40px;
  position: relative;
  z-index: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.stat-card {
  text-align: center;
  padding: 36px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}
.stat-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-neon);
}

.stat-number {
  font-family: 'Orbitron', monospace;
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

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

/* ═══════ CHAT SECTION ═══════ */
.chat-section {
  min-height: 100vh;
  padding: 80px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.chat-container {
  width: 100%;
  max-width: 800px;
  height: 85vh;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 240, 255, 0.06);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 10, 20, 0.5);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.chat-header h3 {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  color: var(--text-primary);
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--neon-green);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--neon-green);
  border-radius: 50%;
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.btn-clear {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
}
.btn-clear:hover {
  border-color: rgba(255, 80, 80, 0.4);
  color: #ff5050;
  background: rgba(255, 80, 80, 0.1);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: messageSlide 0.3s ease-out;
}

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

.bot-message {
  align-self: flex-start;
}

.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.user-message .message-avatar {
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
}

.message-content {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.user-message .message-content {
  background: rgba(0, 240, 255, 0.06);
  border-color: rgba(0, 240, 255, 0.15);
}

.message-content p {
  margin-bottom: 8px;
}
.message-content p:last-child {
  margin-bottom: 0;
}

.message-content ul,
.message-content ol {
  margin: 8px 0;
  padding-left: 20px;
}

.message-content li {
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.message-content strong {
  color: var(--neon-cyan);
}

.message-content code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 240, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--neon-green);
}

.message-content pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
  margin: 10px 0;
}

.message-content pre code {
  background: none;
  padding: 0;
  font-size: 0.83rem;
  color: var(--text-primary);
}

.message-content h1, .message-content h2, .message-content h3,
.message-content h4, .message-content h5, .message-content h6 {
  color: var(--neon-cyan);
  font-family: 'Orbitron', monospace;
  margin: 16px 0 8px;
}
.message-content h1 { font-size: 1.3rem; }
.message-content h2 { font-size: 1.15rem; }
.message-content h3 { font-size: 1.05rem; }

.message-content blockquote {
  border-left: 3px solid var(--neon-cyan);
  padding-left: 14px;
  margin: 10px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.85rem;
}
.message-content th,
.message-content td {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  text-align: left;
}
.message-content th {
  background: rgba(0, 240, 255, 0.08);
  color: var(--neon-cyan);
  font-weight: 600;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 12px;
  align-self: flex-start;
  max-width: 85%;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 20px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--neon-cyan);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  border-top: 1px solid var(--border-color);
}

.quick-actions::-webkit-scrollbar {
  height: 0;
}

.quick-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 20px;
  color: var(--neon-cyan);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}
.quick-btn:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

/* Chat Input */
.chat-input-container {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(10, 10, 20, 0.5);
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 6px 6px 6px 16px;
  transition: var(--transition);
}
.chat-input-wrapper:focus-within {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-neon);
}

#chatInput {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  resize: none;
  outline: none;
  padding: 8px 0;
  max-height: 120px;
  line-height: 1.5;
}
#chatInput::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  border: none;
  border-radius: 10px;
  color: #0a0a0f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.send-btn:hover {
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
  transform: scale(1.05);
}
.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.chat-footer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 768px) {
  .navbar {
    padding: 12px 20px;
  }

  .nav-links a:not(.nav-cta) {
    display: none;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    padding: 100px 20px 60px;
    gap: 40px;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
  }

  .chip-animation {
    width: 200px;
    height: 200px;
  }

  .chip-body {
    width: 60px;
    height: 80px;
  }

  .ring-1 { width: 130px; height: 130px; }
  .ring-2 { width: 165px; height: 165px; }
  .ring-3 { width: 200px; height: 200px; }

  .features {
    padding: 60px 20px;
  }

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

  .stats {
    padding: 40px 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chat-section {
    padding: 70px 8px 8px;
  }

  .chat-container {
    height: 90vh;
    border-radius: 16px;
  }

  .message {
    max-width: 92%;
  }

  .quick-actions {
    padding: 10px 14px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.9rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-number {
    font-size: 2rem;
  }
}
