/**
 * AI Chatbot Widget Styles
 * 
 * @package AI\Chatbot
 */

/* CSS Variables */
:root {
  --ai-bg: #0b1b2b;
  --ai-primary: #b62025;
  --ai-primary-600: #9a1a1f;
  --ai-text: #0f172a;
  --ai-muted: #64748b;
  --ai-surface: #ffffff;
  --ai-bot: #f1f5f9;
  --ai-bot-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  --ai-surface-overlay: rgba(255, 255, 255, 0.95);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(2, 6, 23, .12);
  --shadow-elevated: 0 20px 60px rgba(2, 6, 23, .18);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --ai-bg: #0b1220;
    --ai-surface: #0f172a;
    --ai-text: #e2e8f0;
    --ai-bot: #141c2c;
    --ai-bot-gradient: linear-gradient(135deg, #1a2332 0%, #141c2c 100%);
    --ai-surface-overlay: rgba(15, 23, 42, 0.95);
    --ai-muted: #94a3b8;
  }
}

/* Root Container */
#ai-chatbot-root {
  position: fixed;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-chatbot-root.ai-position-bottom-right {
  right: 24px;
  bottom: 24px;
}

#ai-chatbot-root.ai-position-bottom-left {
  left: 24px;
  bottom: 24px;
}

/* Launcher Button */
.ai-launcher {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-600) 100%);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
  border: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  will-change: transform, box-shadow;
}

.ai-launcher:hover {
  background: linear-gradient(135deg, var(--ai-primary-600) 0%, #7a1519 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

.ai-launcher:focus-visible {
  outline: 3px solid var(--ai-primary);
  outline-offset: 3px;
}

.ai-launcher svg {
  flex-shrink: 0;
}

.ai-launcher-text {
  white-space: nowrap;
}

.ai-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* Widget Container */
.ai-widget {
  position: fixed;
  width: 450px;
  height: 650px;
  max-height: 85vh;
  background: var(--ai-surface);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--ai-text);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: none;
  flex-direction: column;
  animation: ai-slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity;
}

.ai-widget[style*="display: flex"] {
  display: flex !important;
}

@media (prefers-color-scheme: dark) {
  .ai-widget {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.1);
  }
}

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

.ai-position-bottom-right .ai-widget {
  right: 24px;
  bottom: 100px;
}

.ai-position-bottom-left .ai-widget {
  left: 24px;
  bottom: 100px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .ai-widget,
  .ai-launcher {
    animation: none;
    transition: none;
  }
}

/* Header */
.ai-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-600) 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(182, 32, 37, 0.15);
  position: relative;
  flex-shrink: 0;
}

.ai-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-avatar svg {
  width: 22px;
  height: 22px;
}

.ai-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.ai-header-info {
  flex: 1;
  min-width: 0;
}

.ai-header-info h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.ai-subline {
  margin: 3px 0 0;
  font-size: 12px;
  opacity: 0.9;
  font-weight: 400;
  letter-spacing: 0;
}

.ai-header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.ai-reload,
.ai-close {
  background: rgba(255, 255, 255, 0.2);
  border: 0;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.ai-reload:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.ai-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.ai-reload:active {
  transform: rotate(180deg) scale(0.95);
}

.ai-reload:focus-visible,
.ai-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.ai-reload svg,
.ai-close svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

/* Body / Messages */
.ai-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  min-height: 0;
  background: #f8fafc;
}

@media (prefers-color-scheme: dark) {
  .ai-body {
    background: #0a0f1a;
  }
}

.ai-body::-webkit-scrollbar {
  width: 6px;
}

.ai-body::-webkit-scrollbar-track {
  background: transparent;
}

.ai-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.ai-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Message Bubbles */
.ai-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  margin: 8px 0;
  line-height: 1.5;
  font-size: 14.5px;
  word-wrap: break-word;
  animation: ai-fade-in 0.2s ease-out;
  position: relative;
}

@keyframes ai-fade-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-bubble.bot {
  background: #ffffff;
  color: var(--ai-text);
  border-top-left-radius: 6px;
  align-self: flex-start;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
}

@media (prefers-color-scheme: dark) {
  .ai-bubble.bot {
    background: #141c2c;
    border-color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }
}

.ai-bubble.user {
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-600) 100%);
  color: #fff;
  margin-left: auto;
  border-top-right-radius: 6px;
  align-self: flex-end;
  box-shadow: 0 2px 10px rgba(182, 32, 37, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Speaker Button in Bot Messages */
.ai-speaker-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.05);
  border: 0;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s;
  color: var(--ai-muted);
}

.ai-bubble.bot:hover .ai-speaker-btn {
  opacity: 1;
}

.ai-speaker-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--ai-text);
  transform: scale(1.1);
}

.ai-speaker-btn:focus-visible {
  opacity: 1;
  outline: 2px solid var(--ai-primary);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .ai-speaker-btn {
    background: rgba(255, 255, 255, 0.05);
  }
  .ai-speaker-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* Quick Replies */
.ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}

