/* -------------------------------------------------------------
 * sunar-space Dashboard Styling System (Modern Glassmorphic Dark UI)
 * ------------------------------------------------------------- */

 :root {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  /* Color Palette */
  --bg-primary: #020617;
  --bg-secondary: #0b1329;
  --glass-bg: rgba(15, 23, 42, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --primary-hover: #4f46e5;
  --accent: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.3);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dimmed: #64748b;
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.25);
  
  --sidebar-width: 260px;
  --header-height: 80px;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Background Glowing Orbs */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  top: -10%;
  left: -10%;
  animation: floatOrb 25s infinite alternate ease-in-out;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  bottom: -15%;
  right: -10%;
  animation: floatOrb 30s infinite alternate-reverse ease-in-out;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(80px, 50px) scale(1.1); }
  100% { transform: translate(-40px, -60px) scale(0.9); }
}

/* Utility classes */
.hidden {
  display: none !important;
}

.mt-6 { margin-top: 1.5rem; }
.text-green { color: var(--success) !important; }
.text-red { color: var(--error) !important; }

/* Buttons & Inputs */
.btn {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

/* Glassmorphism Card Style */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

/* Login Modal Screen */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-normal);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  z-index: 1001;
  backdrop-filter: blur(20px);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 20px var(--primary-glow);
}

.logo-icon i {
  color: white;
  width: 30px;
  height: 30px;
}

.login-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.input-group {
  margin-bottom: 1.25rem;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper i {
  position: absolute;
  left: 1rem;
  color: var(--text-dimmed);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.8rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.error-msg {
  color: var(--error);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 1rem;
  min-height: 1.2rem;
}

/* App Main Layout */
.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
  z-index: 10;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(11, 19, 41, 0.7);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(15px);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 30%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-logo i {
  color: var(--primary);
  stroke: var(--primary);
  -webkit-text-fill-color: initial;
  width: 24px;
  height: 24px;
}

.sidebar-nav {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: white;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.05);
}

.nav-item i {
  width: 20px;
  height: 20px;
}

.sidebar-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.15);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  font-size: 0.95rem;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-details .username {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.2;
}

.user-details .role {
  font-size: 0.75rem;
  color: var(--text-dimmed);
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--text-dimmed);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

/* Main Content Panel */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

/* Content Header */
.content-header {
  height: var(--header-height);
  padding: 0 2.5rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  background: rgba(2, 6, 23, 0.2);
  flex-shrink: 0;
}

.page-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-title p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  align-items: center;
}

.status-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  padding: 0.45rem 0.9rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.pulse-dot.grey { background-color: var(--text-dimmed); }
.pulse-dot.green {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success-glow);
  animation: pulseGreen 2s infinite;
}
.pulse-dot.red {
  background-color: var(--error);
  box-shadow: 0 0 8px var(--error-glow);
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Content Body & Views */
.content-body {
  padding: 2.5rem;
  flex-grow: 1;
  overflow-y: auto;
  position: relative;
}

.tab-view {
  display: none;
  height: 100%;
}

.tab-view.active {
  display: block;
}

/* Tab: Dashboard details */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.dashboard-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon.blue { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.card-icon.purple { background: rgba(168, 85, 247, 0.15); color: var(--accent); }
.card-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--success); }

.stat-content h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  word-break: break-all;
}

.stat-desc {
  font-size: 0.8rem;
  color: var(--text-dimmed);
}

.text-card h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.text-card p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.info-item i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.info-item span {
  font-size: 0.95rem;
  color: var(--text-main);
}

/* Tab: File Explorer Split Layout */
.explorer-layout {
  display: grid;
  grid-template-columns: 45% 55%;
  gap: 1.5rem;
  height: 100%;
}

.explorer-list-panel, .explorer-preview-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - var(--header-height) - 5rem);
}

.panel-header {
  height: 60px;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  overflow-x: auto;
  white-space: nowrap;
}

.breadcrumb-separator {
  color: var(--text-dimmed);
  font-size: 0.8rem;
}

.crumb-link {
  color: var(--primary);
  cursor: pointer;
}

.crumb-link:hover {
  text-decoration: underline;
}

.root-crumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}

.root-crumb i {
  width: 16px;
  height: 16px;
}

.explorer-files-container {
  flex-grow: 1;
  overflow-y: auto;
  position: relative;
}

