/* Ra'no AI Chat styles - Ultra Modern Premium Design v2 */
:root {
  --bg-light: #fafbfc;
  --bg-dark: #0a0e1a;
  --surface-light: #ffffff;
  --surface-dark: #151b2e;
  --border-light: #e1e7ef;
  --border-dark: #1f2937;
  --text-light: #1a1d29;
  --text-dark: #e8eaed;
  --text-muted-light: #5f6c7b;
  --text-muted-dark: #a0aec0;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --user-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --bot-gradient: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --glow: rgba(59, 130, 246, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --border: var(--border-dark);
    --text: var(--text-dark);
    --text-muted: var(--text-muted-dark);
    --user-bg: var(--user-bg-dark);
    --bot-bg: var(--bot-bg-dark);
    --shadow: var(--shadow-dark);
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: var(--bg-light);
    --surface: var(--surface-light);
    --border: var(--border-light);
    --text: var(--text-light);
    --text-muted: var(--text-muted-light);
    --user-bg: var(--user-bg-light);
    --bot-bg: var(--bot-bg-light);
    --shadow: var(--shadow-light);
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: "Söhne", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 30%,
      var(--accent-glow) 0%,
      transparent 60%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(139, 92, 246, 0.15) 0%,
      transparent 60%
    ),
    radial-gradient(
      circle at 50% 50%,
      rgba(236, 72, 153, 0.08) 0%,
      transparent 70%
    );
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.8;
  }
}

.app {
  max-width: 768px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}
.logo {
  font-weight: 700;
  font-size: 20px;
  background: var(--bot-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.5px;
}
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.header-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 18px;
  border: 1px solid var(--border);
}
.header-btn:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--glow);
}
.status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
}
.dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  padding-bottom: 180px; /* Space for composer */
  scroll-behavior: smooth;
}

.chat::-webkit-scrollbar {
  width: 6px;
}
.chat::-webkit-scrollbar-track {
  background: transparent;
}
.chat::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.chat::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
.message {
  width: 100%;
  padding: 16px 20px;
  position: relative;
  transition: all 0.2s ease;
}
.message:hover {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(59, 130, 246, 0.04),
    transparent
  );
}
.message.user {
  display: flex;
  justify-content: flex-end;
}
.message.bot {
  display: flex;
  justify-content: flex-start;
}

/* Message actions */
.message-actions {
  position: absolute;
  top: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 10;
}
.message.user .message-actions {
  left: 8px;
}
.message.bot .message-actions {
  right: 8px;
}
.message:hover .message-actions {
  opacity: 1;
}
.message-action {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}
.message-action:hover {
  background: var(--bot-gradient);
  color: white;
  transform: scale(1.15) translateY(-2px);
  box-shadow: 0 8px 20px var(--glow);
}
.message-action:active {
  transform: scale(0.95);
}
.message-content {
  max-width: 70%;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  position: relative;
}
.message.user .message-content {
  flex-direction: row-reverse;
}
.message .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  font-size: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.message .avatar:hover {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}
.message.user .avatar {
  background: var(--user-gradient);
}
.message.bot .avatar {
  background: var(--bot-gradient);
}

/* Typing indicator for bot avatar */
.message.bot.typing .avatar::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  bottom: -2px;
  right: -2px;
  border: 2px solid white;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.9);
  }
}
.message .bubble {
  max-width: 100%;
  padding: 18px 22px;
  border-radius: 20px;
  line-height: 1.7;
  font-size: 17px;
  white-space: pre-wrap;
  word-wrap: break-word;
  position: relative;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}
.message.user .bubble {
  background: linear-gradient(
    135deg,
    var(--surface) 0%,
    rgba(139, 92, 246, 0.05) 100%
  );
  color: var(--text);
  border: 2px solid var(--border);
  border-bottom-right-radius: 6px;
}
.message.bot .bubble {
  background: linear-gradient(
    135deg,
    var(--surface) 0%,
    rgba(59, 130, 246, 0.03) 100%
  );
  color: var(--text);
  border: 2px solid var(--border);
  border-bottom-left-radius: 6px;
}
.message .bubble:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  border-color: var(--accent);
}

/* Word highlighting for speech */
.word-highlight {
  transition: all 0.3s ease;
  display: inline;
}

.word-highlight.speaking-word {
  background: linear-gradient(
    120deg,
    var(--accent) 0%,
    rgba(59, 130, 246, 0.3) 100%
  );
  color: white;
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--glow);
  animation: wordPulse 0.6s ease;
}

.word-highlight.spoken-word {
  background: rgba(59, 130, 246, 0.1);
  padding: 1px 2px;
  border-radius: 2px;
  opacity: 0.7;
}

@keyframes wordPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Message timestamp */
.message-time {
  font-size: 11px;
  margin-top: 6px;
  opacity: 1;
  transition: opacity 0.2s ease;
}
.message.user .message-time {
  color: var(--text-muted);
  text-align: right;
}
.message.bot .message-time {
  color: var(--text-muted);
}
.message:hover .message-time {
  opacity: 1;
}

