/* =======================================
   1. LAYAR UTAMA & WRAPPER
======================================= */
html,
body,
.wrapper {
  height: 100vh;
  margin: 0;
  overflow: hidden;
  background-color: #ffffff;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

/* =======================================
   2. SIDEBAR
======================================= */
.sidebar {
  width: 280px; /* Lebar tetap */
  flex-shrink: 0; /* Kunci agar sidebar tidak mengecil saat chat panjang */
  background-color: #162135; /* Warna Biru Dongker Gelap */
  border-right: 1px solid #101928;
  transition: margin-left 0.3s ease; /* Animasi sembunyikan sidebar */
}

/* Sembunyikan sidebar ke kiri */
.sidebar.collapsed {
  margin-left: -280px;
}

.logo-box {
  background: linear-gradient(135deg, #4b7bec, #3867d6);
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.logo-box-large {
  background: linear-gradient(135deg, #1d3557, #15253f);
  width: 60px;
  height: 60px;
  border-radius: 12px;
  font-size: 32px;
  font-weight: bold;
}

.sidebar-menu .nav-link {
  color: #a0aec0;
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 14.5px;
  transition: 0.2s;
}

.sidebar-menu .nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-menu .nav-link.active {
  color: #ffffff;
  background-color: #233756; /* Tombol aktif */
}

.internal-data-card {
  background-color: #1c2d47;
  border-left: 3px solid #cbd5e1;
}

.profile-section {
  border-top: 1px solid #2a3b56;
}

/* =======================================
   3. KONTEN UTAMA & KARTU FITUR
======================================= */
.max-w-custom {
  max-width: 850px; /* Lebar maksimal konten tengah */
}

/* Kartu Fitur Awal */
.feature-card {
  background-color: #f7f9fc;
  border: 1px solid #eef2f7;
  cursor: pointer;
  transition: 0.2s;
}

.feature-card:hover {
  background-color: #edf2f9;
  transform: translateY(-2px);
}

.example-box {
  background-color: #f7f9fc;
}

/* =======================================
   4. CHAT BUBBLES (MODE TERANG)
======================================= */
.chat-message {
  max-width: 100%;
}

.message-content {
  max-width: 85%;
  line-height: 1.6;
  word-wrap: break-word;
  border-radius: 20px; /* Sudut membulat tidak runcing */
  padding: 14px 18px !important; /* Jarak dalam gelembung */
}

.message-content p,
.message-content pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 0;
}

/* Pesan Bot (AI) - Mode Terang */
.bot-message .message-content {
  background-color: #ffffff;
  border: 1px solid #eaeaea !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  color: #1a1a1a;
  border-top-left-radius: 4px; /* Ekor halus bot */
}

/* Pesan User - Mode Terang (Rata Kanan) */
.user-message {
  flex-direction: row-reverse;
}

.user-message .message-content {
  background-color: #f0f4f9 !important; /* Biru/abu pudar ala Gemini */
  border: 1px solid #e1e9f2 !important;
  color: #1a1a1a;
  border-top-right-radius: 4px; /* Ekor halus user */
}

/* =======================================
   5. INPUT AREA
======================================= */
.input-wrapper {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
}

.input-wrapper:focus-within {
  border-color: #a0aec0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05) !important;
}

textarea#user-input {
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 15px;
}

.document-source-select {
  max-width: 190px;
}

textarea#user-input:focus {
  outline: none;
  box-shadow: none;
}

/* =======================================
   6. DARK MODE (MODE MALAM)
======================================= */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .wrapper,
[data-bs-theme="dark"] .main-content,
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light {
  background-color: #1e1f22 !important; /* Latar gelap Discord/Gemini */
  color: #e3e3e3 !important;
}

[data-bs-theme="dark"] .text-dark {
  color: #ffffff !important;
}

[data-bs-theme="dark"] .text-secondary {
  color: #a0aec0 !important;
}

[data-bs-theme="dark"] .text-muted {
  color: #8793a3 !important;
}

/* Kartu Fitur & Contoh di Mode Malam */
[data-bs-theme="dark"] .feature-card,
[data-bs-theme="dark"] .example-box {
  background-color: #2b2d31;
  border-color: #3f4147;
}

[data-bs-theme="dark"] .feature-card:hover {
  background-color: #35373c;
}

/* Input Area di Mode Malam */
[data-bs-theme="dark"] .input-container {
  background-color: #1e1f22 !important;
}

[data-bs-theme="dark"] .input-wrapper {
  background-color: #2b2d31 !important;
  border-color: #44474e !important;
}

[data-bs-theme="dark"] textarea#user-input {
  color: #e3e3e3 !important;
}

[data-bs-theme="dark"] textarea#user-input::placeholder {
  color: #8793a3 !important;
}

/* Gelembung Pesan Bot di Mode Malam (Abu-Abu Gelap) */
[data-bs-theme="dark"] .bot-message .message-content {
  background-color: #2b2d31 !important;
  border: 1px solid #3f4147 !important;
  color: #e3e3e3 !important;
  box-shadow: none;
}

/* Gelembung Pesan User di Mode Malam (Abu-Abu Sedikit Lebih Terang) */
[data-bs-theme="dark"] .user-message .message-content {
  background-color: #383a40 !important;
  border: 1px solid #4a4d54 !important;
  color: #ffffff !important;
}

/* ======== Tambahan */
.text-justify {
  text-align: justify !important;
  text-justify: inter-word;
}