.files-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.files-table th {
  padding: 1rem 1.5rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.files-table td {
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

.file-row {
  cursor: pointer;
  transition: background var(--transition-fast);
}

.file-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.file-row.selected {
  background: rgba(99, 102, 241, 0.08);
}

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
  font-weight: 500;
}

.file-name-cell i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.file-name-cell i.folder-icon { color: var(--primary); }
.file-name-cell i.file-icon { color: var(--text-muted); }
.file-name-cell i.pdf-icon { color: #f43f5e; }
.file-name-cell i.md-icon { color: #38bdf8; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-dimmed);
  text-align: center;
  gap: 1rem;
}

.empty-state i {
  width: 48px;
  height: 48px;
}

/* File Explorer: Preview Pane details */
.preview-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.preview-title i {
  color: var(--primary);
  width: 18px;
  height: 18px;
}

.preview-content-container {
  flex-grow: 1;
  overflow: auto;
  position: relative;
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dimmed);
  padding: 3rem;
  text-align: center;
  gap: 1rem;
}

.preview-placeholder i {
  width: 64px;
  height: 64px;
  opacity: 0.5;
}

.preview-placeholder p {
  max-width: 320px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

/* Markdown styling overrides in explorer preview */
.markdown-preview {
  padding: 2.5rem;
  color: #e2e8f0;
  line-height: 1.625;
  font-size: 0.975rem;
}

.markdown-preview h1, .markdown-preview h2, .markdown-preview h3, .markdown-preview h4 {
  color: white;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 0.3rem;
}

.markdown-preview h1 { font-size: 1.8rem; }
.markdown-preview h2 { font-size: 1.4rem; }
.markdown-preview h3 { font-size: 1.15rem; }

.markdown-preview p {
  margin-bottom: 1rem;
}

.markdown-preview code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: #f472b6;
}

.markdown-preview pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  margin-bottom: 1.25rem;
}

.markdown-preview pre code {
  background: transparent;
  padding: 0;
  color: #38bdf8;
  font-size: 0.9rem;
}

.markdown-preview ul, .markdown-preview ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.markdown-preview li {
  margin-bottom: 0.25rem;
}

/* Binary display view */
.binary-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  height: 100%;
  gap: 1.5rem;
}

.binary-icon {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.binary-icon i {
  width: 40px;
  height: 40px;
}

.binary-info {
  text-align: center;
}

.binary-info h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.binary-info p {
  color: var(--text-dimmed);
  font-size: 0.85rem;
}

/* Tab: Terminal Emulator UI */
.terminal-container-wrapper {
  background: #020617;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: calc(100vh - var(--header-height) - 5rem);
  display: flex;
  flex-direction: column;
}

.terminal-header {
  height: 50px;
  padding: 0 1.25rem;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot.red { background-color: #ef4444; }
.terminal-dot.yellow { background-color: #f59e0b; }
.terminal-dot.green { background-color: #10b981; }

.terminal-path {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.terminal-element {
  flex-grow: 1;
  padding: 1rem;
  background: #020617;
}

/* Customizing xterm.js theme elements */
.xterm {
  height: 100%;
}

.xterm-viewport {
  background-color: #020617 !important;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* -------------------------------------------------------------
 * AI Agents Tab Layout & Chat Elements
 * ------------------------------------------------------------- */
.agents-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  height: calc(100vh - var(--header-height) - 5rem);
}

.agents-sidebar-panel, .agents-chat-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.agents-list {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  flex-grow: 1;
}

.agent-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  background: rgba(255, 255, 255, 0.02);
}

.agent-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.agent-item.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.05);
}

.agent-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
}

.agent-avatar.claude {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.agent-avatar.agy {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.agent-meta {
  flex-grow: 1;
}

.agent-meta h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--text-main);
}

.agent-meta p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.agent-badge {
  font-size: 0.7rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.15rem 0.45rem;
  border-radius: 50px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Chat panel inside Agents Tab */
.chat-messages-wrapper {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: rgba(0, 0, 0, 0.15);
}

.chat-bubble {
  max-width: 75%;
  display: flex;
  flex-direction: column;
  animation: fadeInBubble 0.25s ease-out forwards;
}

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

.chat-bubble.user {
  align-self: flex-end;
}

.chat-bubble.agent {
  align-self: flex-start;
}

.chat-bubble.system {
  align-self: center;
  max-width: 90%;
  text-align: center;
}

.chat-bubble-content {
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-bubble.user .chat-bubble-content {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.chat-bubble.agent .chat-bubble-content {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 2px;
}

.chat-bubble.system .chat-bubble-content {
  background: transparent;
  color: var(--text-dimmed);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border: none;
  padding: 0.2rem 1rem;
}

.chat-bubble-meta {
  font-size: 0.75rem;
  color: var(--text-dimmed);
  margin-top: 0.35rem;
  display: flex;
  gap: 0.5rem;
}

.chat-bubble.user .chat-bubble-meta {
  justify-content: flex-end;
}

.chat-bubble.agent .chat-bubble-meta {
  justify-content: flex-start;
}

.chat-input-bar {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(11, 19, 41, 0.4);
}

.chat-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.chat-input-wrapper input {
  width: 100%;
  padding: 0.85rem 3.5rem 0.85rem 1.25rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.chat-input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.chat-send-btn {
  position: absolute;
  right: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border: none;
  color: white;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.chat-send-btn i {
  width: 18px;
  height: 18px;
}

/* Typing indicator spinner */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-dimmed);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}
