/* Obsidian Prism Stylesheet - Custom overrides and utility additions */

:root {
  --bg: #0b1326;
  --card-bg: rgba(30, 41, 59, 0.6);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #dae2fd;
  --text-muted: #c7c4d7;
  
  /* Brand Gradients & Accents */
  --accent-primary: #8083ff;
  --accent-secondary: #494bd6;
  --accent-gradient: linear-gradient(135deg, #494bd6, #6f00be);
  --accent-glow: rgba(128, 131, 255, 0.25);
  
  /* Outcome Colors */
  --color-accepted: #4edea3;
  --color-rejected: #ffb4ab;
  --color-callback: #fca5a5;
  --color-no-answer: #908fa0;
}

/* Custom Scrollbar for Electron App feel */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #2d3449; /* surface-variant */
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #464554; /* outline-variant */
}

/* Ambient Glow Orb */
.ambient-glow {
  position: fixed;
  top: 20%;
  left: 50%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(128, 131, 255, 0.04) 0%, rgba(11, 19, 38, 0) 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  animation: pulse-slow 15s infinite alternate ease-in-out;
}

@keyframes pulse-slow {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

/* Active states body modifiers for backdrop color matching */
body.connecting .ambient-glow {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.06) 0%, rgba(11, 19, 38, 0) 70%);
}
body.connected .ambient-glow {
  background: radial-gradient(circle, rgba(0, 242, 254, 0.06) 0%, rgba(11, 19, 38, 0) 70%);
}
body.speaking-agent .ambient-glow {
  background: radial-gradient(circle, rgba(236, 72, 153, 0.08) 0%, rgba(11, 19, 38, 0) 70%);
}
body.speaking-user .ambient-glow {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, rgba(11, 19, 38, 0) 70%);
}

/* Glassmorphic Panel and Card classes */
.glass-panel {
  background: rgba(30, 41, 59, 0.35);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-top: 1px solid rgba(255, 255, 255, 0.12); /* Top weighted border */
}

/* Voice Orb Visualization Styling */
.orb-wrapper {
  position: relative;
  z-index: 1;
}

.orb-container {
  width: 280px;
  height: 280px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-glow-layer {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(128, 131, 255, 0.25) 0%, rgba(0, 242, 254, 0.05) 60%, rgba(0,0,0,0) 100%);
  filter: blur(24px);
  z-index: 1;
  pointer-events: none;
  animation: orb-pulse 4s infinite alternate ease-in-out;
  transition: all 0.5s ease;
}

body.connecting .orb-glow-layer {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, rgba(245, 158, 11, 0.05) 60%, rgba(0,0,0,0) 100%);
  filter: blur(28px);
}
body.connected .orb-glow-layer {
  background: radial-gradient(circle, rgba(0, 242, 254, 0.3) 0%, rgba(128, 131, 255, 0.15) 65%, rgba(0,0,0,0) 100%);
  filter: blur(22px);
}
body.speaking-agent .orb-glow-layer {
  background: radial-gradient(circle, rgba(236, 72, 153, 0.4) 0%, rgba(128, 131, 255, 0.2) 60%, rgba(0,0,0,0) 100%);
  filter: blur(32px);
  width: 210px;
  height: 210px;
}
body.speaking-user .orb-glow-layer {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.4) 0%, rgba(236, 72, 153, 0.15) 60%, rgba(0,0,0,0) 100%);
  filter: blur(28px);
}

canvas#voice-orb-canvas {
  position: relative;
  z-index: 2;
  display: block;
}

@keyframes orb-pulse {
  0% { transform: scale(0.92); opacity: 0.6; }
  100% { transform: scale(1.08); opacity: 0.9; }
}

.connection-status-text {
  font-family: 'Geist', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.6);
  padding: 0.4rem 1.2rem;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  min-width: 160px;
  transition: all 0.3s ease;
}

body.connected .connection-status-text {
  color: var(--accent-primary);
  border-color: rgba(128, 131, 255, 0.2);
  box-shadow: 0 0 12px rgba(128, 131, 255, 0.1);
}
body.connecting .connection-status-text {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.2);
}

/* Timeline Activity Items inside Transcript */
.activity-item {
  position: relative;
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-left: 3px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px 8px 8px 4px;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
  animation: item-appear 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes item-appear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.activity-item.kind-info { border-left-color: var(--text-muted); }
.activity-item.kind-session { border-left-color: var(--accent-primary); }
.activity-item.kind-tool { border-left-color: var(--accent-secondary); }
.activity-item.kind-tool-ok { border-left-color: var(--color-accepted); }
.activity-item.kind-tool-err { border-left-color: var(--color-rejected); }
.activity-item.kind-voice { border-left-color: var(--color-accepted); }
.activity-item.kind-error { border-left-color: var(--color-rejected); background: rgba(239, 68, 68, 0.05); }

.activity-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.activity-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.activity-badge {
  font-family: 'Geist', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}

.activity-item.kind-tool .activity-badge,
.activity-item.kind-tool-ok .activity-badge {
  background: rgba(128, 131, 255, 0.15);
  color: #c0c1ff;
}
.activity-item.kind-tool-err .activity-badge,
.activity-item.kind-error .activity-badge {
  background: rgba(255, 180, 171, 0.15);
  color: #ffb4ab;
}
.activity-item.kind-session .activity-badge {
  background: rgba(73, 75, 214, 0.15);
  color: #8083ff;
}
.activity-item.kind-voice .activity-badge {
  background: rgba(78, 222, 163, 0.15);
  color: #6ffbbe;
}

.activity-title {
  font-weight: 600;
  font-size: 0.78rem;
  color: #fff;
}

.activity-detail {
  margin-top: 0.35rem;
  background: #040815;
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  white-space: pre-wrap;
  word-break: break-all;
  color: #a1b0cb;
  max-height: 120px;
  overflow-y: auto;
}

.activity-result {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-accepted);
}
.activity-result.err {
  color: var(--color-rejected);
}

/* Tab contents and transitions */
.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Geist', sans-serif;
  transition: all 0.2s ease;
}
.tab-btn:hover {
  color: #fff;
}
.tab-btn.active {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
  animation: tab-fade 0.25s ease both;
}

@keyframes tab-fade {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

/* Health indicators */
.health-pill {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}
.health-pill.ok {
  border-color: rgba(78, 222, 163, 0.4);
  color: #a7f3d0;
  background: rgba(78, 222, 163, 0.1);
}
.health-pill.warn {
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.1);
}

/* Custom visualizer bounce animation if used */
.bar {
  animation: bounce 1.2s infinite ease-in-out alternate;
}
@keyframes bounce {
  0% { transform: scaleY(0.2); }
  100% { transform: scaleY(1); }
}

/* Input Focus */
.input-glow:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(128, 131, 255, 0.2);
}
