/* === RESET & ROOT === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Dynamic Theme Tokens */
  --p-accent: var(--accent-cyan);
  --p-glow: rgba(34, 211, 238, 0.8);
  --p-orb-color: #00e5ff;

  /* Colors */
  --bg-main: #020617;
  --bg-panel: rgba(15, 23, 42, 0.94);
  --accent-cyan: #22d3ee;
  --accent-blue: #3b82f6;
  --accent-magenta: #ec4899;
  --accent-amber: #f59e0b;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --text-bright: #f0f9ff;
  --text-soft: #e5f6ff;
  --text-muted: #64748b;

  /* Effects */
  --radius-lg: 18px;
  --glow-main: 0 0 24px var(--p-glow);
  --glass-border: 1px solid rgba(148, 163, 184, 0.2);
  --blur: blur(25px);
}

/* Personality Themes */
body[data-personality="secure"] {
  --p-accent: var(--accent-red);
  --p-glow: rgba(239, 68, 68, 0.8);
  --p-orb-color: #ff3333;
}

body[data-personality="analyze"] {
  --p-accent: var(--accent-magenta);
  --p-glow: rgba(236, 72, 153, 0.8);
  --p-orb-color: #ff40ac;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background: #000;
  color: var(--text-soft);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === APP CONTAINER === */
.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

/* === BACKGROUND LAYERS === */
.bg-gradient {
  position: absolute;
  inset: -25%;
  background: radial-gradient(circle at 20% 30%, rgba(15, 23, 42, 0.9) 0%, rgba(2, 6, 23, 1) 50%),
    radial-gradient(circle at 80% 70%, rgba(30, 58, 138, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 60%);
  opacity: 0.95;
  z-index: 0;
  animation: bgPulse 15s ease-in-out infinite alternate;
}

.grid-bg {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.15) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 25s linear infinite;
  z-index: 0;
}

.starfield {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 25%, rgba(248, 250, 252, 0.4) 1px, transparent 0),
    radial-gradient(circle at 85% 35%, rgba(96, 165, 250, 0.45) 1px, transparent 0),
    radial-gradient(circle at 45% 75%, rgba(236, 72, 153, 0.35) 1px, transparent 0),
    radial-gradient(circle at 70% 60%, rgba(34, 211, 238, 0.4) 1px, transparent 0);
  background-size: 220px 220px, 280px 280px, 240px 240px, 260px 260px;
  opacity: 0.85;
  filter: blur(0.5px);
  animation: starfieldDrift 60s linear infinite, starfieldTwinkle 4s ease-in-out infinite;
  z-index: 0;
}

.scan-line {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
      transparent 0%,
      rgba(34, 211, 238, 0.12) 50%,
      transparent 100%);
  height: 200px;
  animation: scanVertical 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
  filter: blur(2px);
}

/* === CORNER BRACKETS === */
.corner {
  position: absolute;
  width: 100px;
  height: 100px;
  border-color: var(--accent-cyan);
  opacity: 0.3;
  z-index: 2;
  filter: drop-shadow(0 0 10px var(--accent-cyan));
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.corner:hover {
  opacity: 0.8;
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 0 20px var(--accent-primary));
}

