/* RESET & GLOBAL */
/* Smooth Scroll untuk seluruh halaman */

html {
  scroll-behavior: smooth;
}
html, body {
height: 100%;
overflow-x: hidden;
width: 100%;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;

}
  
body {
  font-family: "Segoe UI", sans-serif;
  min-height: unset;
  background-color: #f4f7f9; /* serasi dengan palet logo */
  color: #000;
  transition: background-color 0.3s ease, color 0.3s ease;
}
body.dark {
  background-color: #0b1220;
  color: #e2e8f0;
  background-image: radial-gradient(circle at 20% 20%, rgba(34,211,238,0.08), transparent 35%), radial-gradient(circle at 80% 0%, rgba(10,47,106,0.18), transparent 32%), radial-gradient(circle at 50% 80%, rgba(56,189,248,0.12), transparent 28%);
}

.chat-box,
.sidebar {
  transition: background-color 0.3s ease, color 0.3s ease;
}
/* SIDEBAR */
.sidebar {
  background-color: #eef8fb; /* sedikit lebih pekat agar pembatas terlihat */
  color: #1b4d63;
  padding: 20px 12px;
  width: 260px;
  min-width: 240px;
  height: 100vh; /* ✅ isi penuh layar */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: width 0.3s ease;
  overflow-x: hidden;
}
/* HEADER SIDEBAR */
.sidebar-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  padding-top: 15px;
}

