/* ==========================================================================
   AETHER // COMPONENTS
   ========================================================================== */

/* 1. Monolithic Chassis */
.tactical-console {
  position: relative;
  width: 100%;
  max-width: 720px;
  height: 85vh;
  max-height: 840px;
  background: var(--surface-monolith);
  border-radius: 16px;
  box-shadow: var(--shadow-monolith);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

/* 2. Minimal Header */
.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 40px;
  background: var(--surface-monolith);
  z-index: 20;
}

.agent-profile {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  filter: grayscale(1);
}

.avatar-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-meta h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.status-indicator .dot {
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.audio-toggle {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
}

.audio-toggle:hover {
  color: var(--text-primary);
}

.audio-icon {
  width: 20px;
  height: 20px;
}

/* 3. Immersive Chat Stream */
.console-stream {
  flex: 1;
  overflow-y: auto;
  padding: 0 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.chat-row {
  display: flex;
  animation: slideUp 0.4s var(--ease-fluid) forwards;
  opacity: 0;
  transform: translateY(10px);
}

@keyframes slideUp {
  to { opacity: 1; transform: translateY(0); }
}

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

.chat-bubble {
  max-width: 90%;
  font-size: 1.15rem;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.chat-row.agent .chat-bubble {
  color: var(--text-primary);
}

.chat-row.user .chat-bubble {
  color: var(--text-secondary);
  text-align: right;
}

/* 4. Giant Seamless Input */
.console-input-area {
  padding: 32px 40px;
  background: var(--surface-monolith);
  z-index: 20;
}

.input-bezel {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  background: var(--surface-raised);
  border-radius: 24px;
  padding: 12px 12px 12px 24px;
  border: 1px solid var(--accent-border);
  transition: border-color 0.3s;
}

.input-bezel:focus-within {
  border-color: rgba(255, 255, 255, 0.3);
}

.input-bezel textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.1rem;
  line-height: 1.5;
  resize: none;
  max-height: 200px;
  padding: 8px 0;
}

.input-bezel textarea::placeholder {
  color: var(--text-tertiary);
}

.send-button {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #ffffff;
  color: #000000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s var(--ease-fluid);
}

.send-button:hover {
  transform: scale(1.05);
}

.send-button:active {
  transform: scale(0.95);
}

/* Widgets */
.agent-widget {
  margin-top: 24px;
  background: var(--surface-raised);
  border: 1px solid var(--accent-border);
  border-radius: 16px;
  padding: 24px;
}

.widget-header {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.widget-item {
  margin-bottom: 16px;
}

.widget-item h4 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.widget-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.widget-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.widget-btn {
  padding: 12px 20px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.widget-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.widget-btn.primary {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.widget-btn.primary:hover {
  background: #e0e0e0;
}

@media (max-width: 768px) {
  .stage-3d-wrapper { padding: 0; }
  .tactical-console { border-radius: 0; height: 100vh; max-height: 100vh; border: none; transform: none !important; }
  .console-header { padding: 24px; }
  .console-stream { padding: 0 24px; }
  .console-input-area { padding: 24px; }
}

/* 5. Aether Pulse Loader & Markdown formatting */
.aether-pulse-loader {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}

.aether-pulse-loader span {
  width: 7px;
  height: 7px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: inline-block;
  animation: aetherPulse 1.4s infinite ease-in-out both;
}

.aether-pulse-loader span:nth-child(1) { animation-delay: -0.32s; }
.aether-pulse-loader span:nth-child(2) { animation-delay: -0.16s; }
.aether-pulse-loader span:nth-child(3) { animation-delay: 0s; }

@keyframes aetherPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.25; }
  40% { transform: scale(1.0); opacity: 1; background: #ffffff; }
}

.chat-bubble p {
  margin: 0 0 12px 0;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-bubble pre {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  font-family: var(--font-mono, monospace);
  font-size: 0.9rem;
  margin: 12px 0;
  color: #e2e8f0;
}

.chat-bubble code {
  font-family: var(--font-mono, monospace);
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
}

.chat-bubble pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.chat-bubble ul, .chat-bubble ol {
  margin: 8px 0 12px 20px;
  padding: 0;
}

.chat-bubble li {
  margin-bottom: 6px;
}