.corner-tl {
  top: 20px;
  left: 20px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.corner-tr {
  top: 20px;
  right: 20px;
  border-top: 2px solid;
  border-right: 2px solid;
}

.corner-bl {
  bottom: 20px;
  left: 20px;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.corner-br {
  bottom: 20px;
  right: 20px;
  border-bottom: 2px solid;
  border-right: 2px solid;
}

/* === TOP HUD BAR === */
.top-bar {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 32px;
  align-items: center;
  z-index: 100;
  padding: 12px 32px;
  border-radius: 999px;
  background: linear-gradient(135deg,
      rgba(15, 23, 42, 0.85),
      rgba(2, 6, 23, 0.75));
  border: 1px solid var(--p-accent);
  backdrop-filter: blur(25px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 40px var(--p-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: barSlideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transition: border-color 1s ease, box-shadow 1s ease;
}

.top-item.voice-indicator {
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.voice-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-switch-icon {
  font-size: 20px;
  filter: drop-shadow(0 0 8px var(--accent-cyan));
  transform: scale(1);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.top-item.voice-indicator.voice-active #voiceStatusText {
  animation: pulseCyanText 2s infinite;
  color: var(--accent-cyan) !important;
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}

@keyframes pulseCyanText {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

.top-item.voice-indicator:hover .voice-switch-icon {
  transform: scale(1.2) rotate(10deg);
}

.top-item.voice-indicator::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent-cyan);
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.top-item.voice-indicator:hover::after {
  opacity: 0.5;
  transform: scale(1);
}

.top-item.voice-indicator.voice-active {
  background: rgba(34, 211, 238, 0.2);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.4);
}

.top-item.voice-indicator.voice-active .voice-switch-icon {
  animation: pulseRotate 2s infinite ease-in-out;
}

@keyframes pulseRotate {

  0%,
  100% {
    transform: scale(1) rotate(0);
  }

  50% {
    transform: scale(1.2) rotate(10deg);
  }
}

.top-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--text-soft);
}

.top-item.brand {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--p-accent);
  box-shadow:
    0 0 18px var(--p-glow),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  animation: pulseGlow 1.5s ease-in-out infinite;
  transition: background 1s ease, box-shadow 1s ease;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-title {
  position: relative;
  font-size: 14px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-bright);
  text-shadow:
    0 0 16px rgba(34, 211, 238, 0.8),
    0 2px 4px rgba(0, 0, 0, 0.5);
}

.hud-sub {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.top-item.status-display,
.top-item.clock {
  min-width: 120px;
}

.top-item .label {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.top-item .value {
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
  transition: all 0.3s ease;
}

/* === CENTRAL ORB === */
.orb-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.orb-container.listening {
  transform: translate(-50%, -50%) scale(1.15);
}

.orb-container.speaking {
  animation: orbBreathing 1s ease-in-out infinite;
}

.orb {
  position: relative;
  width: 320px;
  height: 320px;
}

.orb-core {
  position: absolute;
  inset: 32%;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%,
      #ffffff,
      var(--p-accent) 40%,
      var(--p-orb-color) 70%);
  box-shadow:
    0 0 50px var(--p-accent),
    0 0 100px var(--p-glow),
    inset 0 -8px 16px rgba(0, 0, 0, 0.3),
    inset 0 4px 8px rgba(255, 255, 255, 0.4);
  animation: orbPulse 2s ease-in-out infinite;
  transition: all 1s ease;
}

.orb-glow {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: radial-gradient(circle,
      var(--p-accent) 0%,
      var(--p-glow) 40%,
      transparent 70%);
  opacity: 0.6;
  filter: blur(50px);
  animation: glowPulse 2.5s ease-in-out infinite;
}

.orb-ring {
  position: absolute;
  border-radius: 999px;
  border: 2px solid;
  box-shadow: 0 0 20px currentColor;
}

.ring-outer {
  inset: 0;
  border-color: var(--p-accent);
  transition: border-color 1s ease;
  background: conic-gradient(from 0deg,
      rgba(34, 211, 238, 0.3),
      rgba(236, 72, 153, 0.3),
      rgba(59, 130, 246, 0.3),
      rgba(34, 211, 238, 0.3));
  -webkit-mask: radial-gradient(transparent 98%, black 98%);
  mask: radial-gradient(transparent 98%, black 98%);
  animation: spinSlow 20s linear infinite;
}

.ring-middle {
  inset: 28px;
  border-style: dashed;
  border-color: rgba(59, 130, 246, 0.7);
  animation: spinReverse 28s linear infinite;
}

.ring-inner {
  inset: 56px;
  border-color: rgba(248, 250, 252, 0.6);
  opacity: 0.7;
  animation: spinSlow 35s linear infinite;
}

/* === ORB LABELS === */
.orb-label {
  position: absolute;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.8);
  font-weight: 600;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.5);
}

