/**
 * Futuristic Cyberpunk Neon Glassmorphism Stylesheet
 * Custom designed for ADK Gemini Live API Toolkit
 */

:root {
  /* Fonts */
  --font-header: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Monaco', 'Menlo', monospace;

  /* Theme Colors */
  --bg-main: #06060c;
  --bg-header: rgba(10, 10, 20, 0.7);
  --bg-panel: rgba(14, 14, 28, 0.45);
  --bg-input-container: rgba(10, 10, 20, 0.8);
  --bg-console: #07070f;
  --bg-console-header: #10101e;
  
  /* Neon Accents */
  --neon-blue: #00f0ff;
  --neon-blue-glow: rgba(0, 240, 255, 0.25);
  --neon-purple: #bc34fa;
  --neon-purple-glow: rgba(188, 52, 250, 0.25);
  --neon-green: #39ff14;
  --neon-green-glow: rgba(57, 255, 20, 0.25);
  --neon-orange: #ff9f1c;
  --neon-orange-glow: rgba(255, 159, 28, 0.25);
  --neon-red: #ff3366;
  --neon-red-glow: rgba(255, 51, 102, 0.25);

  /* Glassmorphism Accents */
  --border-glass: rgba(255, 255, 255, 0.05);
  --border-glass-active: rgba(255, 255, 255, 0.12);
  --glow-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --glass-blur: blur(20px);
}

/* Reset and Core Setup */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  background-image:
    radial-gradient(at 0% 0%, rgba(188, 52, 250, 0.12) 0px, transparent 40%),
    radial-gradient(at 100% 0%, rgba(0, 240, 255, 0.1) 0px, transparent 40%),
    radial-gradient(at 50% 100%, rgba(57, 255, 20, 0.05) 0px, transparent 50%);
  color: #e2e8f0;
  line-height: 1.6;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Glassmorphic Header */
.glass-header {
  background: var(--bg-header);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  padding: 1rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  position: relative;
}

.glass-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-purple), var(--neon-blue), transparent);
  opacity: 0.6;
}

.header-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

h1 {
  font-family: var(--font-header);
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 60%, var(--neon-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* Header Options (Back Link & Custom Switch Toggles) */
.header-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.dashboard-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.6);
  text-decoration: none;
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15) 0%, rgba(188, 52, 250, 0.15) 100%);
  padding: 0.55rem 1.4rem;
  border-radius: 50px;
  border: 1.5px solid rgba(0, 240, 255, 0.45);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
  animation: button-breathe 2.5s infinite ease-in-out;
  position: relative;
  overflow: hidden;
}

.dashboard-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 30%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  transform: skewX(-25deg);
  transition: none;
}

.dashboard-link:hover::before {
  left: 150%;
  transition: left 0.8s ease-in-out;
}

.dashboard-link:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(188, 52, 250, 0.25) 100%);
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.5), 0 0 10px rgba(188, 52, 250, 0.3);
  transform: translateY(-2px) scale(1.02);
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--neon-blue);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--neon-blue);
  animation: dot-pulse 1.8s infinite ease-in-out;
}

@keyframes button-breathe {
  0%, 100% {
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.15), 0 0 3px rgba(188, 52, 250, 0.1);
    border-color: rgba(0, 240, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 22px rgba(0, 240, 255, 0.4), 0 0 8px rgba(188, 52, 250, 0.2);
    border-color: rgba(0, 240, 255, 0.85);
  }
}

@keyframes dot-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
    box-shadow: 0 0 6px var(--neon-blue);
  }
  50% {
    transform: scale(1.4);
    opacity: 1;
    box-shadow: 0 0 12px var(--neon-blue), 0 0 4px var(--neon-purple);
  }
}

.toggles-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-label {
  font-size: 0.85rem;
  color: #cbd5e1;
  font-weight: 500;
  transition: color 0.2s;
}

.header-checkbox-wrapper:hover .checkbox-label {
  color: #ffffff;
}

/* Custom CSS Toggle Switch (cyberpunk style) */
.custom-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.custom-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 34px;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: #cbd5e1;
  border-radius: 50%;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.custom-switch input:checked + .switch-slider {
  background-color: rgba(188, 52, 250, 0.2);
  border-color: var(--neon-purple);
}

