/* AG Clarity Voice Assistant Styles */

/* Floating Action Button */
.voice-fab {
  position: fixed;
  bottom: 5rem;
  right: 1.25rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 2px solid #D4A028;
  color: #D4A028;
  cursor: pointer;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}
.voice-fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(212,160,40,0.3); }
.voice-fab svg { width: 24px; height: 24px; }
.voice-fab.listening { background: #D4A028; border-color: #D4A028; }
.voice-fab.listening svg { color: #1a1a1a; }
.voice-fab.processing { background: #1a1a1a; border-color: #D4A028; }
.voice-fab.speaking { background: #2d5016; border-color: #4CAF50; }
.voice-fab.error { background: #7f1d1d; border-color: #ef4444; }

/* Pulse rings when listening */
.voice-fab.listening::before,
.voice-fab.listening::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #D4A028;
  animation: voice-pulse 1.5s ease-out infinite;
}
.voice-fab.listening::after { animation-delay: 0.5s; }

@keyframes voice-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Processing spin */
.voice-fab.processing svg { animation: voice-spin 1s linear infinite; }
@keyframes voice-spin {
  to { transform: rotate(360deg); }
}

/* Panel */
.voice-panel {
  position: fixed;
  bottom: 8.5rem;
  right: 1.25rem;
  width: 340px;
  max-height: 480px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 16px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  overflow: hidden;
  animation: voice-slide-up 0.25s ease-out;
}
.voice-panel.hidden { display: none; }

@keyframes voice-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.voice-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.voice-panel-header h3 { color: #D4A028; font-size: 14px; font-weight: 700; margin: 0; }
.voice-panel-close { background: none; border: none; color: #666; cursor: pointer; font-size: 18px; padding: 4px; }
.voice-panel-close:hover { color: #fff; }

.voice-panel-status {
  padding: 8px 16px;
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.voice-panel-status .dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.voice-panel-status .dot.idle { background: #555; }
.voice-panel-status .dot.listening { background: #D4A028; animation: voice-dot-pulse 1s ease infinite; }
.voice-panel-status .dot.processing { background: #D4A028; animation: voice-spin 1s linear infinite; }
.voice-panel-status .dot.speaking { background: #4CAF50; }
.voice-panel-status .dot.error { background: #ef4444; }

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

/* Waveform bars during listening */
.voice-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 32px;
  padding: 8px 16px;
}
.voice-waveform .bar {
  width: 3px;
  background: #D4A028;
  border-radius: 2px;
  animation: voice-wave 0.8s ease-in-out infinite;
}
.voice-waveform .bar:nth-child(1) { animation-delay: 0s; height: 8px; }
.voice-waveform .bar:nth-child(2) { animation-delay: 0.1s; height: 16px; }
.voice-waveform .bar:nth-child(3) { animation-delay: 0.2s; height: 24px; }
.voice-waveform .bar:nth-child(4) { animation-delay: 0.3s; height: 16px; }
.voice-waveform .bar:nth-child(5) { animation-delay: 0.4s; height: 8px; }

@keyframes voice-wave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* Conversation area */
.voice-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  min-height: 60px;
}
.voice-msg {
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 12px;
  max-width: 90%;
  word-wrap: break-word;
}
.voice-msg.user {
  background: #2a2a2a;
  color: #ccc;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.voice-msg.assistant {
  background: #1e3a0e;
  color: #d4edda;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.voice-msg.info {
  background: #1f2937;
  color: #d1d5db;
  align-self: stretch;
  text-align: center;
  font-size: 12px;
  border: 1px dashed #4b5563;
  margin: 6px 4px;
}
.voice-msg.error {
  background: #3b1010;
  color: #fca5a5;
  align-self: center;
  font-size: 12px;
}

/* Text input fallback */
.voice-input-row {
  padding: 8px 12px;
  border-top: 1px solid #333;
  display: flex;
  gap: 8px;
}
.voice-input-row input {
  flex: 1;
  background: #2a2a2a;
  border: 1px solid #444;
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
}
.voice-input-row input:focus { border-color: #D4A028; }
.voice-input-row input::placeholder { color: #666; }
.voice-input-row button {
  background: #D4A028;
  border: none;
  color: #1a1a1a;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.voice-input-row button:hover { background: #c4901e; }

/* Quick action chips */
.voice-chips {
  padding: 6px 12px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.voice-chip {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #aaa;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.voice-chip:hover { border-color: #D4A028; color: #D4A028; }

/* Mobile adjustments */
@media (max-width: 640px) {
  .voice-panel { width: calc(100vw - 2rem); right: 1rem; left: 1rem; }
  .voice-fab { bottom: 4rem; right: 1rem; }
  .voice-panel { bottom: 7rem; }
}