.orb-label-top {
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
}

.orb-label-bottom {
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
}

.orb-label-left {
  left: -32px;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
}

.orb-label-right {
  right: -32px;
  top: 50%;
  transform: translate(50%, -50%) rotate(90deg);
  transform-origin: center;
}

/* === VOICE BARS === */
.voice-bars {
  position: absolute;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 60px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.orb-container.listening .voice-bars {
  opacity: 1;
}

.voice-bar {
  width: 5px;
  background: linear-gradient(to top, var(--p-accent), var(--accent-blue));
  border-radius: 999px;
  box-shadow: 0 0 12px var(--p-accent);
  transition: height 0.1s ease, opacity 0.1s ease;
}

/* === SIDE PANELS === */
.side-panel {
  position: absolute;
  top: 52%;
  transform: translateY(-50%);
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 3;
}

.side-left {
  left: 36px;
}

.side-right {
  right: 36px;
}

.chip {
  background: linear-gradient(135deg,
      rgba(15, 23, 42, 0.95),
      rgba(2, 6, 23, 0.92));
  border-radius: 18px;
  border: var(--glass-border);
  padding: 12px 14px;
  backdrop-filter: var(--blur);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(15, 23, 42, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chip:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.5),
    0 0 40px var(--p-glow);
}

.chip-title {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--p-accent);
  margin-bottom: 6px;
  font-weight: 700;
  text-shadow: 0 0 10px var(--p-glow);
}

.chip-body {
  font-size: 12px;
}

.chip-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.chip-value {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
}

.chip-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid;
  margin-right: 6px;
  margin-top: 4px;
  box-shadow: 0 0 12px currentColor;
}

.chip-pill-green {
  border-color: rgba(34, 197, 94, 0.8);
  color: rgba(34, 197, 94, 1);
  background: rgba(34, 197, 94, 0.1);
}

.chip-pill-cyan {
  border-color: rgba(34, 211, 238, 0.8);
  color: rgba(34, 211, 238, 1);
  background: rgba(34, 211, 238, 0.1);
}

.chip-pill-amber {
  border-color: rgba(245, 158, 11, 0.8);
  color: rgba(245, 158, 11, 1);
  background: rgba(245, 158, 11, 0.1);
}

.chip-pill-magenta {
  border-color: rgba(236, 72, 153, 0.85);
  color: rgba(236, 72, 153, 1);
  background: rgba(236, 72, 153, 0.1);
}

/* === CHAT PANEL === */
.chat-panel {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  width: 86%;
  max-width: 880px;
  z-index: 4;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  padding: 0 4px;
}

.chat-title {
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.chat-subtitle {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.7);
  font-weight: 500;
}

.chat-body {
  max-height: 300px;
  overflow-y: auto;
  padding: 16px 20px;
  background: linear-gradient(135deg,
      rgba(15, 23, 42, 0.96),
      rgba(2, 6, 23, 0.94));
  border-radius: var(--radius-lg);
  border: 1px solid var(--p-accent);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.5),
    0 0 50px rgba(15, 23, 42, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: var(--blur);
}

.chat-body::-webkit-scrollbar {
  width: 6px;
}

.chat-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 999px;
}

.chat-body::-webkit-scrollbar-thumb {
  background: var(--p-accent);
  opacity: 0.5;
  border-radius: 999px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
  background: var(--p-accent);
  filter: brightness(1.2);
}

/* === THOUGHT PROCESSOR === */
.thought-processor {
  margin: 10px 20px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed var(--p-accent);
  border-radius: 8px;
  font-family: 'Consolas', 'Monaco', monospace;
  transition: all 0.5s ease;
  overflow: hidden;
  max-height: 120px;
}

.thought-header {
  font-size: 8px;
  letter-spacing: 0.25em;
  color: var(--p-accent);
  margin-bottom: 8px;
  font-weight: 800;
  text-transform: uppercase;
  animation: pulseOpacity 2s infinite;
}

