:root {
  --primary-color: #007bff;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

body {
  font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  flex-direction: column;
}

.auth-screen {
  flex: 1;
  display: flex;
  min-height: 0;
}

.auth-screen-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
  padding: 2rem;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.auth-screen-branding {
  text-align: center;
  color: #fff;
}

.auth-logo {
  font-size: 80px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.auth-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.auth-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  font-weight: 400;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
  max-width: 280px;
  margin: 0 auto;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.auth-feature i {
  font-size: 1.25rem;
}

.auth-feature span {
  font-size: 0.95rem;
}

.auth-screen-right {
  width: 480px;
  min-width: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 2rem;
}

.auth-form-container {
  width: 100%;
  max-width: 360px;
}

.auth-form-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: #fff;
}

.auth-form-icon i {
  font-size: 28px;
}

.auth-form-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1a1a2e;
}

.auth-form-subtitle {
  color: #6c757d;
  margin-bottom: 2rem;
}

@media (max-width: 991.98px) {
  .auth-screen {
    flex-direction: column;
  }

  .auth-screen-left {
    flex: 0 0 auto;
    padding: 2rem 1rem;
  }

  .auth-logo {
    font-size: 48px;
  }

  .auth-title {
    font-size: 1.75rem;
  }

  .auth-features {
    display: none;
  }

  .auth-screen-right {
    flex: 1;
    width: 100%;
    min-width: unset;
  }
}

.app-navbar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none !important;
  padding-top: calc(0.5rem + env(safe-area-inset-top)) !important;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
}

.navbar-brand {
  font-weight: 600;
  color: #fff !important;
}

.navbar-subtitle {
  font-size: 0.75rem;
  opacity: 0.8;
  color: #fff;
}

.bot-avatar-nav {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.status-badge-nav {
  font-size: 0.7rem;
  padding: 0.35em 0.65em;
  background: rgba(255, 255, 255, 0.2) !important;
  color: #fff;
}

.status-badge-nav.bg-success {
  background: rgba(25, 135, 84, 0.8) !important;
}

.status-badge-nav.bg-warning {
  background: rgba(255, 193, 7, 0.8) !important;
  color: #000;
}

.status-badge-nav.bg-danger {
  background: rgba(220, 53, 69, 0.8) !important;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.2s;
}

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

#userMenu .btn:hover .user-avatar {
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
}

#userMenu .btn:hover .bi-chevron-down {
  color: rgba(255, 255, 255, 0.8) !important;
}

#userMenu .dropdown-menu {
  min-width: 240px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: none;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#userMenu .dropdown-menu .dropdown-divider {
  margin: 0.5rem 0;
  border-color: #f0f0f0;
}

#userMenu .dropdown-menu .dropdown-item {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  transition: all 0.15s;
}

#userMenu .dropdown-menu .dropdown-item:hover {
  background: #f8f9fc;
}

#userMenu .dropdown-menu .dropdown-item.text-danger:hover {
  background: #fef2f2;
  color: #dc2626 !important;
}

.user-menu-header {
  padding: 1rem;
  background: linear-gradient(135deg, #f8f9fc 0%, #fff 100%);
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 0.5rem;
}

.user-menu-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  overflow: hidden;
}

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

.user-menu-info {
  flex: 1;
  min-width: 0;
}

.user-menu-name {
  font-weight: 600;
  color: #1a1a2e;
  font-size: 0.95rem;
}

.user-menu-email {
  color: #6c757d;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-wrapper {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
  width: 100%;
  max-width: 100%;
}

.sidebar {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  background: #f8f9fc;
  border-right: 1px solid #e9ecef;
}

.sidebar .p-3 {
  background: #fff;
}

.btn-new-chat {
  background: transparent;
  border: 2px solid #6366f1;
  color: #6366f1;
  font-weight: 500;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  transition: all 0.2s;
}