/* Grup Logo dan Tulisan */
.sidebar-logo-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Logo */
.sidebar-logo {
  width: 40px;
  height: auto;
}
.sidebar-user {
  text-align: center;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.sidebar-user h3 {
  font-size: 16px;
  font-weight: bold;
  color: #1b4d63;
}

.sidebar-user p {
  font-size: 12px;
  color: #517382;
}


.sidebar.collapsed {
  width: 90px;
  min-width: 90px;
  padding: 20px 8px;
  overflow-x: hidden;
}

.sidebar.collapsed .dark-mode-label {
  display: none;
}

.sidebar.collapsed .dark-mode-toggle {
  justify-content: center;
}

.sidebar .logo {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.sidebar .logo img {
  width: 32px;
  height: auto;
}

.sidebar.collapsed .sidebar-toggle {
  width: 36px;
  height: 36px;
  padding: 6px;
}

.sidebar-toggle i {
  font-size: 20px;
}

.sidebar.collapsed .sidebar-toggle i {
  font-size: 18px;
}

.sidebar.collapsed .logo span {
  display: none;
}

.sidebar .profile {
  text-align: center;
  margin-bottom: 24px;
}

.sidebar .profile h3 {
  font-size: 16px;
  margin-bottom: 4px;
  font-weight: bold;
}

.sidebar .profile p {
  font-size: 13px;
  color: #aaa;
}

.sidebar .section-title {
  font-size: 12px;
  font-weight: bold;
  color: #878787;
  margin-top: 20px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sidebar .btn {
  background-color: transparent;
  color: #163b4c; /* teks/icon lebih gelap agar jelas */
  padding: 3px 10px 5px 18px; /* kiri ditambah: padding-left 16px */
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  text-align: left;
  width: 100%;
  transition: background-color 0.2s ease;
}

.sidebar .btn:hover {
  background-color: #dfeff3; /* hover ringan agar teks tidak tertutup */
  color: #163b4c !important; /* jaga teks tetap terlihat */
}

.sidebar.collapsed .btn span {
  display: none;
}

.sidebar.collapsed .btn i {
  font-size: 12px;
  transition: font-size 0.2s ease;
}
.sidebar.collapsed .btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 60px;
  background: #0a2f6a;
  color: #f5fbfc;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-50%);
  top: 50%;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 999;
  display: none;
}

.sidebar.collapsed .btn:hover::after {
  opacity: 1;
}

/* Untuk status PDF */
.status-text {
  display: block;
  margin-top: 6px;
  font-size: 0.9em;
  color: #444;
}

/* Warna terang untuk dark mode */
body.dark .status-text {
  color: #f0f0f0;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 1024px) {
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 900;
  }
  .sidebar-overlay.show {
    display: block;
  }
}

/* TOGGLE COLLAPSE */
.toggle-sidebar {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1300;
  background: #eef8fb;
  border: 1px solid #cbd5e1;
  color: #1b4d63; /* lebih kontras */
  font-size: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

/* Pastikan tombol tetap muncul di mode collapsed */
.sidebar.collapsed .toggle-sidebar {
  top: 14px;
  left: 14px;
  transform: none;
  display: inline-flex;
}

/* Saat sidebar collapsed, sembunyikan logo dan user info */
.sidebar.collapsed .sidebar-logo-group {
  display: none;
}

body.dark .sidebar {
  background-color: #111827;
}

body.dark .sidebar .btn {
  background-color: #00000000;
  color: #eee;
}

body.dark .toggle-sidebar {
  background: #0f172a;
  border-color: #1f2937;
  color: #e2e8f0;
}

body.dark .sidebar .btn:hover {
  background-color: #ffffff14;
}

body.dark .toggle-sidebar {
  color: #ccc;
}

/* DARK MODE TOGGLE */
.dark-mode-toggle {
  display: flex;
  align-items: center;
  gap: 12px; /* Memberi jarak antara toggle dan label */
  margin-top: 10px;
  justify-content: center;
}

.dark-mode-label {
  font-size: 14px;
  color: #878787;
  white-space: nowrap;
}

body.dark .dark-mode-label {
  color: #eee;
}


.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #888;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #4caf50;
}

.switch input:checked + .slider:before {
  transform: translateX(18px);
}

/* FOOTER */
.sidebar .footer {
  font-size: 11px;
  color: #888;
  text-align: center;
  margin-top: auto;
  padding-top: 24px;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 78px;
    min-width: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-y: auto;
    overflow-x: hidden;
    justify-content: flex-start;
    gap: 8px;
    padding: 14px 10px;
    transform: translateX(-100%);
    transition: transform 0.25s ease, width 0.25s ease;
    z-index: 1200;
  }
  .sidebar.expanded {
    width: 240px;
    transform: translateX(0);
  }
  .sidebar.collapsed {
    width: 78px;
    transform: translateX(-100%);
  }
  .chat-box {
    margin-left: 0;
    width: 100%;
    padding-top: 64px;
  }
  .messages {
    max-width: 100%;
  }
}
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar-toggle {
    font-size: 1.2rem;
    padding: 6px 8px;
    position: fixed;
    top: 12px;
    left: 14px;
    z-index: 1300;
  }

}
/* LOGO */
.sidebar-logo {
  width: 90px;
  height: auto;
  margin-bottom: 13px;
  transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-logo {
  width: 0px;
  margin-bottom: 9px;
}

.sidebar.collapsed .sidebar-user {
  display: none;
}

/* SIDEBAR NAVIGATION STYLE */
.sidebar-content {
  flex-grow: 1;
  overflow-y: auto; /* auto = hanya muncul jika dibutuhkan */
  -ms-overflow-style: none; /* IE dan Edge lama */
  scrollbar-width: thin; /* Firefox */
  overflow-x: hidden;
  scrollbar-color: rgba(255, 255, 255, 0.09) transparent;
}

/* Untuk Chrome, Safari */
.sidebar-content::-webkit-scrollbar {
  width: 2px; /* lebih tipis */
}

.sidebar-content::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}


.sidebar-group {
  margin-bottom: 30px;
}

.sidebar-group-title {
  font-size: 13px;
  font-weight: bold;
  color: #878787;
  margin-bottom: 10px;
  padding-left: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px 5px;
  text-align: center;
  font-size: 12px;
}

.sidebar.collapsed .sidebar-footer {
  padding: 15px 5px;
}

.sidebar-menu li {
  margin-bottom: 6px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: transparent;
  color: #163b4c;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s ease;
}
.sidebar-menu a i {
  width: 20px;
  text-align: center;
}
.sidebar .sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px !important;
  font-size: 14px;
}

.sidebar-menu a:hover {
  background-color: #dfeff3;
  color: #163b4c;
}

/* Aktif */
.sidebar-menu a.active,
.sidebar .btn.active {
  background-color: #c6dfea;
  color: #0f2d3f !important;
}

.sidebar.collapsed .sidebar-menu a span {
  display: none;
}