.thought-content {
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.4;
  opacity: 0.8;
  white-space: pre-wrap;
}

@keyframes pulseOpacity {

  0%,
  100% {
    opacity: 0.8;
  }

  50% {
    opacity: 0.3;
  }
}

.btn-jump {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(34, 211, 238, 0.9);
  color: #000;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.4);
  animation: jumpIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  transition: all 0.2s ease;
}

.btn-jump:hover {
  background: #fff;
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.5);
}

@keyframes jumpIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* === MESSAGES === */
.message {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-left: 3px solid;
  border-radius: 8px;
  animation: fadeInUp 0.3s ease-out;
  background: rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.message:hover {
  transform: translateX(4px);
  box-shadow: -4px 0 16px rgba(34, 211, 238, 0.2);
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  margin-bottom: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.meta-icon {
  font-size: 14px;
  opacity: 0.9;
}

.meta-time {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  opacity: 0.5;
  font-weight: normal;
}

.btn-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  font-size: 12px;
}

.message:hover .btn-copy {
  opacity: 1;
}

.btn-copy:hover {
  background: rgba(34, 211, 238, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.message {
  position: relative;
  margin-bottom: 12px;
  padding: 14px 18px;
  border-left: 3px solid;
  border-radius: 12px;
  animation: fadeInUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.message:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(34, 211, 238, 0.1);
  box-shadow: -4px 0 24px rgba(34, 211, 238, 0.1);
}

.message-text {
  font-size: 14px;
  line-height: 1.6;
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Monaco, monospace;
  color: var(--text-soft);
}

.message-user {
  border-left-color: var(--accent-green);
  background: rgba(34, 197, 94, 0.05);
}

.message-user .message-meta {
  color: rgba(34, 197, 94, 1);
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.message-assistant {
  border-left-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.05);
}

.message-assistant .message-meta {
  color: rgba(34, 211, 238, 1);
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}

/* === TYPING INDICATOR === */
.typing {
  display: flex;
  gap: 7px;
  padding: 10px 14px;
  border-left: 3px solid var(--accent-cyan);
  background: rgba(34, 211, 238, 0.08);
  border-radius: 8px;
  margin-top: 8px;
  align-items: center;
}

.dot-typing {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan);
  animation: bounce 0.7s ease-in-out infinite alternate;
}

.dot-typing:nth-child(2) {
  animation-delay: 0.15s;
}

.dot-typing:nth-child(3) {
  animation-delay: 0.3s;
}

/* === CONTROLS DOCK === */
.controls-dock {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 24px;
  z-index: 5;
}

.btn-circle {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: linear-gradient(135deg,
      rgba(30, 41, 59, 0.9),
      rgba(15, 23, 42, 0.9));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  cursor: pointer;
  backdrop-filter: blur(16px);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(15, 23, 42, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-circle:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: var(--glow-strong);
  border-color: var(--accent-cyan);
}

.btn-circle.active {
  box-shadow:
    0 0 30px rgba(34, 211, 238, 1),
    0 0 60px rgba(59, 130, 246, 0.8);
  border-color: var(--accent-cyan);
  background: linear-gradient(135deg,
      rgba(34, 211, 238, 0.2),
      rgba(59, 130, 246, 0.2));
}

.btn-circle:active {
  transform: translateY(-2px) scale(0.95);
  transition: all 0.1s ease;
}

.btn-circle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.5));
}

.btn-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  margin-top: 5px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

/* === UTILITIES === */
.hidden {
  display: none !important;
}

/* === OVERLAYS === */
.overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center,
      rgba(8, 47, 73, 0.7),
      rgba(2, 6, 23, 0.95));
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  animation: fadeIn 0.3s ease-out;
}

