/* Global Styles */
:root {
  --surface: rgba(2, 6, 23, 0.85);
  --surface-muted: rgba(15, 23, 42, 0.6);
  --border: rgba(148, 163, 184, 0.1);
  --glow: rgba(56, 189, 248, 0.15);
  --primary-glow: rgba(16, 185, 129, 0.4);
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  /* Reverted to previous blue-slate gradient */
  background: radial-gradient(circle at 50% 0%, #1e293b 0%, #020617 60%);
  background-attachment: fixed;
  /* Prevent scrolling artifacts */
  color: #f8fafc;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Enhanced Noise Texture - Reduced opacity for less pixelation */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.3;
  mix-blend-mode: overlay;
}

/* Glass Panel - Enhanced Glassmorphism */
.glass-panel {
  background: rgba(2, 6, 23, 0.7);
  /* Slightly more transparent */
  backdrop-filter: blur(25px);
  /* Increased blur */
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  /* More visible border */
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  /* Highlight top border */
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  /* Highlight left border */
  border-radius: 1.5rem;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  /* Inner glow */
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* Subtle reflection gradient for glass panels */
.glass-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* Ensure content is above the reflection */
.glass-panel>* {
  position: relative;
  z-index: 1;
}

.message-bubble {
  max-width: 75%;
  word-wrap: break-word;
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border-radius: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* New agent message slide-in animation */
@keyframes messageSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-20px) scale(0.95);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.message-animate-in {
  animation: messageSlideIn 0.3s ease-out forwards;
}

/* Agent message ripple - expanding blue circle */
@keyframes agentRipple {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.7;
    border-width: 3px;
  }

  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
    border-width: 1px;
  }
}

.agent-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid #38bdf8;
  pointer-events: none;
  z-index: 5;
  animation: agentRipple 0.6s ease-out forwards;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.message-bubble--user {
  margin-left: auto;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-left: none;
  text-align: left;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

.message-bubble--user * {
  text-align: left !important;
}

.priority-low {
  border-left: 3px solid #10b981;
}

.priority-normal {
  border-left: 3px solid #38bdf8;
}

.priority-high {
  border-left: 3px solid #f87171;
}

.urgent-indicator {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-pill--ok {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #86efac;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.1);
}

.status-pill--warn {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: #fcd34d;
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.1);
}

.status-pill--danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

.status-pill--neutral {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.agent-item {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.agent-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.agent-item--active {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
}

.insight-chip {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.9rem;
  padding: 1rem;
  font-size: 0.875rem;
  backdrop-filter: blur(10px);
}

.option-card {
  border-radius: 1rem;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(30, 41, 59, 0.4);
  color: #e2e8f0;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.option-card--interactive {
  cursor: pointer;
}

.option-card--interactive:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(30, 41, 59, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.option-card--interactive:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.8);
  background: rgba(30, 41, 59, 0.6);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.3), 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.option-card--selected {
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.15);
  background: rgba(56, 189, 248, 0.1);
}

.option-card--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.notification-item {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  backdrop-filter: blur(5px);
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .6;
  }
}

/* Council Chamber Styles */
.council-chamber {
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.05), transparent 70%), var(--surface);
}

#councilCircle {
  min-height: 0;
}

.council-orbit {
  position: relative;
  width: min(100%, 820px);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  isolation: isolate;
}

@media (max-width: 1024px) {
  .council-orbit {
    width: min(90vw, 640px);
  }
}

.council-center {
  z-index: 10;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }

  50% {
    transform: translate(-50%, -50%) translateY(-10px);
  }
}

.agent-seat {
  z-index: 5;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
}

.agent-seat:hover {
  z-index: 20;
  transform: translate(-50%, -50%) scale(1.25) !important;
}

.agent-seat--focused {
  z-index: 20;
  transform: translate(-50%, -50%) scale(1.25) !important;
}

.agent-seat--focused .agent-avatar>.rounded-full {
  border-radius: 9999px;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.6), 0 0 20px rgba(56, 189, 248, 0.4);
  animation: focusPulse 2s infinite;
}

.agent-seat--selected {
  z-index: 20;
  transform: translate(-50%, -50%) scale(1.25) !important;
}