.btn-new-chat:hover {
  background: #6366f1;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-new-chat:disabled {
  background: transparent;
  border-color: #ccc;
  color: #999;
  box-shadow: none;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 12px 8px;
}

.chat-list::-webkit-scrollbar {
  display: none;
}

.chat-item.list-group-item {
  transition: all 0.2s;
  padding-right: 2.5rem !important;
  position: relative;
  border-radius: 10px !important;
  margin-bottom: 2px;
  border: none !important;
  background: transparent;
}

.chat-list.list-group-flush > .chat-item.list-group-item:first-child,
.chat-list.list-group-flush > .chat-item.list-group-item:last-child,
.chat-item.list-group-item.active {
  border-radius: 10px !important;
}

.chat-item.active {
  background: rgba(99, 102, 241, 0.1);
  border-left: 3px solid #6366f1 !important;
}

.chat-item::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: #e9ecef;
}

.chat-item:last-child::after {
  display: none;
}

.chat-item:first-child {
  margin-top: 2px;
}

.chat-item:last-child {
  margin-bottom: 2px;
}

.chat-item .flex-grow-1 {
  transition: -webkit-mask-image 0.2s, mask-image 0.2s;
}

.chat-item:hover .flex-grow-1 {
  -webkit-mask-image: linear-gradient(to right, black 70%, transparent 95%);
  mask-image: linear-gradient(to right, black 70%, transparent 95%);
}

.chat-item:hover {
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-item-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff9800;
  display: none;
}