.ai-chip {
  background: #e2e8f0;
  color: var(--ai-text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ai-chip:hover {
  background: #cbd5e1;
  transform: translateY(-1px);
}

.ai-chip:focus-visible {
  outline: 2px solid var(--ai-primary);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .ai-chip {
    background: #1e293b;
    color: #e2e8f0;
  }
  .ai-chip:hover {
    background: #334155;
  }
}

/* Typing Indicator */
.ai-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: var(--ai-bot-gradient);
  border-radius: var(--radius);
  border-top-left-radius: 4px;
  max-width: fit-content;
  margin: 10px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ai-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ai-muted);
  animation: ai-typing 1.2s ease-in-out infinite;
}

.ai-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes ai-typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

/* Footer / Input */
.ai-footer {
  border-top: 1px solid #e5e7eb;
  background: var(--ai-surface);
  flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
  .ai-footer {
    border-top-color: #1e293b;
  }
}

.ai-input-form {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px 20px;
}

.ai-input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  padding: 11px 18px;
  font-size: 14.5px;
  color: var(--ai-text);
  background: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
}

.ai-input:hover {
  border-color: #cbd5e1;
}

.ai-input:focus {
  border-color: var(--ai-primary);
  background: var(--ai-surface);
  box-shadow: 0 0 0 3px rgba(182, 32, 37, 0.1);
}

@media (prefers-color-scheme: dark) {
  .ai-input {
    border-color: #334155;
    background: #1e293b;
  }
  .ai-input:hover {
    border-color: #475569;
  }
  .ai-input:focus {
    background: #0f172a;
  }
}

.ai-send {
  border: 0;
  padding: 11px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-600) 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(182, 32, 37, 0.25);
  will-change: transform;
}

.ai-send:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--ai-primary-600) 0%, #7a1519 100%);
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(182, 32, 37, 0.35);
}

.ai-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.ai-send:focus-visible {
  outline: 2px solid var(--ai-primary);
  outline-offset: 2px;
}

/* Voice Button */
.ai-voice-btn {
  border: 0;
  padding: 11px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--ai-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
  will-change: transform;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.ai-voice-btn:hover:not(:disabled) {
  background: #e2e8f0;
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-voice-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.ai-voice-btn:focus-visible {
  outline: 2px solid var(--ai-primary);
  outline-offset: 2px;
}

.ai-voice-btn.listening {
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-600) 100%);
  color: #fff;
  animation: ai-voice-pulse 1.5s ease-in-out infinite;
}

@keyframes ai-voice-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.ai-voice-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--ai-primary);
  opacity: 0;
  pointer-events: none;
}

.ai-voice-btn.listening .ai-voice-pulse {
  animation: ai-pulse-ring 1.5s ease-out infinite;
}

@keyframes ai-pulse-ring {
  0% {
    transform: scale(0.9);
    opacity: 1;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@media (prefers-color-scheme: dark) {
  .ai-voice-btn {
    background: #1e293b;
    color: #e2e8f0;
  }
  .ai-voice-btn:hover:not(:disabled) {
    background: #334155;
  }
}

/* CTA Buttons in Messages */
.ai-cta {
  display: inline-block;
  margin-top: 8px;
  background: #16a34a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: background 0.2s;
}

.ai-cta:hover {
  background: #15803d;
}

/* Error Toast */
.ai-error {
  background: #fef2f2;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 12px;
  margin: 10px 0;
  font-size: 13px;
  border: 1px solid #fee2e2;
}

@media (prefers-color-scheme: dark) {
  .ai-error {
    background: #450a0a;
    color: #fca5a5;
    border-color: #7f1d1d;
  }
}

/* Lead Form */
.ai-lead-form {
  background: var(--ai-bot-gradient);
  padding: 14px;
  border-radius: var(--radius);
  margin: 10px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ai-lead-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin: 6px 0;
  font-size: 14px;
  background: var(--ai-surface);
  color: var(--ai-text);
}

.ai-lead-form label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  margin: 10px 0 6px;
  cursor: pointer;
}

.ai-lead-form input[type="checkbox"] {
  width: auto;
  margin: 2px 0 0;
}

.ai-lead-form button {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-600) 100%);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(182, 32, 37, 0.2);
}

.ai-lead-form button:hover {
  background: linear-gradient(135deg, var(--ai-primary-600) 0%, #7a1519 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(182, 32, 37, 0.3);
}

/* Mobile Responsive */
@media (max-width: 480px) {
  #ai-chatbot-root.ai-position-bottom-right,
  #ai-chatbot-root.ai-position-bottom-left {
    right: 0;
    left: 0;
    bottom: 0;
  }
  
  .ai-launcher {
    margin: 0 auto;
    display: flex;
    width: fit-content;
    padding: 18px 32px;
    font-size: 18px;
  }
  
  .ai-widget {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    z-index: 999999;
    display: flex;
    flex-direction: column;
  }
  
  .ai-header {
    border-radius: 0;
    flex-shrink: 0;
  }
  
  .ai-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 20px;
  }
  
  .ai-footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: var(--ai-surface);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  
  .ai-input-form {
    padding: 14px;
  }
  
  .ai-input {
    padding: 12px 18px;
    font-size: 16px;
    min-height: 44px;
  }
  
  .ai-send,
  .ai-voice-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }
  
  .ai-speaker-btn {
    opacity: 1;
  }
  
  .ai-chip {
    padding: 12px 18px;
    font-size: 15px;
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  
  .ai-branding {
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom, 8px);
  }
}