.agent-seat--selected .agent-avatar>.rounded-full {
  border-radius: 9999px;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.6), 0 0 20px rgba(56, 189, 248, 0.4);
  animation: focusPulse 2s infinite;
}

@keyframes focusPulse {
  0% {
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.6), 0 0 20px rgba(56, 189, 248, 0.4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.3), 0 0 30px rgba(56, 189, 248, 0.6);
  }

  100% {
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.6), 0 0 20px rgba(56, 189, 248, 0.4);
  }
}

.agent-seat--focused::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  bottom: -35px;
}

.agent-seat .agent-avatar img {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6);
}

.agent-seat:hover .agent-avatar img {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.agent-seat--active:hover {
  filter: drop-shadow(0 0 25px rgba(16, 185, 129, 0.4));
}

.agent-seat--urgent .agent-avatar::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.6), transparent 70%);
  z-index: -1;
  animation: urgentPulse 2s ease-in-out infinite;
}

.agent-seat--attention .agent-avatar::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.5), transparent 70%);
  z-index: -1;
  animation: pulse 3s ease-in-out infinite;
}

.agent-seat--selected .agent-avatar::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.6), transparent 70%);
  z-index: -1;
  opacity: 1;
}

@keyframes urgentPulse {

  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.connection-line {
  opacity: 0;
  transition: opacity 0.4s ease;
  filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.5));
}

.agent-seat:hover .connection-line,
.agent-seat--selected .connection-line {
  opacity: 1;
}

/* Particle effects */
.council-chamber::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.02) 0%, transparent 60%);
  animation: particleFloat 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes particleFloat {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(1) rotate(0deg);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.1) rotate(5deg);
  }
}

/* Message Panel Enhancements */
#agentPanelHeader {
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(10px);
}

#conversationArea::-webkit-scrollbar {
  width: 6px;
}

#conversationArea::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.2);
  border-radius: 999px;
}

#conversationArea::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.4);
}

/* Fast directional fade animations for chat transitions (front/back) */
@keyframes fadeInFromFront {
  from {
    opacity: 0;
    transform: scale(1.05);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInFromBack {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.slide-in-right {
  animation: fadeInFromFront 0.15s ease-out;
}

.slide-in-left {
  animation: fadeInFromBack 0.15s ease-out;
}

.agent-avatar {
  position: relative;
  transition: transform 0.3s ease;
}

/* Agent seat layout - center sphere and text properly */
.agent-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.agent-seat .agent-avatar {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Agent name label styling */
.agent-seat .agent-name-label {
  text-align: center;
  width: max-content;
  max-width: 100px;
}



/* Orbital ring system */
.council-rings {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  z-index: 1;
  pointer-events: none;
}

.orbital-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.05);
  pointer-events: none;
  transition: all 0.5s ease;
}

.orbital-ring--urgent {
  width: 52%;
  height: 52%;
  border-color: rgba(239, 68, 68, 0.8);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.orbital-ring--attention {
  width: 72%;
  height: 72%;
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
}

.orbital-ring--idle {
  width: 92%;
  height: 92%;
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.orbital-label {
  position: absolute;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(148, 163, 184, 0.6);
  backdrop-filter: blur(4px);
  transform: translate(-50%, -50%);
}

.orbital-label--urgent {
  top: 31.6%;
  right: auto;
  left: 68.4%;
  color: rgba(252, 165, 165, 0.8);
  border-color: rgba(248, 113, 113, 0.2);
}

.orbital-label--attention {
  bottom: 24.5%;
  left: 24.5%;
  color: rgba(253, 224, 71, 0.8);
  border-color: rgba(251, 191, 36, 0.2);
}

.orbital-label--idle {
  top: 17.5%;
  left: 17.5%;
  color: rgba(134, 239, 172, 0.8);
  border-color: rgba(34, 197, 94, 0.15);
}

/* Landing Page Styles */
.landing-planet {
  animation: planetFloat 6s ease-in-out infinite;
}

@keyframes planetFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-15px) rotate(2deg);
  }
}

.landing-glow {
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

.landing-title {
  animation: titleShimmer 3s ease-in-out infinite;
}

@keyframes titleShimmer {

  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.3);
  }
}