.custom-switch input:checked + .switch-slider:before {
  transform: translateX(18px);
  background-color: var(--neon-purple);
  box-shadow: 0 0 8px var(--neon-purple);
}

/* Connection Status Card */
.connection-status-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  box-shadow: var(--glow-shadow);
}

.status-indicator-container {
  position: relative;
  width: 10px;
  height: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--neon-green);
  box-shadow: 0 0 10px var(--neon-green);
  transition: all 0.3s ease;
  z-index: 2;
}

.status-indicator.disconnected {
  background-color: var(--neon-red);
  box-shadow: 0 0 10px var(--neon-red);
}

.status-indicator-ring {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--neon-green);
  opacity: 0;
  animation: pulse-ring 2s infinite;
  pointer-events: none;
}

.status-indicator.disconnected + .status-indicator-ring {
  border-color: var(--neon-red);
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

.status-text {
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #e2e8f0;
}

/* Premium User Status Badge next to Connection Indicator */
.user-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(188, 52, 250, 0.12);
  border: 1px solid rgba(188, 52, 250, 0.35);
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  font-family: var(--font-header);
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  margin-left: 0.5rem;
  box-shadow: 0 0 10px rgba(188, 52, 250, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.user-status-badge:hover {
  background: rgba(188, 52, 250, 0.22);
  border-color: rgba(188, 52, 250, 0.55);
  box-shadow: 0 0 15px rgba(188, 52, 250, 0.4);
  transform: translateY(-1px);
}

.user-badge-icon {
  font-size: 0.85rem;
  filter: drop-shadow(0 0 2px rgba(188, 52, 250, 0.8));
}

.user-badge-text {
  letter-spacing: 0.5px;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

/* Main Layout: Split view */
.main-layout {
  flex: 1;
  display: flex;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
}

/* Chat container (2/3 view) */
.container {
  flex: 1.6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border-glass);
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: relative;
}

/* Messages Chat Viewport */
.chat-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-behavior: smooth;
}

/* Webkit Scrollbar Styling (Futuristic Sleek Scroll) */
.chat-viewport::-webkit-scrollbar,
.console-content::-webkit-scrollbar,
.console-entry-json::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.chat-viewport::-webkit-scrollbar-track,
.console-content::-webkit-scrollbar-track,
.console-entry-json::-webkit-scrollbar-track {
  background: transparent;
}

.chat-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.chat-viewport::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.3);
}

/* Message Entry Transitions */
.message {
  display: flex;
  width: 100%;
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  animation: slide-in-bubble 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-in-bubble {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

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

/* Chat Bubbles Styling */
.bubble {
  max-width: 72%;
  padding: 0.9rem 1.25rem;
  border-radius: 1.1rem;
  box-shadow: var(--glow-shadow);
  position: relative;
  font-size: 0.95rem;
  line-height: 1.5;
  letter-spacing: 0.1px;
  transition: all 0.3s ease;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

/* User Message: Blue Neon Glow */
.message.user .bubble {
  background: rgba(0, 240, 255, 0.07);
  color: #ffffff;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.04);
}

.message.user .bubble:hover {
  border-color: var(--neon-blue);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

/* Agent Message: Purple Neon Glow */
.message.agent .bubble {
  background: rgba(188, 52, 250, 0.06);
  color: #f8fafc;
  border: 1px solid rgba(188, 52, 250, 0.25);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 15px rgba(188, 52, 250, 0.04);
}

.message.agent .bubble:hover {
  border-color: var(--neon-purple);
  box-shadow: 0 0 15px rgba(188, 52, 250, 0.15);
}

.bubble-text {
  margin: 0;
  word-wrap: break-word;
}

/* Interrupted Session Message */
.message.interrupted .bubble {
  background: rgba(255, 159, 28, 0.04);
  border: 1px dashed rgba(255, 159, 28, 0.4);
  box-shadow: 0 0 10px rgba(255, 159, 28, 0.05);
}

.message.interrupted .bubble::after {
  content: '⚡ INTERRUPTED';
  display: block;
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 0.65rem;
  color: var(--neon-orange);
  letter-spacing: 1px;
  margin-top: 0.4rem;
}

/* User Transcription Badge */
.message.transcription.user .bubble {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.message.transcription.user .bubble::before {
  content: '🎤 ';
  margin-right: 0.3rem;
  filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.5));
}

/* Image bubble container */
.bubble.image-bubble {
  padding: 0.4rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-glass);
}

.bubble-image {
  max-width: 100%;
  max-height: 280px;
  border-radius: 10px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.05);
}

/* Secure Sandbox Custom Chat Bubbles */
.bubble.sandbox-code-bubble {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.45); /* Amber border for secure execution */
  color: #f8fafc;
  max-width: 85%;
  font-family: var(--font-mono);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08);
  margin: 0.5rem 0;
}