/* Branding Footer */
.ai-branding {
  padding: 12px 20px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
  flex-shrink: 0;
}

.ai-branding a {
  color: var(--ai-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-block;
}

.ai-branding a:hover {
  opacity: 0.8;
}

@media (prefers-color-scheme: dark) {
  .ai-branding {
    background: #0a0f1a;
    border-top-color: #1e293b;
    color: #64748b;
  }
}

/* Focus Visible - Global */
*:focus-visible {
  outline: 3px solid var(--ai-primary);
  outline-offset: 2px;
}

/* Voice Modal */
.ai-voice-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999999;
  animation: ai-fade-in 0.3s ease;
}

.ai-voice-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-voice-content {
  background: var(--ai-surface);
  border-radius: 32px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  position: relative;
  animation: ai-slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-voice-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.1);
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ai-text);
  transition: all 0.2s;
  z-index: 10;
}

.ai-voice-close:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
}

.ai-voice-inner {
  padding: 60px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.ai-voice-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--ai-text);
  margin: 0;
}

/* Voice Visualizer */
.ai-voice-visualizer {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-voice-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-600) 100%);
  box-shadow: 0 10px 40px rgba(182, 32, 37, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.ai-voice-circle.active {
  animation: ai-voice-pulse-circle 1.5s ease-in-out infinite;
}

@keyframes ai-voice-pulse-circle {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 10px 40px rgba(182, 32, 37, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 15px 60px rgba(182, 32, 37, 0.5);
  }
}

.ai-voice-waves {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-voice-wave {
  position: absolute;
  border: 3px solid var(--ai-primary);
  border-radius: 50%;
  opacity: 0;
}

.ai-voice-waves.active .ai-voice-wave {
  animation: ai-voice-ripple 2s ease-out infinite;
}

.ai-voice-waves.active .ai-voice-wave:nth-child(2) {
  animation-delay: 0.5s;
}

.ai-voice-waves.active .ai-voice-wave:nth-child(3) {
  animation-delay: 1s;
}

@keyframes ai-voice-ripple {
  0% {
    width: 140px;
    height: 140px;
    opacity: 0.8;
  }
  100% {
    width: 240px;
    height: 240px;
    opacity: 0;
  }
}

/* Voice Status */
.ai-voice-status {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-voice-status p {
  font-size: 18px;
  color: var(--ai-muted);
  margin: 0;
  font-weight: 500;
}

/* Voice Mic Button */
.ai-voice-mic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: var(--ai-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.ai-voice-mic:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
}

.ai-voice-mic.listening {
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-600) 100%);
  color: #fff;
  animation: ai-voice-pulse 1.5s ease-in-out infinite;
}

.ai-voice-mic.speaking {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
  animation: ai-voice-pulse 1.5s ease-in-out infinite;
}

/* Voice Transcript */
.ai-voice-transcript {
  width: 100%;
  max-width: 500px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-voice-user,
.ai-voice-bot {
  padding: 16px 20px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
  min-height: 50px;
  display: flex;
  align-items: center;
}

.ai-voice-user {
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-600) 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(182, 32, 37, 0.2);
}

.ai-voice-user:empty {
  display: none;
}

.ai-voice-bot {
  background: var(--ai-bot-gradient);
  color: var(--ai-text);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.ai-voice-bot:empty {
  display: none;
}

/* Dark Mode for Voice Modal */
@media (prefers-color-scheme: dark) {
  .ai-voice-modal {
    background: rgba(0, 0, 0, 0.92);
  }
  
  .ai-voice-close {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
  }
  
  .ai-voice-close:hover {
    background: rgba(255, 255, 255, 0.15);
  }
  
  .ai-voice-mic {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #e2e8f0;
  }
}

/* Mobile Responsive for Voice Modal */
@media (max-width: 768px) {
  .ai-voice-content {
    width: 95%;
    max-height: 95vh;
    border-radius: 24px;
  }
  
  .ai-voice-inner {
    padding: 40px 24px;
    gap: 24px;
  }
  
  .ai-voice-title {
    font-size: 24px;
  }
  
  .ai-voice-visualizer {
    width: 160px;
    height: 160px;
  }
  
  .ai-voice-circle {
    width: 120px;
    height: 120px;
  }
  
  .ai-voice-mic {
    width: 70px;
    height: 70px;
  }
  
  .ai-voice-status p {
    font-size: 16px;
  }
  
  .ai-voice-transcript {
    min-height: 100px;
  }
  
  .ai-voice-user,
  .ai-voice-bot {
    padding: 14px 18px;
    font-size: 15px;
  }
}