.sidebar.collapsed .sidebar-menu a {
  justify-content: center;
  font-size: 18px;
  position: relative;
}

.sidebar.collapsed .sidebar-menu a::after {
  content: attr(title);
  position: absolute;
  left: 60px;
  background: #444;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-50%);
  top: 50%;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 999;
}

.sidebar.collapsed .sidebar-menu .btn {
  justify-content: center;
  padding: 8px;
  gap: 0;
}

.sidebar.collapsed .sidebar-menu .btn span {
  display: none;
}

.sidebar.collapsed .sidebar-group-title {
  display: none;
}

/* Konsisten hover tombol di dalam sidebar-menu */
.sidebar-menu .btn:hover {
  background-color: #dfeff3;
  color: #163b4c;
  transform: scale(1.02);
  transition: all 0.2s ease;
}

/* Dark mode penyesuaian */
body.dark .sidebar {
  background-color: #0d1a2c;
  color: #e5f2f6;
}

body.dark .sidebar-menu a {
  color: #e5f2f6;
  background-color: transparent;
}

body.dark .sidebar-menu a:hover {
  background-color: #1a2b3d;
  color: #e5f2f6 !important;
}

body.dark .sidebar-menu a.active,
body.dark .sidebar .btn.active {
  background-color: #1f3550;
  color: #e5f2f6 !important;
}

/* Dark mode: tombol/btn di sidebar */
body.dark .sidebar .btn {
  color: #e5f2f6;
  background-color: transparent;
}

body.dark .sidebar .btn:hover {
  background-color: #1a2b3d;
  color: #e5f2f6 !important;
}

body.dark .sidebar .btn.active {
  background-color: #1f3550;
  color: #e5f2f6 !important;
}

.sidebar.collapsed .sidebar-menu a:hover::after {
  opacity: 1;
}
/* FIX untuk tata letak container utama */
.container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Tambahkan ini jika .chat-box tidak ada/tidak tampil */
.chat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 10px;
  background-color: #fff;
  overflow: hidden;
  margin-top: 12px; /* beri jarak dari bar horizontal */
  position: relative;
  width: 100%;
}

.chat-box.update-ai {
  overflow-y: auto;
}

body.dark .chat-box {
  background-color: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  border: 1px solid #1f2937;
  backdrop-filter: blur(6px);
  margin-top: 12px;
}


#userInput {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 12px;
  outline: none;
  resize: none;
  height: auto;
  min-height: 50px;
  max-height: 120px;
  overflow-y: auto;
  width: 100%;
}

.send-btn {
  background: none;
  border: none;
  margin-left: 4px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-btn img {
  width: 24px;
  height: 24px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px; /* beri jarak vertikal antar pesan */
  width: 100%;
  max-width: 100%;
  margin: 0;
  word-wrap: break-word;
  padding: 0 5% 18px 5%; /* konten tetap di tengah, scrollbar di kanan */
}
.messages.with-hero {
  display: none;
}
.chat-hero {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  pointer-events: none;
  text-align: center;
  padding: 24px;
  background: transparent;
  z-index: 1;
}

.chat-hero.hidden {
  display: none;
}

.chat-hero h1 {
  font-size: 28px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.2px;
}

.hero-input {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 18px 38px -18px rgba(0,0,0,0.25), 0 10px 24px -18px rgba(0,0,0,0.12);
  border: 1px solid #e2e8f0;
  min-width: min(760px, 92%);
  max-width: 900px;
}

.hero-placeholder {
  flex: 1;
  color: #9ca3af;
  font-size: 16px;
  text-align: left;
}

.hero-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  background: #f3f4f6;
  border-radius: 50%;
  font-size: 14px;
}