.bubble.sandbox-code-bubble:hover {
  border-color: rgba(245, 158, 11, 0.85);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.sandbox-code-header {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #f59e0b; /* Amber */
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  padding-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sandbox-code-pre {
  margin: 0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
  color: #cbd5e1;
}

.bubble.sandbox-result-bubble {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.45); /* Green border for successful run */
  color: #ecfdf5;
  max-width: 85%;
  font-family: var(--font-mono);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
  margin: 0.5rem 0;
}

.bubble.sandbox-result-bubble.sandbox-error {
  border-color: rgba(239, 68, 68, 0.45); /* Red border for execution error */
  color: #fef2f2;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.08);
}

.bubble.sandbox-result-bubble:hover {
  border-color: rgba(16, 185, 129, 0.85);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.bubble.sandbox-result-bubble.sandbox-error:hover {
  border-color: rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.sandbox-result-header {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #10b981; /* Green */
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  padding-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bubble.sandbox-result-bubble.sandbox-error .sandbox-result-header {
  color: #ef4444; /* Red */
  border-bottom-color: rgba(239, 68, 68, 0.2);
}

.sandbox-result-pre {
  margin: 0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
  color: #a7f3d0;
}

.bubble.sandbox-result-bubble.sandbox-error .sandbox-result-pre {
  color: #fca5a5;
}


/* Typing / Generating Indicator */
.typing-indicator {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 0.2rem 0.5rem;
}

.typing-indicator::after {
  content: '• • •';
  font-weight: bold;
  font-size: 1.2rem;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulse-loading 1.4s infinite;
}

@keyframes pulse-loading {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Input Form Panel */
.input-container {
  border-top: 1px solid var(--border-glass);
  background-color: var(--bg-input-container);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 1.25rem 2.5rem;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
}

#messageForm {
  display: flex;
  width: 100%;
}

.input-wrapper {
  display: flex;
  width: 100%;
  gap: 1rem;
  align-items: center;
}

/* Futuristic Neon Input Field */
#message {
  flex: 1;
  padding: 0.85rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: #ffffff;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

#message::placeholder {
  color: #64748b;
}

#message:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--neon-blue);
  box-shadow: 
    0 0 15px rgba(0, 240, 255, 0.15),
    inset 0 1px 2px rgba(0,0,0,0.1);
}

/* Cyberpunk Buttons */
button {
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  padding: 0.85rem 1.75rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

button:active {
  transform: translateY(1px);
}

/* Send Button */
.btn-send {
  background: linear-gradient(135deg, var(--neon-blue) 0%, #0099ff 100%);
  color: #030712;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.25);
}

.btn-send:hover:not(:disabled) {
  box-shadow: 0 0 20px var(--neon-blue-glow);
  transform: translateY(-2px);
}

.btn-send:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: #475569;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: none;
  cursor: not-allowed;
}

/* Audio Button with Embedded Ripple Wave */
.btn-audio {
  background: linear-gradient(135deg, var(--neon-green) 0%, #10b981 100%);
  color: #030712;
  box-shadow: 0 4px 15px rgba(57, 255, 20, 0.2);
  min-width: 140px;
}

.btn-audio:hover:not(:disabled) {
  box-shadow: 0 0 20px var(--neon-green-glow);
  transform: translateY(-2px);
}

.btn-audio:disabled {
  /* This is when it's ACTIVE and recording */
  background: rgba(10, 10, 15, 0.7);
  color: var(--neon-purple);
  border: 1px solid var(--neon-purple);
  box-shadow: 0 0 15px var(--neon-purple-glow);
  cursor: not-allowed; /* The system locks button, which acts as "on" state */
}

/* Waveform visualizer container (inserted inside button) */
.wave-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  margin-left: 0.5rem;
}

.wave-visualizer.hidden {
  display: none;
}

.wave-bar {
  width: 3px;
  background-color: var(--neon-purple);
  border-radius: 10px;
  animation: pulse-wave 1s ease-in-out infinite alternate;
}

/* Custom pulsing heights */
.bar-1 { height: 30%; animation-delay: 0.1s; }
.bar-2 { height: 70%; animation-delay: 0.3s; }
.bar-3 { height: 100%; animation-delay: 0s; }
.bar-4 { height: 60%; animation-delay: 0.4s; }
.bar-5 { height: 40%; animation-delay: 0.2s; }

/* When button is disabled (representing ACTIVE RECORDING mode), override display in CSS */
button.btn-audio:disabled .audio-btn-content {
  display: none; /* Hide standard start text */
}

button.btn-audio:disabled .wave-visualizer {
  display: flex; /* Force show the visualizer bars */
}

button.btn-audio:disabled::after {
  content: 'LISTENING...';
  font-family: var(--font-header);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--neon-purple);
  letter-spacing: 0.5px;
}

@keyframes pulse-wave {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

/* Camera Button */
.btn-camera {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.btn-camera:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

/* System Message Node */
.system-message {
  text-align: center;
  font-family: var(--font-header);
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  align-self: center;
  border: 1px solid var(--border-glass);
}

/* High-Tech Event Console (1/3 View) */
.console-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-console);
  border-left: 1px solid var(--border-glass);
  overflow: hidden;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.5rem;
  background-color: var(--bg-console-header);
  border-bottom: 1px solid var(--border-glass);
}

.console-header h2 {
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 700;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.console-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Custom Checkbox wrapper for show audio toggle */
.console-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-header);
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}

.console-checkbox-wrapper input[type="checkbox"] {
  display: none;
}

.checkbox-box {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
  display: inline-block;
  position: relative;
  transition: all 0.2s;
}

.console-checkbox-wrapper input[type="checkbox"]:checked + .checkbox-box {
  background-color: var(--neon-blue);
  border-color: var(--neon-blue);
  box-shadow: 0 0 6px var(--neon-blue-glow);
}

.console-checkbox-wrapper input[type="checkbox"]:checked + .checkbox-box::after {
  content: '✓';
  color: #030712;
  font-size: 0.65rem;
  font-weight: bold;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.console-clear-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  background-color: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.console-clear-btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Event Logs Content Area */
.console-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.console-entry {
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.85rem;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-left: 3px solid transparent;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.console-entry.outgoing {
  border-left-color: var(--neon-blue);
  background-color: rgba(0, 240, 255, 0.02);
}

.console-entry.incoming {
  border-left-color: var(--neon-purple);
  background-color: rgba(188, 52, 250, 0.02);
}

.console-entry.error {
  border-left-color: var(--neon-red);
  background-color: rgba(255, 51, 102, 0.04);
}

.console-entry.expandable {
  cursor: pointer;
}

.console-entry.expandable:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.console-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.console-entry-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.console-entry-emoji {
  font-size: 0.85rem;
  min-width: 16px;
  text-align: center;
}

.console-expand-icon {
  font-size: 0.6rem;
  color: #64748b;
  min-width: 10px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.console-entry.expanded .console-expand-icon {
  transform: rotate(90deg);
}

.console-entry-type {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.console-entry.outgoing .console-entry-type { color: var(--neon-blue); }
.console-entry.incoming .console-entry-type { color: var(--neon-purple); }
.console-entry.error .console-entry-type { color: var(--neon-red); }

.console-entry-author {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.console-entry-author[data-author="system"] {
  background-color: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.08);
}

.console-entry-author[data-author="user"] {
  background-color: rgba(0, 240, 255, 0.1);
  color: var(--neon-blue);
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.console-entry-timestamp {
  color: #475569;
  font-size: 0.65rem;
}

.console-entry-content {
  color: #cbd5e1;
  line-height: 1.5;
  padding-left: 1.5rem;
  word-break: break-all;
}

/* Beautiful custom syntax highlights inside logs */
.console-entry-json {
  background-color: #030712;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  overflow-x: auto;
  max-height: 350px;
}

.console-entry-json.collapsed {
  display: none;
}

.console-entry-json pre {
  margin: 0;
  color: #38bdf8;
  font-family: var(--font-mono);
}

.json-key { color: var(--neon-blue); }
.json-string { color: #a78bfa; }
.json-number { color: var(--neon-green); }
.json-boolean { color: var(--neon-orange); }
.json-null { color: #94a3b8; }

/* Interactive Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #0c0a1c;
  border-radius: 16px;
  border: 1px solid rgba(188, 52, 250, 0.3);
  box-shadow: 0 15px 50px rgba(188, 52, 250, 0.15);
  max-width: 90%;
  max-height: 90%;
  width: 600px;
  display: flex;
  flex-direction: column;
  animation: modal-slide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-slide {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.modal-header h3 {
  font-family: var(--font-header);
  font-size: 1.15rem;
  color: #f8fafc;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: #64748b;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.close-btn:hover {
  background-color: rgba(255,255,255,0.05);
  color: #ffffff;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  background-color: #030712;
}

#cameraPreview {
  width: 100%;
  max-height: 400px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.1);
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-blue) 0%, #0099ff 100%);
  color: #030712;
}

.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: #f1f5f9;
  border: 1px solid rgba(255,255,255,0.1);
}

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

/* Responsive view adaptions */
@media (max-width: 900px) {
  .glass-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.5rem;
    align-items: flex-start;
  }
  
  .connection-status-card {
    align-self: flex-end;
  }

  .main-layout {
    flex-direction: column;
  }

  .container {
    border-right: none;
    flex: 1;
    max-height: 60vh;
  }

  .console-panel {
    max-height: 40vh;
    border-top: 1px solid var(--border-glass);
  }

  .chat-viewport {
    padding: 1.25rem;
  }

  .bubble {
    max-width: 85%;
  }

  .input-container {
    padding: 1rem;
  }

  .input-wrapper {
    flex-direction: column;
    gap: 0.75rem;
  }

  #message, button {
    width: 100%;
  }

  .voice-config-container, .model-config-container, .sandbox-config-container, .user-config-container {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }
}

/* Voice Config Container in Header */
.voice-config-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 240, 255, 0.15);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.05);
}

.voice-config-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.voice-icon-spark {
  font-size: 0.95rem;
  filter: drop-shadow(0 0 3px rgba(0, 240, 255, 0.4));
}

.voice-config-label {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--neon-blue);
  letter-spacing: 0.5px;
}

.header-select {
  background: rgba(10, 10, 20, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 6px;
  color: #ffffff;
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.05);
}

.header-select:hover {
  border-color: var(--neon-blue);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.header-select:focus {
  border-color: var(--neon-purple);
  box-shadow: 0 0 12px rgba(188, 52, 250, 0.25);
}

/* Model Config Container in Header */
.model-config-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(188, 52, 250, 0.15);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(188, 52, 250, 0.05);
}

.model-config-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.model-icon-spark {
  font-size: 0.95rem;
  filter: drop-shadow(0 0 3px rgba(188, 52, 250, 0.4));
}

.model-config-label {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--neon-purple);
  letter-spacing: 0.5px;
}

/* Sandbox Config Container in Header (Premium Amber/Gold Theme) */
.sandbox-config-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 170, 0, 0.18);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(255, 170, 0, 0.05);
  transition: all 0.3s ease;
}

.sandbox-config-container:hover {
  border-color: rgba(255, 170, 0, 0.35);
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.1);
}

.sandbox-config-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sandbox-icon-spark {
  font-size: 0.95rem;
  filter: drop-shadow(0 0 3px rgba(255, 170, 0, 0.4));
}

.sandbox-config-label {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffaa00;
  letter-spacing: 0.5px;
}

/* Global hidden utility */
.hidden {
  display: none !important;
}

/* User Config Container in Header (Premium Green Theme) */
.user-config-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(16, 185, 129, 0.18);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.05);
  transition: all 0.3s ease;
}

.user-config-container:hover {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.user-config-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.user-icon-spark {
  font-size: 0.95rem;
  filter: drop-shadow(0 0 3px rgba(16, 185, 129, 0.4));
}

.user-config-label {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #10b981;
  letter-spacing: 0.5px;
}