.overlay-card {
  width: 90%;
  max-width: 560px;
  background: linear-gradient(135deg,
      rgba(15, 23, 42, 0.98),
      rgba(2, 6, 23, 0.96));
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 24px 28px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(15, 23, 42, 1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(30px);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.overlay-header {
  margin-bottom: 14px;
}

.overlay-title {
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  font-weight: 700;
  text-shadow: 0 0 16px rgba(34, 211, 238, 0.6);
}

.overlay-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.overlay-card input {
  width: 100%;
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 14px 16px;
  color: var(--text-soft);
  font-size: 15px;
  outline: none;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

.overlay-card input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.3), inset 0 0 8px rgba(34, 211, 238, 0.1);
  background: rgba(0, 0, 0, 0.85);
}

.overlay-card input::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.overlay-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: linear-gradient(135deg,
      rgba(34, 211, 238, 0.2),
      rgba(59, 130, 246, 0.2));
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-cyan);
  background: linear-gradient(135deg,
      rgba(34, 211, 238, 0.3),
      rgba(59, 130, 246, 0.3));
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(148, 163, 184, 0.5);
  color: var(--text-muted);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  color: var(--text-soft);
}

.btn-success {
  background: var(--accent-green) !important;
  color: #fff !important;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.6) !important;
}

/* === SETTINGS PANEL === */
.settings-panel {
  position: absolute;
  top: 100px;
  right: 40px;
  width: 340px;
  background: linear-gradient(135deg,
      rgba(15, 23, 42, 0.98),
      rgba(2, 6, 23, 0.96));
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 20px 22px;
  backdrop-filter: blur(24px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(15, 23, 42, 1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  z-index: 12;
  animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-header {
  margin-bottom: 12px;
}

.settings-title {
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  font-weight: 700;
  text-shadow: 0 0 16px rgba(34, 211, 238, 0.6);
}

.settings-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.settings-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  font-weight: 600;
}

.settings-field input[type="text"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 10px 14px;
  color: var(--text-soft);
  font-size: 13px;
  outline: none;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

.settings-field input[type="text"]:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}

.settings-field input[type="range"] {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 999px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.settings-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-cyan);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.8);
  transition: all 0.2s ease;
}

.settings-field input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 24px rgba(34, 211, 238, 1);
}

.settings-field input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent-cyan);
  border-radius: 999px;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.8);
}

.settings-value {
  font-size: 11px;
  color: var(--accent-cyan);
  text-align: right;
  font-weight: 600;
  margin-top: 2px;
}

.settings-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 10px 14px;
  color: var(--text-soft);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

.settings-select:hover {
  border-color: rgba(148, 163, 184, 0.7);
}

.settings-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}

.settings-select option {
  background: #0f172a;
  color: var(--text-soft);
  padding: 8px;
}

.settings-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.settings-footnote {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.settings-footnote code {
  padding: 2px 6px;
  background: rgba(34, 211, 238, 0.1);
  border-radius: 4px;
  color: var(--accent-cyan);
  font-size: 10px;
}

/* === TOAST NOTIFICATION === */
.toast {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg,
      rgba(15, 23, 42, 0.98),
      rgba(2, 6, 23, 0.96));
  border-radius: 16px;
  border: 1px solid rgba(34, 211, 238, 0.6);
  padding: 14px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  backdrop-filter: blur(20px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(34, 211, 238, 0.4);
  z-index: 30;
  animation: slideDown 0.3s ease-out;
  min-width: 300px;
  max-width: 500px;
}

.toast-icon {
  font-size: 20px;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.6));
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  font-weight: 700;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.4;
}

/* === UTILITY === */
/* === SIDEBAR (HISTORY) === */
.sidebar {
  position: absolute;
  top: 0;
  left: -320px;
  width: 320px;
  height: 100%;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.95));
  border-right: 1px solid rgba(34, 211, 238, 0.3);
  backdrop-filter: var(--blur);
  z-index: 20;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 80px 20px 20px;
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
}

.sidebar.active {
  transform: translateX(320px);
}

.sidebar-header {
  margin-bottom: 24px;
}