.hero-icon.send {
  background: #a3a8b2;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

body.dark .chat-hero {
  background: transparent;
}

body.dark .chat-hero h1 {
  color: #e2e8f0;
}

body.dark .hero-input {
  background: #0f172a;
  border-color: #1f2937;
  box-shadow: 0 18px 38px -18px rgba(0,0,0,0.65), 0 10px 24px -18px rgba(0,0,0,0.6);
}

body.dark .hero-placeholder {
  color: #94a3b8;
}

body.dark .hero-icon {
  background: #111827;
  color: #cbd5e1;
}

body.dark .hero-icon.send {
  background: linear-gradient(135deg, #38bdf8, #4ade80);
  color: #0b1220;
}

.message.user {
  align-self: flex-end;
  max-width: 70%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 16px;
  line-height: 1.6;
}

.message.bot {
  align-self: flex-start;
  max-width: 65%; /* sedikit dipersempit agar konten tidak melebar */
  margin-left: 35px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow-x: visible; /* biarkan konten wrap, tanpa memotong */
}

.message.bot .bot-text {
  padding: 0;
  margin: 0;
  background: transparent;
  color: #333;
  font-size: 18px;
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  width: 100%; /* konten tetap di dalam area bot */
}
.message.bot .bot-text .bot-paragraph {
  margin: 8px 0;
}
.message.bot .bot-text ul,
.message.bot .bot-text ol {
  margin: 8px 0 8px 1.5em;
  padding-left: 1.5em;
  list-style-position: outside;
  list-style-type: initial;
}
.message.bot .bot-text ol { list-style-type: decimal; }
.message.bot .bot-text ul { list-style-type: disc; }
.message.bot .bot-text ul li,
.message.bot .bot-text ol li {
  margin: 6px 0;
  line-height: 1.6;
}
body.dark .message.bot .bot-text {
  color: #e2e8f0;
}

.message .msg-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  align-items: center;
}
.message .msg-action {
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}
.message .msg-action:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0ea5e9;
}
body.dark .message .msg-action {
  color: #94a3b8;
}
body.dark .message .msg-action:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #38bdf8;
}