/* Star background for landing page */
.landing-stars {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.landing-stars::before,
.landing-stars::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  box-shadow:
    100px 50px 0 rgba(255, 255, 255, 0.3),
    200px 150px 0 rgba(255, 255, 255, 0.2),
    300px 80px 0 rgba(255, 255, 255, 0.4),
    400px 200px 0 rgba(255, 255, 255, 0.3),
    500px 100px 0 rgba(255, 255, 255, 0.2),
    600px 250px 0 rgba(255, 255, 255, 0.3),
    700px 50px 0 rgba(255, 255, 255, 0.4),
    800px 180px 0 rgba(255, 255, 255, 0.2),
    150px 300px 0 rgba(255, 255, 255, 0.3),
    350px 350px 0 rgba(255, 255, 255, 0.4),
    550px 400px 0 rgba(255, 255, 255, 0.2),
    750px 380px 0 rgba(255, 255, 255, 0.3),
    900px 120px 0 rgba(255, 255, 255, 0.3),
    1000px 280px 0 rgba(255, 255, 255, 0.2),
    1100px 60px 0 rgba(255, 255, 255, 0.4),
    1200px 340px 0 rgba(255, 255, 255, 0.3),
    1300px 180px 0 rgba(255, 255, 255, 0.2),
    1400px 420px 0 rgba(255, 255, 255, 0.3),
    50px 450px 0 rgba(255, 255, 255, 0.4),
    250px 520px 0 rgba(255, 255, 255, 0.2),
    450px 580px 0 rgba(255, 255, 255, 0.3),
    650px 500px 0 rgba(255, 255, 255, 0.4),
    850px 550px 0 rgba(255, 255, 255, 0.2),
    1050px 480px 0 rgba(255, 255, 255, 0.3);
  animation: twinkle 4s ease-in-out infinite alternate;
}

.landing-stars::after {
  animation-delay: 2s;
  box-shadow:
    50px 100px 0 rgba(255, 255, 255, 0.2),
    180px 220px 0 rgba(255, 255, 255, 0.3),
    280px 180px 0 rgba(255, 255, 255, 0.4),
    420px 120px 0 rgba(255, 255, 255, 0.2),
    580px 280px 0 rgba(255, 255, 255, 0.3),
    650px 150px 0 rgba(255, 255, 255, 0.4),
    780px 320px 0 rgba(255, 255, 255, 0.2),
    850px 80px 0 rgba(255, 255, 255, 0.3),
    950px 220px 0 rgba(255, 255, 255, 0.2),
    1080px 160px 0 rgba(255, 255, 255, 0.3),
    1180px 300px 0 rgba(255, 255, 255, 0.4),
    1280px 100px 0 rgba(255, 255, 255, 0.2),
    120px 380px 0 rgba(255, 255, 255, 0.3),
    320px 440px 0 rgba(255, 255, 255, 0.4),
    520px 360px 0 rgba(255, 255, 255, 0.2),
    720px 420px 0 rgba(255, 255, 255, 0.3),
    920px 380px 0 rgba(255, 255, 255, 0.4),
    1120px 440px 0 rgba(255, 255, 255, 0.2);
}

@keyframes twinkle {
  0% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

/* Fixed Header transition */
header {
  transition: all 0.3s ease;
}

/* Landing page responsive improvements */
@media (max-width: 1024px) {
  .landing-hero-grid {
    grid-template-columns: 1fr;
  }
}

/* Feature cards hover effect */
.glass-panel.group:hover {
  border-color: rgba(16, 185, 129, 0.3);
}

/* Smooth section transitions */
section {
  scroll-margin-top: 80px;
}

/* Input focus states - improved accessibility */
input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Button focus states - improved accessibility */
button:focus-visible {
  outline: 2px solid rgba(16, 185, 129, 0.8);
  outline-offset: 2px;
}

/* Skip to content link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #10b981;
  color: white;
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Animation for floating badge */
@keyframes floatBadge {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

.glass-panel.absolute {
  animation: floatBadge 3s ease-in-out infinite;
}

/* Better text contrast for accessibility */
.text-slate-300 {
  color: #cbd5e1;
}

.text-slate-400 {
  color: #94a3b8;
}

.text-slate-500 {
  color: #64748b;
}

/* New Agent Entrance Animation */
@keyframes agentEntrance {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0) rotate(-180deg);
    filter: blur(10px);
  }

  50% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.3) rotate(10deg);
    filter: blur(2px);
  }

  70% {
    transform: translate(-50%, -50%) scale(0.9) rotate(-5deg);
    filter: blur(0);
  }

  85% {
    transform: translate(-50%, -50%) scale(1.1) rotate(2deg);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    filter: blur(0);
  }
}