.btn-new-chat {
  width: 100%;
  padding: 12px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px dashed var(--accent-cyan);
  border-radius: 12px;
  color: var(--accent-cyan);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-new-chat:hover {
  background: rgba(34, 211, 238, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
}

.session-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
}

.session-item:hover {
  background: rgba(34, 211, 238, 0.08);
  color: var(--text-soft);
  border-color: rgba(34, 211, 238, 0.2);
}

.session-item.active {
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.2);
}

.session-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-session-delete {
  background: none;
  border: none;
  font-size: 14px;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  padding: 2px 6px;
}

.session-item:hover .btn-session-delete {
  opacity: 0.6;
}

.btn-session-delete:hover {
  opacity: 1 !important;
  transform: scale(1.2);
}


.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-magenta);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.username {
  font-size: 13px;
  font-weight: 600;
}

.user-status {
  font-size: 9px;
  color: var(--accent-green);
  letter-spacing: 0.1em;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s ease;
}

.btn-logout:hover {
  color: var(--accent-magenta);
}

/* === AUTH OVERLAY === */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(25px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.auth-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-card {
  width: 400px;
  padding: 40px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.9));
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 24px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(34, 211, 238, 0.2);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-header {
  text-align: center;
}

.auth-title {
  font-size: 24px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-bright);
  text-shadow: 0 0 20px var(--accent-cyan);
}

.auth-subtitle {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 8px;
}

.auth-tabs {
  display: flex;
  gap: 20px;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.auth-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: all 0.3s ease;
  padding-bottom: 8px;
  position: relative;
}

.auth-tab.active {
  color: var(--accent-cyan);
}

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.auth-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-bright);
  font-family: inherit;
  transition: all 0.3s ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.05);
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.2);
}

.btn-auth-submit {
  margin-top: 12px;
  padding: 14px;
  background: var(--accent-cyan);
  color: #000;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-auth-submit:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
}

.auth-footer-link {
  text-align: center;
  margin-top: 12px;
}

.btn-link-help {
  background: none;
  border: none;
  color: var(--p-accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.btn-link-help:hover {
  opacity: 1;
  text-shadow: 0 0 10px var(--p-accent);
}

.auth-help-section {
  margin-top: 15px;
  padding: 12px;
  background: rgba(255, 63, 94, 0.1);
  border: 1px solid rgba(255, 63, 94, 0.3);
  border-radius: 8px;
  animation: fadeIn 0.3s ease;
}

.auth-help-section span {
  display: block;
  font-size: 11px;
  color: #f43f5e;
  margin-bottom: 6px;
}

.auth-help-section p {
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-muted);
  margin: 0;
}

.auth-config-toggle {
  text-align: center;
  margin-top: 8px;
}

.btn-link-config {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 8px;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.btn-link-config:hover {
  color: var(--accent-cyan);
  opacity: 1;
  text-shadow: 0 0 8px var(--accent-cyan);
}

.auth-config-fields {
  margin-top: 16px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed rgba(34, 211, 238, 0.3);
  border-radius: 12px;
  animation: fadeIn 0.3s ease;
}

.btn-auth-save-url {
  margin-top: 12px;
  padding: 8px;
  width: 100%;
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-auth-save-url:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 15px var(--accent-cyan);
}

.auth-header {
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
  z-index: 10;
}

@media (max-width: 768px) {
  .auth-header {
    padding-top: 40px;
    /* Space for the sidebar toggle */
  }
}

.auth-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.auth-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.3rem;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
}

@media (max-width: 480px) {
  .auth-title {
    font-size: 1.5rem;
    letter-spacing: 0.2rem;
  }

  .auth-card {
    width: 90%;
    padding: 24px;
  }
}

.auth-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f43f5e;
  box-shadow: 0 0 10px #f43f5e;
  animation: pulse-red 2s infinite;
}

.status-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.1rem;
}

.auth-status.online .status-dot {
  background: #22d3ee;
  box-shadow: 0 0 10px #22d3ee;
  animation: pulse-cyan 2s infinite;
}

.auth-status.online .status-label {
  color: #22d3ee;
}

@keyframes pulse-red {
  0% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.4;
  }
}