.bubble {
  background-color: #e6e6e6;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.typing-bubble {
  display: flex;
  align-items: center;
  background: #eef3fb;
  border: 1px solid #d4deed;
  color: #0f172a;
}
.typing-label {
  font-weight: 600;
  font-size: 13px;
}
.typing-text {
  font-weight: 700;
  letter-spacing: 0.2px;
  background: linear-gradient(120deg, #0f172a 0%, #4c6b9b 55%, #0f172a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 220% 100%;
  animation: shimmerText 1.3s linear infinite;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
}

body.dark .typing-bubble {
  background: linear-gradient(145deg, #0f172a 0%, #0d1525 100%);
  border: 1px solid #1f2937;
  color: #e2e8f0;
}

body.dark .typing-text {
  background: linear-gradient(120deg, #9cc2ff 0%, #4ad4e2 55%, #9cc2ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 220% 100%;
  animation: shimmerText 1.3s linear infinite;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

@keyframes shimmerText {
  0% { background-position: 200% 0; opacity: 0.5; }
  50% { opacity: 1; }
  100% { background-position: -200% 0; opacity: 0.5; }
}

.message.user .bubble {
  background-color: #d1e7dd;
  color: #0b3f2e;
  border-bottom-right-radius: 4px;
}

.message.bot .bubble {
  background-color: #f5f5f5;
  color: #333;
  border-bottom-left-radius: 4px;
}

.bubble .table-wrapper {
  max-width: 100%;
  overflow-x: auto;
  margin: 10px -2px 6px;
  padding-bottom: 4px;
}
.message.bot .table-wrapper {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 10px -2px 6px;
  padding-bottom: 4px;
}

.table-wrapper::-webkit-scrollbar {
  height: 6px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: #c5d4e1;
  border-radius: 6px;
}

.ai-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  background: #fff;
  table-layout: auto;
}

.ai-table th,
.ai-table td {
  border: 1px solid #d9e2ec;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}

.ai-table th {
  background: #eef4fb;
  font-weight: 700;
}

body.dark .ai-table {
  background: #0f172a;
}

body.dark .ai-table th {
  background: #1f2937;
}

body.dark .ai-table th,
body.dark .ai-table td {
  border-color: #1f2937;
  color: #e2e8f0;
}

body.dark .table-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #22d3ee, #0ea5e9);
}

body.dark .bubble {
  background: linear-gradient(145deg, #0f172a 0%, #0e1525 100%);
  color: #e2e8f0;
  box-shadow: 0 8px 16px -10px rgba(0,0,0,0.6);
}

body.dark .message.user .bubble {
  background: linear-gradient(135deg, #1ab7c6 0%, #0d9bb5 100%);
  color: #0b1220;
  box-shadow: 0 10px 18px -12px rgba(26,183,198,0.45);
}

body.dark .message.bot .bubble {
  background: linear-gradient(160deg, #0e1525 0%, #111827 100%);
  color: #e2e8f0;
  border: 1px solid #1f2937;
  box-shadow: 0 10px 18px -14px rgba(0,0,0,0.75);
}

.timestamp {
  align-self: flex-end;
  font-size: 11px;
  color: #888;
  margin-top: 10px;
}

/* Input */
.input-container {
  display: flex;
  align-items: center;
  border-top: 1px solid #ccc;
  padding: 30px;
  background-color: #fff;
  gap: 8px;

}

.chat-box.hero-active {
  justify-content: center;
}

.chat-box.hero-active .chat-title {
  margin-bottom: 18px;
}

.chat-box.hero-active .input-container {
  position: relative;
  border: 1px solid #e5e7eb;
  padding: 14px 18px;
  border-radius: 26px;
  box-shadow: 0 16px 32px -18px rgba(0,0,0,0.18);
  max-width: min(900px, 92vw);
  width: 100%;
  margin: 0 auto;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

.chat-box.hero-active .upload-icon,
.chat-box.hero-active .mic-btn {
  color: #4b5563;
}

.chat-box.hero-active .send-btn {
  margin-left: 10px;
}

body.dark .chat-box.hero-active .input-container {
  background: #0f172a;
  border-color: #1f2937;
  box-shadow: 0 18px 36px -20px rgba(0,0,0,0.8);
}

.chat-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin: 6px 0 12px;
}

.chat-box:not(.hero-active) .chat-title {
  display: none;
}

body.dark .chat-title {
  color: #e2e8f0;
}

body.dark .input-container {
  background-color: rgba(15, 23, 42, 0.82);
  border-top: 1px solid #1f2937;
  box-shadow: 0 -4px 18px -14px rgba(0,0,0,0.7);
}

body.dark #userInput {
  background-color: #0f172a;
  color: #e2e8f0;
  border: 1px solid #1f2735;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3), 0 1px 0 rgba(255,255,255,0.03);
}

body.dark #userInput::placeholder {
  color: #94a3b8;
}

.upload-icon {
  font-size: 20px;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.upload-icon:hover {
  color: #000;
  transform: scale(1.1);
}

.waveform {
  display: none;
  align-items: center;
  height: 24px;
  margin: 0 8px 0 4px;
}

.wave-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 100%;
}

.wave-bar {
  width: 3px;
  background: #00b7c7;
  border-radius: 2px;
  animation: wavePulse 0.8s ease-in-out infinite;
  animation-play-state: paused;
}

.mic-active .waveform {
  display: flex;
}

.mic-active .wave-bar {
  animation-play-state: running;
}

@keyframes wavePulse {
  0% { height: 4px; }
  50% { height: 18px; }
  100% { height: 4px; }
}

.mic-btn {
  font-size: 20px;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.mic-btn:hover {
  color: #000;
  transform: scale(1.1);
}

.mic-btn.listening {
  color: #00b7c7;
  animation: micPulse 1s ease-in-out infinite;
}

.mic-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@keyframes micPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

body.dark .upload-icon {
  color: #ccc;
}

body.dark .upload-icon:hover {
  color: #fff;
}

body.dark .mic-btn {
  color: #ccc;
}

body.dark .mic-btn:hover {
  color: #fff;
}

body.dark .mic-btn.listening {
  color: #00c4d6;
}
.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: #999;
  border-radius: 50%;
  animation: blink 1.2s infinite ease-in-out both;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% {
    opacity: 0;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}


/* Firefox compatibility */
.chat-box,
.messages {
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, 0.5) transparent;
  overflow-x: hidden;
}
body.dark .messages {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
body.dark .messages::-webkit-scrollbar {
  width: 6px;
}
body.dark .messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #22d3ee, #0ea5e9);
  border-radius: 8px;
}
body.dark .messages::-webkit-scrollbar-track {
  background: transparent;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top: 2px solid #333;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

body.dark .spinner {
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top: 2px solid #fff;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