@keyframes newAgentGlow {

  0%,
  100% {
    box-shadow:
      0 0 20px rgba(16, 185, 129, 0.6),
      0 0 40px rgba(16, 185, 129, 0.4),
      0 0 60px rgba(16, 185, 129, 0.2);
  }

  50% {
    box-shadow:
      0 0 30px rgba(56, 189, 248, 0.8),
      0 0 60px rgba(56, 189, 248, 0.5),
      0 0 90px rgba(56, 189, 248, 0.3);
  }
}

@keyframes newAgentRipple {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

@keyframes newAgentSparkle {

  0%,
  100% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }

  50% {
    opacity: 1;
    transform: scale(1) rotate(180deg);
  }
}

.agent-seat--new {
  animation: agentEntrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.agent-seat--new .agent-avatar>.rounded-full {
  animation: newAgentGlow 1s ease-in-out 1;
}

.agent-seat--new::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.6);
  animation: newAgentRipple 1s ease-out forwards;
  pointer-events: none;
}

.agent-seat--new::after {
  content: '✦';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  color: #10b981;
  animation: newAgentSparkle 0.6s ease-in-out 1;
  pointer-events: none;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}

/* ============================================
   Mobile Agent Dock - Horizontal Carousel
   Shows on screens < 1024px (lg breakpoint)
   ============================================ */

/* Hide orbital view on mobile, show dock */
@media (max-width: 1023px) {
  .council-chamber #councilCircle {
    display: none !important;
  }

  .council-chamber .mobile-agent-dock {
    display: block !important;
  }
}

/* Hide dock on desktop */
.mobile-agent-dock {
  display: none;
}

/* Dock Container */
.mobile-agent-dock {
  position: relative;
  width: 100%;
  padding: 0.25rem 0;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Navigation Arrows */
.dock-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.dock-nav-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #10b981;
}

.dock-nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.dock-nav-btn--left {
  left: 8px;
}

.dock-nav-btn--right {
  right: 8px;
}

.dock-nav-btn svg {
  width: 12px;
  height: 12px;
}

/* Carousel Track */
.dock-carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0 32px; /* Space for nav buttons */
  min-height: 56px;
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.dock-carousel:active {
  cursor: grabbing;
}

/* Individual Dock Agent */
.dock-agent {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.25rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.dock-agent:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Agent Avatar in Dock */
.dock-agent-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: #0f172a;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dock-agent-avatar .marble-container {
  width: 100%;
  height: 100%;
}

.dock-agent-avatar .marble-container svg {
  width: 100%;
  height: 100%;
}

/* Agent Initials Overlay */
.dock-agent-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

/* Agent Name in Dock */
.dock-agent-name {
  font-size: 7px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  max-width: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  transition: color 0.2s ease;
}

/* Status Indicator Badge */
.dock-agent-status {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 700;
  z-index: 10;
}

.dock-agent-status--urgent {
  background: #ef4444;
  color: white;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.dock-agent-status--attention {
  background: #fbbf24;
  color: #0f172a;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.dock-agent-status--idle {
  background: #10b981;
  width: 8px;
  height: 8px;
  top: auto;
  bottom: 0;
  right: 0;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

/* Priority Ring Glow */
.dock-agent--urgent .dock-agent-avatar {
  border-color: rgba(239, 68, 68, 0.7);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dock-agent--attention .dock-agent-avatar {
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dock-agent--idle .dock-agent-avatar {
  border-color: rgba(16, 185, 129, 0.4);
}

/* Selected/Active Agent - Larger and Centered */
.dock-agent--selected {
  transform: scale(1.2);
  z-index: 10;
  animation: dockAgentPop 0.25s ease-out;
}

@keyframes dockAgentPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1.2);
  }
}

.dock-agent--selected .dock-agent-avatar {
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3), 0 0 15px rgba(56, 189, 248, 0.4), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dock-agent--selected .dock-agent-name {
  color: #38bdf8;
}

/* Focused Agent (center but not selected) */
.dock-agent--focused {
  transform: scale(1.1);
}

.dock-agent--focused .dock-agent-avatar {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15), 0 0 8px rgba(56, 189, 248, 0.25);
}

