:root {
  --bg-primary: #0a0f1a;
  --bg-secondary: #0d1525;
  --accent-cyan: #00d4ff;
  --accent-cyan-dim: #00a8cc;
  --accent-blue: #1e90ff;
  --accent-glow: rgba(0, 212, 255, 0.3);
  --text-primary: #e0f0ff;
  --text-secondary: #8ba4c4;
  --text-muted: #5a7a9a;
  --glass-bg: rgba(13, 21, 37, 0.8);
  --glass-border: rgba(0, 212, 255, 0.2);
}

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

body {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  position: relative;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(30, 144, 255, 0.05) 0%, transparent 40%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* Particle Background */
.particle-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--accent-cyan);
  border-radius: 50%;
  opacity: 0.3;
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
  50% { transform: translateY(-20px) translateX(10px); opacity: 0.6; }
}

/* Scan Lines */
.scan-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 212, 255, 0.02) 2px,
    rgba(0, 212, 255, 0.02) 4px
  );
  z-index: 1;
}

/* HUD Corners */
.hud-corner {
  position: fixed;
  width: 80px;
  height: 80px;
  border: 2px solid var(--glass-border);
  pointer-events: none;
  z-index: 2;
}

.hud-corner.top-left {
  top: 20px;
  left: 20px;
  border-right: none;
  border-bottom: none;
}

.hud-corner.top-right {
  top: 20px;
  right: 20px;
  border-left: none;
  border-bottom: none;
}

.hud-corner.bottom-left {
  bottom: 20px;
  left: 20px;
  border-right: none;
  border-top: none;
}

.hud-corner.bottom-right {
  bottom: 20px;
  right: 20px;
  border-left: none;
  border-top: none;
}

/* Main Wrapper */
.main-wrapper {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  text-align: center;
  padding: 20px 0 30px;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

/* Arc Reactor */
.arc-reactor {
  position: relative;
  width: 80px;
  height: 80px;
}

.reactor-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
}

.ring-1 {
  inset: 0;
  animation: rotate 8s linear infinite;
}

.ring-2 {
  inset: 10px;
  border-style: dashed;
  animation: rotate 6s linear infinite reverse;
}

.ring-3 {
  inset: 20px;
  animation: rotate 4s linear infinite;
}

.reactor-core {
  position: absolute;
  inset: 28px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--accent-cyan), 0 0 40px var(--accent-glow);
}

.reactor-glow {
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
}

.arc-reactor.thinking .reactor-core {
  animation: pulse 0.5s ease-in-out infinite;
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.header-text {
  text-align: center;
}

.title {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent-cyan);
  text-shadow: 0 0 20px var(--accent-glow);
  letter-spacing: 4px;
}

.subtitle {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 8px;
  margin-top: 5px;
}

.tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 10px;
  max-width: 400px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #00ff88;
  border-radius: 50%;
  box-shadow: 0 0 10px #00ff88;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--text-secondary);
}

/* Mode Selector */
.mode-selector {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.mode-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.mode-button:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px var(--accent-glow);
}

.mode-button.active {
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
  color: var(--text-primary);
  box-shadow: 0 0 30px var(--accent-glow), inset 0 0 20px rgba(0, 212, 255, 0.1);
}

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

.mode-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.mode-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
}

.mode-tagline {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Chat Container */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

/* AI Avatar Section */
.ai-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--glass-border);
}

.avatar-ring {
  width: 100px;
  height: 100px;
  border: 2px solid var(--accent-cyan);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ring-glow 3s ease-in-out infinite;
  position: relative;
}

@keyframes ring-glow {
  0%, 100% { box-shadow: 0 0 10px var(--accent-glow); }
  50% { box-shadow: 0 0 30px var(--accent-glow); }
}

/* Visualizer */
.visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 40px;
}

.visualizer-bar {
  width: 4px;
  height: 10px;
  background: var(--accent-cyan);
  border-radius: 2px;
  transition: height 0.1s ease;
}

.visualizer.active .visualizer-bar {
  animation: visualize 0.5s ease-in-out infinite;
}

@keyframes visualize {
  0%, 100% { height: 10px; }
  50% { height: 30px; }
}

.avatar-status {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Messages */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  min-height: 300px;
  max-height: 400px;
}

.welcome-message {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
}

.welcome-message p {
  margin-bottom: 15px;
  line-height: 1.6;
}

.message {
  display: flex;
  margin-bottom: 15px;
  animation: messageIn 0.3s ease-out;
}

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

.message.user {
  justify-content: flex-end;
}

.message.assistant {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  position: relative;
}

.message.user .message-bubble {
  background: rgba(30, 144, 255, 0.2);
  border: 1px solid rgba(30, 144, 255, 0.3);
  border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid var(--accent-cyan);
  border-bottom-left-radius: 4px;
  box-shadow: 0 0 15px var(--accent-glow);
}

.message-content {
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message-time {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: 'Orbitron', sans-serif;
}

/* Typing Indicator */
.typing-bubble {
  padding: 15px 20px;
}

.typing-dots {
  display: flex;
  gap: 5px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  animation: typing 1s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* Input Container */
.input-container {
  padding: 15px;
  border-top: 1px solid var(--glass-border);
}

.input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  resize: none;
  transition: all 0.3s ease;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px var(--accent-glow);
}

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

.send-button {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.send-button:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--accent-glow);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.send-button svg {
  width: 20px;
  height: 20px;
  color: var(--bg-primary);
}

.input-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  justify-content: center;
}

.clear-button,
.toggle-panel-button {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-button:hover,
.toggle-panel-button:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Side Panel */
.side-panel {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 250px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px);
  z-index: 100;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-50%) translateX(20px); }
  to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

.panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  color: var(--accent-cyan);
  margin-bottom: 15px;
}

.daily-quote {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

.panel-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 20px 0;
}

.panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-action {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s ease;
}

.quick-action:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px;
  margin-top: 20px;
}

.footer-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.remix-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: 0.75rem;
  transition: all 0.3s ease;
}

.remix-link:hover {
  text-shadow: 0 0 10px var(--accent-glow);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .main-wrapper {
    padding: 10px;
  }

  .title {
    font-size: 1.8rem;
    letter-spacing: 2px;
  }

  .subtitle {
    font-size: 0.9rem;
    letter-spacing: 4px;
  }

  .tagline {
    font-size: 0.65rem;
  }

  .mode-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .mode-button {
    justify-content: flex-start;
  }

  .hud-corner {
    display: none;
  }

  .side-panel {
    position: fixed;
    right: 10px;
    left: 10px;
    top: auto;
    bottom: 80px;
    transform: none;
    width: auto;
  }

  .messages-container {
    min-height: 250px;
    max-height: 350px;
  }

  .arc-reactor {
    width: 60px;
    height: 60px;
  }

  .ring-3 { inset: 15px; }
  .reactor-core { inset: 20px; }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-cyan-dim);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}