/* Message status indicators */
.message-status {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.message.user .message-status {
  justify-content: flex-end;
}

.status-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.status-sending {
  background: #f59e0b;
}
.status-sent {
  background: #10b981;
}
.status-error {
  background: #ef4444;
}

.bubble .small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

/* Markdown formatting styles */
.bubble h1,
.bubble h2,
.bubble h3,
.bubble h4,
.bubble h5,
.bubble h6 {
  margin: 20px 0 12px 0;
  font-weight: 600;
  line-height: 1.4;
}
.bubble h1 {
  font-size: 2em;
}
.bubble h2 {
  font-size: 1.7em;
}
.bubble h3 {
  font-size: 1.4em;
}
.bubble h4 {
  font-size: 1.2em;
}

.bubble p {
  margin: 12px 0;
  line-height: 1.7;
  font-size: 17px;
}
.bubble p:first-child {
  margin-top: 0;
}
.bubble p:last-child {
  margin-bottom: 0;
}

.bubble ul,
.bubble ol {
  margin: 16px 0;
  padding-left: 24px;
}
.bubble li {
  margin: 8px 0;
  line-height: 1.7;
  font-size: 17px;
}

.bubble blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--accent);
  background: rgba(16, 163, 127, 0.05);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

.bubble code {
  background: rgba(142, 150, 170, 0.15);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono",
    "Source Code Pro", monospace;
  font-size: 0.95em;
  color: #eb5757;
}

.bubble pre {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 20px 0;
  position: relative;
}
.bubble pre:hover .code-copy-btn {
  opacity: 1;
}
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  transition: all 0.2s ease;
  font-weight: 600;
}
.code-copy-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}
.bubble pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 0.875em;
  line-height: 1.6;
}

.bubble strong,
.bubble b {
  font-weight: 600;
}

.bubble em,
.bubble i {
  font-style: italic;
}

.bubble a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(16, 163, 127, 0.4);
  text-underline-offset: 2px;
}
.bubble a:hover {
  text-decoration-color: var(--accent);
}

.bubble table {
  border-collapse: collapse;
  margin: 20px 0;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.bubble th,
.bubble td {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  text-align: left;
}
.bubble th {
  background: var(--surface);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}
.bubble tr:last-child td {
  border-bottom: none;
}

.bubble hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
  opacity: 0.6;
}

.composer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
  z-index: 90;
}
.composer-inner {
  max-width: 768px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

/* New Voice Button Design */
.voice-btn-new {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border: none;
  background: var(--surface);
  color: var(--accent);
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 2px solid var(--border);
  overflow: hidden;
}

.voice-btn-new:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 8px 24px var(--glow);
}

.voice-btn-new.recording {
  background: var(--error);
  color: white;
  border-color: var(--error);
  animation: voicePulse 1.5s ease-in-out infinite;
}

@keyframes voicePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
  }
}

.voice-btn-new .mic-icon {
  width: 24px;
  height: 24px;
  transition: all 0.3s ease;
}

.voice-btn-new.recording .mic-icon {
  animation: micShake 0.5s ease-in-out infinite;
}

@keyframes micShake {
  0%,
  100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-3px);
  }
  75% {
    transform: translateY(3px);
  }
}

.voice-wave {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 3px;
}

.voice-btn-new.recording .voice-wave {
  display: flex;
}

.voice-wave span {
  width: 3px;
  height: 12px;
  background: white;
  border-radius: 2px;
  animation: waveAnimation 0.8s ease-in-out infinite;
}

.voice-wave span:nth-child(1) {
  animation-delay: 0s;
  height: 8px;
}
.voice-wave span:nth-child(2) {
  animation-delay: 0.1s;
}
.voice-wave span:nth-child(3) {
  animation-delay: 0.2s;
  height: 10px;
}

@keyframes waveAnimation {
  0%,
  100% {
    transform: scaleY(0.5);
  }
  50% {
    transform: scaleY(1.5);
  }
}

textarea {
  flex: 1;
  resize: none;
  min-height: 48px;
  max-height: 200px;
  border: 2px solid var(--border);
  outline: none;
  color: var(--text);
  background: var(--surface);
  border-radius: 24px;
  padding: 12px 20px;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  font-family: inherit;
}
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 0 0 4px var(--glow);
  transform: translateY(-1px);
}
textarea::placeholder {
  color: var(--text-muted);
}

button#send {
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  background: var(--bot-gradient);
  color: white;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px var(--glow);
}

button#send svg {
  width: 22px;
  height: 22px;
}

button#send:hover:not(:disabled) {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 24px var(--glow);
}
button#send:active:not(:disabled) {
  transform: scale(0.95);
}
button#send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Enhanced typing indicator */
.loader {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
}

.typing-dots {
  display: flex;
  gap: 6px;
}
.typing-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: typing 1.4s infinite ease-in-out;
  box-shadow: 0 2px 8px var(--glow);
}
.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}
.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.typing-text {
  font-size: 15px;
  color: var(--text-muted);
  margin-left: 8px;
  font-style: italic;
  font-weight: 500;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-12px) scale(1.2);
    opacity: 1;
  }
}