.chat-item-indicator.active {
  display: block;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chat-item-delete {
  opacity: 0;
  transition: opacity 0.2s;
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}

.chat-item:hover .chat-item-delete {
  opacity: 1;
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: #f8f9fc;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 1.5rem;
}

.message {
  max-width: 75%;
  margin-bottom: 1rem;
}

.message.sent {
  margin-left: auto;
}

.message .card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.message.sent .card {
  background: #6366f1;
  border-bottom-right-radius: 4px;
}

.message.received .card {
  background: #fff;
  border-bottom-left-radius: 4px;
}

.message .content {
  font-size: 0.95rem;
  line-height: 1.5;
}

.message .content p {
  margin-bottom: 0.5rem;
}

.message .content p:last-child {
  margin-bottom: 0;
}

.message .content ul,
.message .content ol {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.message .content li {
  margin: 0.25rem 0;
}

.message .content table {
  font-size: 0.8rem;
}

.message .content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0.5rem 0;
  cursor: pointer;
}

.message .content img:hover {
  opacity: 0.9;
}

.message .content code {
  background: rgba(0, 0, 0, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.message.sent .content code {
  background: rgba(255, 255, 255, 0.2);
}

.message .content pre {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin: 0.5rem 0;
}

.message .content pre code {
  background: none;
  padding: 0;
  color: #d4d4d4;
}

.message-time {
  font-size: 0.7rem;
  opacity: 0.6;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6c757d;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.chat-input-wrapper {
  padding: 1rem 1.5rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #e9ecef;
}

.chat-input-wrapper .input-group {
  background: #f8f9fc;
  border-radius: 24px;
  padding: 0.25rem;
  border: 2px solid #e9ecef;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-wrapper .input-group:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.chat-input-wrapper .form-control {
  border: none;
  background: transparent;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-size: 16px;
  touch-action: manipulation;
}

.chat-input-wrapper .form-control:focus {
  box-shadow: none;
}

.chat-input-wrapper .btn {
  border-radius: 20px;
  padding: 0.5rem 1.25rem;
  font-weight: 500;
}

.chat-input-wrapper .btn-primary {
  background: #6366f1;
  border: none;
}

.chat-input-wrapper .btn-primary:hover {
  background: #5558e3;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.chat-input-wrapper .btn-danger {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
  border: none;
}

.log-footer {
  height: 200px;
  min-height: 40px;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: height 0.2s ease;
  background: #1e1e2e;
  border-top: none;
}

.log-footer.collapsed {
  height: 40px !important;
}

.log-footer-resize-handle {
  height: 4px;
  background: #2d2d3d;
  cursor: ns-resize;
  transition: background 0.2s;
}

.log-footer-resize-handle:hover {
  background: #6366f1;
}

.log-footer.collapsed .log-footer-resize-handle {
  display: none;
}

.log-footer-header {
  cursor: pointer;
  flex-shrink: 0;
  background: #1e1e2e;
  border-bottom-color: #2d2d3d !important;
}

.log-footer.collapsed .log-footer-header {
  border-bottom: none !important;
}

.log-toggle {
  transition: transform 0.2s;
}

.log-footer.collapsed .log-toggle {
  transform: rotate(180deg);
}

.log-footer-content {
  flex: 1;
  overflow-y: auto;
}

.log-footer.collapsed .log-footer-content {
  display: none;
}

.log-panel {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.75rem;
}

.log-entry {
  padding: 0.2rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-entry.info { color: #64b5f6; }
.log-entry.error { color: #ef5350; }
.log-entry.event { color: #66bb6a; }
.log-entry.thinking { color: #ffd54f; }

.log-time {
  color: #888;
  margin-right: 0.25rem;
}

@media (max-width: 991.98px) {
  .sidebar {
    display: none;
  }

  .log-footer {
    display: none !important;
  }

  .message {
    max-width: 90%;
  }

  .app-navbar .container-fluid {
    flex-wrap: nowrap;
    padding: 0 0.75rem !important;
    max-width: 100%;
  }

  .app-navbar .container-fluid > .d-flex {
    gap: 0.5rem !important;
  }

  .app-navbar .navbar-brand {
    font-size: 0.9rem;
  }

  .app-navbar .navbar-subtitle {
    display: none;
  }

  .bot-avatar-nav {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 16px;
  }

  .status-badge-nav {
    display: none !important;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 12px;
  }

  #userMenu .dropdown-toggle::after {
    display: none;
  }

  #userMenu .dropdown-menu {
    display: none !important;
  }

  #userMenuOffcanvas {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

.offcanvas-body .chat-list {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.btn-new-chat.highlight {
  animation: highlight-pulse 1.5s ease-in-out infinite;
}

@keyframes highlight-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(13, 110, 253, 0); }
}

.modal-content {
  border-radius: 12px;
}

.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.confirm-icon i {
  font-size: 28px;
  color: #dc3545;
}

.access-denied-alert {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 1px solid #fca5a5;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  position: relative;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.access-denied-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.access-denied-icon i {
  font-size: 18px;
  color: #fff;
}

.access-denied-content {
  flex: 1;
  min-width: 0;
}

.access-denied-title {
  font-weight: 600;
  color: #991b1b;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.access-denied-message {
  color: #b91c1c;
  font-size: 0.85rem;
  line-height: 1.4;
}

.access-denied-alert .btn-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.25rem;
  opacity: 0.6;
}

.access-denied-alert .btn-close:hover {
  opacity: 1;
}

.auth-code-input {
  font-size: 1.5rem;
  letter-spacing: 0.5rem;
  font-weight: 600;
}

.auth-code-input::placeholder {
  letter-spacing: 0.3rem;
  color: #ccc;
}

.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  animation: spinner 0.75s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

.btn-voice {
  background: transparent;
  border: none;
  color: #6c757d;
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  transition: all 0.2s;
}

.btn-voice:hover {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}

.btn-voice.recording {
  color: #dc3545;
  animation: voice-pulse 1s ease-in-out infinite;
}

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

.btn-voice.processing {
  color: #ffc107;
  pointer-events: none;
}

.voice-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
  background: #f8f9fc;
  border-radius: 12px;
  font-size: 0.85rem;
}

.voice-status.recording {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.2);
}

.voice-status.processing {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.2);
}

.voice-status.error {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.voice-status-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.voice-status-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dc3545;
}

.voice-status.recording .voice-status-icon {
  animation: voice-icon-pulse 1s ease-in-out infinite;
}

@keyframes voice-icon-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.voice-status.processing .voice-status-icon {
  background: #ffc107;
  animation: spinner 0.75s linear infinite;
  border: 2px solid #ffc107;
  border-right-color: transparent;
}

.voice-status.error .voice-status-icon {
  background: #dc3545;
  animation: none;
}

.voice-status-text {
  color: #495057;
}

.voice-status-time {
  color: #6c757d;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.8rem;
}

/* Voice Recording Modal */
.voice-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-modal.d-none {
  display: none !important;
}

.voice-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: voiceModalFadeIn 0.2s ease-out;
}

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

.voice-modal-content {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 2.5rem 3rem;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: voiceModalSlideIn 0.3s ease-out;
  min-width: 280px;
}

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

.voice-modal-progress {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
}

.voice-progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.voice-progress-bg {
  fill: none;
  stroke: #e9ecef;
  stroke-width: 6;
}

.voice-progress-bar {
  fill: none;
  stroke: #6366f1;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.3s ease;
}

.voice-modal-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  animation: voiceMicPulse 1.5s ease-in-out infinite;
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

@keyframes voiceMicPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.6);
  }
}