@keyframes pulse-cyan {
  0% {
    box-shadow: 0 0 5px #22d3ee;
  }

  50% {
    box-shadow: 0 0 15px #22d3ee;
  }

  100% {
    box-shadow: 0 0 5px #22d3ee;
  }
}

/* === SIDEBAR TOGGLE === */
.sidebar-toggle {
  position: absolute;
  top: 30px;
  left: 30px;
  z-index: 30;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: var(--accent-cyan);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 20px var(--accent-cyan);
}

.hidden {
  display: none !important;
}

/* === ANIMATIONS === */
/* === ANIMATIONS === */
@keyframes gridMove {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(50px, 50px);
  }
}

@keyframes starfieldDrift {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(-100px, -100px);
  }
}

@keyframes starfieldTwinkle {

  0%,
  100% {
    opacity: 0.85;
  }

  50% {
    opacity: 0.95;
  }
}

@keyframes scanVertical {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

@keyframes bgPulse {

  0%,
  100% {
    opacity: 0.95;
  }

  50% {
    opacity: 1;
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.9), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.15);
    box-shadow: 0 0 28px rgba(34, 211, 238, 1), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  }
}

@keyframes orbPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes orbBreathing {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes glowPulse {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

@keyframes spinSlow {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes spinReverse {
  0% {
    transform: rotate(360deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

@keyframes waveMotion {

  0%,
  100% {
    height: 12px;
    opacity: 0.6;
  }

  50% {
    height: 52px;
    opacity: 1;
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-6px);
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  0% {
    opacity: 0;
    transform: translate(-50%, -20px);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(30px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}



/* === UNIFIED RESPONSIVE INTERFACE === */
@media (max-width: 768px) {

  /* Layout Base */
  .app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }

  /* Sidebar Control */
  .btn-toggle-sidebar {
    position: fixed !important;
    top: 10px;
    left: 10px;
    z-index: 2000;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 8px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .top-bar {
    margin-top: 60px !important;
    /* Push down to clear fixed sidebar bouton */
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    z-index: 1500;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 280px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 243, 255, 0.1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .sidebar.active {
    left: 0;
  }

  .sidebar-overlay {
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.3);
    z-index: 1400;
  }

  /* Interaction Controls */
  .controls-dock {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 243, 255, 0.2);
    padding: 10px 15px;
    border-radius: 30px;
    width: 90%;
    max-width: 400px;
    justify-content: space-between;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  }

  .btn-circle {
    width: 52px;
    height: 52px;
    padding: 6px;
  }

  .btn-icon {
    font-size: 16px;
  }

  .btn-label {
    font-size: 7px;
  }

  /* Auth Interface */
  .auth-header {
    padding-top: 50px;
    margin-bottom: 1rem;
  }

  .auth-title {
    font-size: 1.6rem;
    letter-spacing: 0.2rem;
  }

  .auth-card {
    width: 92%;
    padding: 24px 16px;
    margin-top: 20px;
  }

  /* Settings Surface */
  .settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: auto;
    max-height: 85vh;
    z-index: 2500;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(25px);
    border: 1px solid var(--accent-cyan);
    border-radius: 20px;
    padding: 24px;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  }

  .settings-panel.hidden {
    display: none;
    pointer-events: none;
  }

  .settings-title {
    font-size: 16px;
  }

  .settings-subtitle {
    font-size: 10px;
    white-space: normal;
  }

  /* Chat & Messages */
  .chat-panel {
    width: 100% !important;
    margin-left: 0 !important;
    padding-top: 80px;
    padding-bottom: 110px;
  }

  .messages {
    padding: 10px;
  }

  .msg-bubble {
    max-width: 85%;
  }
}

@media (max-width: 480px) {
  .top-bar {
    transform: scale(0.9);
    margin-top: 5px;
  }

  .auth-title {
    font-size: 1.4rem;
  }

  .controls-dock {
    bottom: 15px;
    width: 94%;
    padding: 8px 10px;
  }

  .btn-circle {
    width: 48px;
    height: 48px;
  }
}