/* Message animations */
.message {
  animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.message.user {
  animation: messageSlideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes messageSlideInRight {
  from {
    opacity: 0;
    transform: translateX(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Notification animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Empty state */
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  color: var(--text-muted);
  font-size: 16px;
}
.chat-empty .icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}
.chat-empty .title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.chat-empty .subtitle {
  font-size: 14px;
  max-width: 300px;
  line-height: 1.5;
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal {
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 20px;
}

.modal-close:hover {
  background: #ef4444;
  color: white;
  transform: rotate(90deg);
}

.modal-body {
  color: var(--text);
}

.setting-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.setting-description {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.toggle-switch.active {
  background: var(--accent);
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.toggle-switch.active::after {
  transform: translateX(22px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Voice Recording Modal */
.voice-recording-modal {
  z-index: 1000;
}

.voice-modal-content {
  background: var(--surface);
  border-radius: 32px;
  padding: 40px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  animation: voiceModalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid var(--border);
}

@keyframes voiceModalSlideUp {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(40px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.voice-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.voice-modal-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  background: var(--bot-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.voice-visualizer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  margin: 24px 0;
}

.voice-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--bot-gradient);
  box-shadow: 0 8px 32px var(--glow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-circle.pulse {
  animation: voiceCirclePulse 2s ease-in-out infinite;
}

@keyframes voiceCirclePulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 32px var(--glow);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 12px 48px var(--accent-glow);
  }
}

.voice-bars {
  position: absolute;
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.voice-bars span {
  width: 4px;
  background: white;
  border-radius: 4px;
  animation: voiceBarAnimation 0.6s ease-in-out infinite;
}

.voice-bars span:nth-child(1) {
  height: 20px;
  animation-delay: 0s;
}
.voice-bars span:nth-child(2) {
  height: 35px;
  animation-delay: 0.1s;
}
.voice-bars span:nth-child(3) {
  height: 45px;
  animation-delay: 0.2s;
}
.voice-bars span:nth-child(4) {
  height: 30px;
  animation-delay: 0.3s;
}
.voice-bars span:nth-child(5) {
  height: 50px;
  animation-delay: 0.4s;
}
.voice-bars span:nth-child(6) {
  height: 35px;
  animation-delay: 0.5s;
}
.voice-bars span:nth-child(7) {
  height: 40px;
  animation-delay: 0.6s;
}
.voice-bars span:nth-child(8) {
  height: 25px;
  animation-delay: 0.7s;
}
.voice-bars span:nth-child(9) {
  height: 35px;
  animation-delay: 0.8s;
}
.voice-bars span:nth-child(10) {
  height: 20px;
  animation-delay: 0.9s;
}

@keyframes voiceBarAnimation {
  0%,
  100% {
    transform: scaleY(0.4);
    opacity: 0.6;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.voice-status {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0;
}

.voice-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.voice-cancel,
.voice-done {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.voice-cancel {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
}

.voice-cancel:hover {
  background: var(--error);
  color: white;
  border-color: var(--error);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.voice-done {
  background: var(--bot-gradient);
  color: white;
}

.voice-done:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--glow);
}

/* Scroll to bottom button */
.scroll-to-bottom {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: var(--bot-gradient);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--glow);
  transition: all 0.3s ease;
  z-index: 99;
  font-size: 20px;
  animation: bounceIn 0.5s;
}

.scroll-to-bottom.visible {
  display: flex;
}

.scroll-to-bottom:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 6px 28px var(--glow);
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(20px);
  }
  50% {
    transform: scale(1.05) translateY(-5px);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .app {
    max-width: 100%;
  }
  .app-header {
    padding: 12px 16px;
  }
  .message {
    padding: 12px 16px;
  }
  .message-content {
    max-width: 85%;
    gap: 10px;
  }
  .message .avatar {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .message .bubble {
    font-size: 17px;
    padding: 16px 20px;
  }
  .message-actions {
    display: none; /* Hide actions on mobile */
  }
  .composer {
    padding: 12px 16px;
  }
  .chat {
    padding-bottom: 120px;
  }
  .composer-inner {
    gap: 8px;
  }
  .voice-btn-new,
  button#send {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
  textarea {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 10px 16px;
    min-height: 44px;
  }
  .modal {
    max-width: 95%;
  }
  .scroll-to-bottom {
    bottom: 90px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
  .voice-modal-content {
    padding: 28px;
  }
  .voice-circle {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 10px 12px;
  }
  .logo {
    font-size: 16px;
  }
  .message {
    padding: 16px 12px;
  }
  .composer {
    padding: 10px 12px;
  }
  .composer-inner {
    gap: 6px;
  }
  .voice-btn-new,
  button#send {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  .chat {
    padding-bottom: 100px;
  }
  .header-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .header-actions {
    gap: 6px;
  }
  .status {
    display: none;
  }
  .voice-modal-content {
    padding: 24px;
  }
}