.voice-modal-timer {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a2e;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

.voice-modal-status {
  font-size: 0.95rem;
  color: #dc3545;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.voice-modal-status.processing {
  color: #ffc107;
}

.voice-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.voice-modal-buttons .btn {
  min-width: 120px;
  padding: 0.6rem 1.25rem;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.voice-modal-buttons .btn-outline-secondary {
  border-color: #dee2e6;
  color: #6c757d;
}

.voice-modal-buttons .btn-outline-secondary:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  color: #495057;
}

.voice-modal-buttons .btn-primary {
  background: #6366f1;
  border: none;
}

.voice-modal-buttons .btn-primary:hover {
  background: #5558e3;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.voice-modal-buttons .btn-primary:disabled {
  background: #a5a8fc;
  cursor: not-allowed;
}

/* Processing state */
.voice-modal.processing .voice-modal-icon {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
  animation: voiceProcessingSpin 1s linear infinite;
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.voice-modal.processing .voice-modal-icon i::before {
  content: "\F3E5";
}

@keyframes voiceProcessingSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Splash Screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
  transition: opacity 0.4s ease-out;
}

.splash-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.splash-screen.d-none {
  display: none !important;
}

.splash-content {
  text-align: center;
  color: #fff;
}

.splash-logo {
  font-size: 100px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
  animation: splash-logo-pulse 2s ease-in-out infinite;
}

@keyframes splash-logo-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.splash-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 1rem 0 2rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.splash-loader {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: splash-spin 0.8s linear infinite;
}

@keyframes splash-spin {
  to { transform: rotate(360deg); }
}

/* Splash Message (for connection errors) */
.splash-message {
  margin-top: 1.5rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.splash-message-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.splash-message-text i {
  font-size: 1.25rem;
}

.splash-message-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: splash-spin 0.8s linear infinite;
}

.splash-message.d-none {
  display: none !important;
}

/* Connection Toast */
.connection-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding: 0;
  animation: toast-slide-down 0.3s ease-out;
}

.connection-toast.d-none {
  display: none !important;
}

.connection-toast.hiding {
  animation: toast-slide-up 0.3s ease-out forwards;
}

.connection-toast-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 100%;
  justify-content: center;
}

.connection-toast.restored .connection-toast-content {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

.connection-toast-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: splash-spin 0.8s linear infinite;
}

.connection-toast.restored .connection-toast-spinner {
  display: none;
}

.connection-toast.restored .connection-toast-content::before {
  content: "\F26B";
  font-family: "bootstrap-icons";
  font-size: 1rem;
}

@keyframes toast-slide-down {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toast-slide-up {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

/* Offline state for chat items */
.chat-item.disabled {
  pointer-events: none;
  opacity: 0.5;
}