/* Hidden agents (outside visible range) */
.dock-agent--hidden {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

/* Transition for sliding animation */
.dock-agent--transitioning {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Dock Stats Bar */
.dock-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.5rem 1rem;
  font-size: 10px;
  color: rgba(148, 163, 184, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 0.5rem;
}

.dock-stat {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.dock-stat-value {
  font-weight: 700;
  font-size: 12px;
}

.dock-stat-value--urgent {
  color: #f87171;
}

.dock-stat-value--attention {
  color: #fbbf24;
}

.dock-stat-value--total {
  color: #10b981;
}

/* Position indicator dots */
.dock-position-indicator {
  display: flex;
  justify-content: center;
  gap: 3px;
  padding: 0.25rem 0 0.125rem;
}

.dock-position-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.3);
  transition: all 0.2s ease;
}

.dock-position-dot--active {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.dock-position-dot--urgent {
  background: rgba(239, 68, 68, 0.5);
}

.dock-position-dot--urgent.dock-position-dot--active {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.dock-position-dot--attention {
  background: rgba(251, 191, 36, 0.5);
}

.dock-position-dot--attention.dock-position-dot--active {
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

/* Swipe hint animation */
@keyframes swipeHint {
  0%, 100% {
    transform: translateX(0);
    opacity: 0.5;
  }
  50% {
    transform: translateX(10px);
    opacity: 1;
  }
}

.dock-swipe-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: rgba(148, 163, 184, 0.5);
  font-size: 10px;
  padding: 0.25rem;
  animation: swipeHint 2s ease-in-out infinite;
}

.dock-swipe-hint svg {
  width: 14px;
  height: 14px;
}

/* Mobile-specific adjustments for the message panel */
@media (max-width: 1023px) {
  #dashboardRoot {
    height: 100vh !important;
    height: 100dvh !important; /* Dynamic viewport height for mobile */
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  #dashboardRoot > .grid {
    grid-template-columns: 1fr !important;
    height: 100% !important;
    flex: 1;
    min-height: 0;
    gap: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Council chamber becomes minimal header + dock strip */
  .council-chamber {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: auto;
    max-height: none;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
  }

  /* Hide the title header on mobile to save space */
  .council-chamber .px-6.pt-5.pb-3 {
    display: none;
  }

  /* Hide Quick Stats Bar on mobile */
  .council-chamber .px-6.py-3.border-t {
    display: none;
  }

  /* Keyboard hints hidden on mobile */
  .council-chamber .absolute.bottom-4 {
    display: none;
  }

  /* Message panel - flex layout for proper scrolling */
  aside.glass-panel {
    flex: 1;
    min-height: 0;
    max-height: none !important;
    display: flex;
    flex-direction: column;
    border-radius: 0 !important;
    border: none !important;
    overflow: hidden;
  }

  /* Agent header - compact */
  #agentPanelHeader {
    flex: 0 0 auto;
    padding: 0.5rem 0.75rem !important;
  }

  #agentPanelHeader .w-14.h-14 {
    width: 2.5rem !important;
    height: 2.5rem !important;
  }

  #agentPanelHeader h3 {
    font-size: 0.9rem;
  }

  /* Placeholder takes available space */
  #agentPanelPlaceholder {
    flex: 1;
    min-height: 0;
  }

  /* Conversation area - scrollable, takes remaining space */
  #conversationArea {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Message input - fixed at bottom, always visible */
  #messageInputArea {
    flex: 0 0 auto;
    position: relative;
    z-index: 50;
    background: rgba(2, 6, 23, 0.98) !important;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0.75rem !important;
    margin-top: auto;
  }

  #messageInputArea textarea {
    min-height: 36px;
    max-height: 60px;
    resize: none;
  }

  #messageInputArea .flex.justify-between {
    margin-top: 0.25rem;
  }

  /* Hide "Press Ctrl+Enter" hint on mobile */
  #messageInputArea p.text-\[10px\] {
    display: none;
  }
}
