/* --- RESET & VARIABLES --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
/* #0a73e8 */
:root {
  --primary-blue: #0a73e8; 
  --soft-blue: #ebf5ff;
  --hover-blue: #0a60c8;

  --text-dark: #202123;
  --text-grey: #6e6e80;
  --border-light: #ececf1;
  --bg-white: #ffffff;
  --bg-dark-sidebar: #1f2937;
  --text-sidebar-light: #e5e7eb;
}

/* VIEWPORT FIX */
html,
body {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-white);
  color: var(--text-dark);
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

/* SAAT SIDEBAR MOBILE DIBUKA: KUNCI SCROLL */
body.no-scroll {
  overflow: hidden !important;
  touch-action: none;
}

/* APP LAYOUT */
.app-shell {
  display: flex;
  width: 100%;
  height: 100dvh;
  background: radial-gradient(circle at top left, #e5f0ff 0, #ffffff 40%, #f5f5f5 100%);
}

/* MAIN CONTENT */
.main-content {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-white);
}

/* HEADER */
.top-logo-section {
  padding: 20px 30px;
  width: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  overflow: hidden;
  display: block;
}

.logo-text {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-dark);
}

.red-id {
  color: var(--primary-blue);
}

/* WELCOME */
.welcome-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  min-height: 0;
}

/* .bot-avatar {
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  overflow: hidden;
  padding: 0;
  background-color: white;
}

.bot-avatar img {
  width: 115%;
  height: 115%;
  object-fit: cover;
  border-radius: 50%;
} */

.bot-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.bot-avatar-icon {
  font-size: 40px;
}

.welcome-container h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.highlight {
  color: var(--primary-blue);
}

.subtitle {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 15px;
}

.description {
  color: var(--text-grey);
  max-width: 600px;
  margin-bottom: 40px;
}

/* SUGGESTION CARDS */
.suggestion-cards {
  display: flex;
  gap: 15px;
  width: 100%;
  max-width: 900px;
  justify-content: center;
  flex-wrap: wrap;
}

.card {
  flex: 1;
  min-width: 240px;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 15px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: black;
}

.card:hover {
  border-color: var(--primary-blue);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.icon-box {
  background-color: var(--soft-blue);
  color: var(--primary-blue);
  width: 35px;
  height: 35px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.card p {
  font-size: 0.85rem;
  color: var(--text-grey);
}

/* FOOTER / INPUT */
.chat-footer {
  width: 100%;
  padding: 20px 30px 30px;
  background: linear-gradient(to top, #ffffff 80%, rgba(255, 255, 255, 0));
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  z-index: 10;
  position: sticky;
  bottom: 0;
}

/* WRAPPER INPUT – pill slim */
.input-wrapper {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;              /* tombol & textarea sejajar tengah */
  background-color: var(--bg-white);
  border: 1px solid #d9d9e3;
  border-radius: 999px;
  padding: 4px 10px;                /* slim secara vertikal */
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  transition: border 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--primary-blue);
  box-shadow: 0 3px 10px rgba(10, 115, 232, 0.15);
}

/* TOMBOL MIC */
.voice-btn {
  width: 29px;
  height: 29px;
  border: none;
  background: transparent;
  color: var(--text-grey);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* TEXTAREA CHAT (multi-line) */
#userInput {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;              /* jangan punya pill sendiri */

  font-size: 0.95rem;
  margin: 0 8px;

  min-height: 26px;
  max-height: 110px;
  line-height: 1.35;
  padding: 4px 4px;

  resize: none;
  overflow-y: hidden;
  box-sizing: border-box;

  /* matikan styling default browser (terutama Safari) */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* placeholder */
#userInput::placeholder {
  color: var(--text-grey);
  opacity: 0.8;
  font-size: 0.95rem;
}

#userInput:focus {
  outline: none;
  box-shadow: none;
}

/* iPhone: cegah zoom tapi tetap center */
@media (max-width: 768px) {
  #userInput {
    font-size: 16px !important;
    min-height: 30px;
    padding: 6px 4px;           /* sedikit ditambah supaya tetap di tengah */
  }
}

/* TOMBOL KIRIM */
.send-btn {
  width: 29px;
  height: 29px;
  background-color: var(--primary-blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.15s ease, box-shadow 0.15s ease;
}

.send-btn:hover {
  background-color: var(--hover-blue);
  transform: translateY(-1px);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.15);
}

.send-btn.processing,
.send-btn:disabled {
  cursor: default;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

/* ===== CUSTOM SCROLLBAR UNTUK TEXTAREA INPUT ===== */

/* Chrome, Edge, Safari (WebKit) */
#userInput::-webkit-scrollbar {
  width: 6px;                  /* lebar scrollbar */
}

#userInput::-webkit-scrollbar-track {
  background: transparent;     /* track transparan */
}

#userInput::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.8);  /* abu kebiruan */
  border-radius: 999px;
}

#userInput::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.95);
}

/* Firefox */
#userInput {
  scrollbar-width: thin;       /* tipis */
  scrollbar-color: rgba(148,163,184,0.9) transparent;
}

.disclaimer {
  font-size: 0.75rem;
  color: #9b9b9b;
  margin-top: 12px;
  text-align: center;
}

/* CHAT CONTAINER (scroll di sini) */
.chat-container {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
}

/* MESSAGE */
.message {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  max-width: 80%;
  animation: fadeIn 0.3s ease;
}

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

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.user .message-content {
  background-color: var(--primary-blue);
  color: white;
  border-radius: 18px 18px 4px 18px;
}

.message.bot {
  align-self: flex-start;
}

.message.bot .message-content {
  background-color: #f0f0f0;
  color: var(--text-dark);
  border-radius: 18px 18px 18px 4px;
}

.message-content {
  position: relative;
  padding: 12px 16px 28px 18px; /* extra padding bawah buat tombol Salin */
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  word-break: break-word;
}

/* TOMBOL COPY – selalu kelihatan di kanan bawah (hanya di bubble bot) */
.copy-btn {
  position: absolute;
  right: 10px;
  bottom: 6px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 999px;
  padding: 3px 8px;

  font-size: 11px;
  line-height: 1;
  cursor: pointer;

  background: rgba(15, 23, 42, 0.08);
  color: #4a5668;

  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    opacity 0.18s ease;
}

.copy-btn:hover {
  background: rgba(15, 23, 42, 0.10);
  color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

/* wrapper isi tombol: jadi “kanvas” untuk menumpuk teks & icon */
.copy-inner {
  display: grid;
  place-items: center;      /* center horizontal + vertical */
  min-width: 32px;          /* biar nggak terlalu sempit saat cuma icon */
  min-height: 14px;         /* jaga tinggi agar pill tidak gepeng */
}

/* TUMPUK TEKS & ICON DI TENGAH */
.copy-label,
.copy-check-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}

/* state awal: hanya "Salin" yang kelihatan */
.copy-label {
  opacity: 1;
}

.copy-check-icon {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  font-size: 11px;
  pointer-events: none;
}

/* SAAT SUKSES COPY (class .copied ditambah dari JS) */
.copy-btn.copied {
  background: var(--primary-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(10, 115, 232, 0.45);
  animation: copyPulse 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* label menghilang halus */
.copy-btn.copied .copy-label {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
}

/* icon centang muncul di posisi yang sama */
.copy-btn.copied .copy-check-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ANIMASI SCALE + GLOW + FADE IN & OUT HALUS UNTUK TOMBOL */
@keyframes copyPulse {
  0% {
    transform: scale(0.94);
    opacity: 0; /* mulai pudar */
    box-shadow: 0 0 0 0 rgba(10, 115, 232, 0.0);
  }
  35% {
    transform: scale(1.06);
    opacity: 1; /* full muncul */
    box-shadow: 0 0 0 9px rgba(10, 115, 232, 0.20);
  }
  70% {
    transform: scale(1.0);
    opacity: 0.75; /* sedikit fade out */
    box-shadow: 0 0 0 3px rgba(10, 115, 232, 0.10);
  }
  100% {
    transform: scale(1.0);
    opacity: 1; /* balik stabil lagi */
    box-shadow: 0 0 0 0 rgba(10, 115, 232, 0.0);
  }
}

/* === STATE SEDANG MENDENGARKAN === */
.voice-btn.listening {
  position: relative;
  background-color: rgba(12, 114, 209, 0.15);
  color: var(--primary-blue);
  box-shadow: 0 0 10px rgba(12, 114, 209, 0.4);
  animation: micGlow 1.6s ease-in-out infinite;
}

/* MIC ICON BERDENYUT LEMBUT */
.voice-btn.listening i {
  animation: micPulse 1.2s ease-in-out infinite;
}

/* LINGKARAN GELOMBANG KELUAR */
.voice-btn.listening::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(12, 114, 209, 0.25);
  
  /* pulse wave */
  animation: micWave 1.6s ease-out infinite;
  z-index: -1;
}


/* === ANIMASI === */

/* Glow lembut */
@keyframes micGlow {
  0% {
    box-shadow: 0 0 6px rgba(12, 114, 209, 0.3);
  }
  50% {
    box-shadow: 0 0 14px rgba(12, 114, 209, 0.55);
  }
  100% {
    box-shadow: 0 0 6px rgba(12, 114, 209, 0.3);
  }
}

/* Icon pulse */
@keyframes micPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* Gelombang lingkaran */
@keyframes micWave {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

#userInput {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  padding: 6px 8px;
  background: transparent;

  resize: none;           /* user tidak bisa drag sudut */
  overflow-y: hidden;     /* awalnya tanpa scrollbar */
  max-height: 140px;      /* batas tinggi maksimal (boleh sesuaikan) */
  line-height: 1.4;
}

/* BOT AVATAR KECIL */
.chat-avatar {
  width: 35px;
  height: 35px;
  background-color: white;
  border: 1px solid var(--primary-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  padding: 0;
  color: var(--primary-blue);
}

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


/* HIDE SCROLLBAR */
.welcome-container::-webkit-scrollbar,
.chat-container::-webkit-scrollbar {
  display: none;
}

.welcome-container,
.chat-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* SIDEBAR (DESKTOP) */
.sidebar {
  width: 280px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-dark-sidebar);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* OVERLAY MOBILE */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* SIDEBAR HEADER */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 6px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(10, 115, 232, 0.1),
    rgba(31, 41, 55, 0.8)
  );
  flex-shrink: 0;
}

.sidebar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 20% 20%, #4f46e5, #0a73e8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fef2f2;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user-info {
  font-size: 12px;
  color: var(--text-sidebar-light);
}

.sidebar-user-info .name {
  font-weight: 600;
  font-size: 13px;
}

.sidebar-user-info .email {
  font-size: 11px;
  color: #9ca3af;
}

/* SIDEBAR ACTIONS */
.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.sidebar-actions button,
.sidebar-actions a {
  border: none;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.sidebar-actions i {
  font-size: 13px;
  color: var(--text-sidebar-light);
}

/* TOMBOL NEW CHAT – versi cakep */
.btn-new-chat {
  background: linear-gradient(135deg, #0a73e8, #0a60c8);
  color: #ecfdf5;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(10, 115, 232, 0.45);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease,
    background 0.18s ease;
  white-space: nowrap;
}

.btn-new-chat i {
  color: #ecfdf5;
  font-size: 14px;
}

/* hover: sedikit terangkat & makin terang */
.btn-new-chat:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(10, 115, 232, 0.55);
  filter: brightness(1.03);
}

/* klik: turun dikit biar terasa “press” */
.btn-new-chat:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(10, 115, 232, 0.5);
  filter: brightness(0.98);
}

/* fokus keyboard (aksesibilitas) */
.btn-new-chat:focus-visible {
  outline: 2px solid #bfdbfe;
  outline-offset: 2px;
}


.btn-profile {
  background: transparent;
  color: var(--text-sidebar-light);
  margin-top: 5px;
  padding-left: 0;
  border-radius: 8px;
}
.btn-profile:hover {
  background: rgba(55, 65, 81, 0.95);
}
.btn-profile i {
  color: #9ca3af;
}

.btn-logout {
  background: rgba(220, 38, 38, 0.95);
  color: #fee2e2;
  padding-left: 10px;
  margin-top: 10px;
}
.btn-logout:hover {
  background: rgba(185, 28, 28, 1);
}
.btn-logout i {
  color: #fee2e2;
}

/* HISTORY SECTION */
.sidebar-section-title {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
  margin: 4px 12px 6px;
  flex-shrink: 0;
}

.history-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 6px;
  border-top: 1px solid rgba(55, 65, 81, 0.9);
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.history-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.history-item {
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  margin: 0 2px 2px;
  cursor: pointer;
  background: transparent;
  color: var(--text-sidebar-light);
  border: none;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.history-item i {
  font-size: 14px;
  color: #9ca3af;
}

.history-item:hover {
  background: rgba(10, 115, 232, 0.1);
  transform: translateY(-1px);
}

.history-item:active {
  transform: translateY(0);
  background: rgba(10, 115, 232, 0.2);
}

.sidebar-footer {
  font-size: 11px;
  color: #6b7280;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(31, 41, 55, 0.7);
  flex-shrink: 0;

  /* center */
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}


/* BUBBLE WRAPPER */
.chat-bubble-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

/* HAMBURGER BUTTON */
.hamburger-btn {
  display: none;
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hamburger-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: #4b5563;
  position: relative;
}

.hamburger-btn span::before,
.hamburger-btn span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: #4b5563;
}

.hamburger-btn span::before {
  top: -5px;
}

.hamburger-btn span::after {
  top: 5px;
}

/* MODAL AUTH */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11000;

  /* animasi */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

/* saat modal aktif (ditambah class dari JS) */
.modal-backdrop.modal-show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 20px 20px;
  width: 360px;
  max-width: 90%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  position: relative;

  /* supaya kalau formnya tinggi di mobile bisa scroll di dalam modal */
  max-height: 90vh;
  overflow-y: auto;

  /* animasi masuk */
  transform: translateY(18px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.22s ease,
    opacity 0.22s ease;
}

/* ketika backdrop aktif, card ikut muncul halus */
.modal-backdrop.modal-show .modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.modal-tab {
  border: none;
  background: #f3f4f6;
  color: #4b5563;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-tab.active {
  background: var(--primary-blue);
  color: #fff;
}

.modal-close {
  margin-left: auto;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #9ca3af;
  padding: 4px;
}

.modal-close i {
  font-size: 14px;
}

.modal-pane label {
  display: block;
  font-size: 12px;
  margin-top: 8px;
  margin-bottom: 2px;
  text-align: left;
}

.modal-pane input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-pane input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 1px rgba(10, 115, 232, 0.12);
}

.modal-submit {
  margin-top: 14px;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  background: var(--primary-blue);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.modal-submit:hover {
  background: var(--hover-blue);
  box-shadow: 0 6px 16px rgba(10, 115, 232, 0.35);
  transform: translateY(-0.5px);
}

.modal-submit:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(10, 115, 232, 0.4);
}


/* === SOCIAL LOGIN DI MODAL AUTH === */

.social-login-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

/* Tombol sosial umum */
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease,
    border-color 0.15s ease;
}

/* Icon di tombol sosial */
.social-btn i {
  font-size: 15px;
}

/* Style khusus Google */
.social-btn.google {
  background: #ffffff;
  color: #111827;
  border-color: #e5e7eb;
}

.social-btn.google i {
  color: #ea4335; /* warna merah Google */
}

/* Hover & active state */
.social-btn:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  transform: translateY(-0.5px);
}

.social-btn:active {
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  transform: translateY(0);
}

/* Separator "atau ..." */
.modal-separator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #9ca3af;
  margin: 8px 0 10px;
}

.modal-separator::before,
.modal-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* ========== MOBILE (max-width: 900px) ========== */
@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
    /* jangan paksa fixed 100dvh, biar bisa nambah tinggi kalau perlu */
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .main-content {
    flex: 1 1 auto;
    /* sama: fleksibel, tapi tetap minimal 100dvh */
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .chat-container {
    flex: 1 1 auto;
  }

  /* SIDEBAR OVERLAY SLIDE */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 9999;
    height: 100dvh;
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .top-logo-section {
    padding: 10px 16px;
    border-bottom: 1px solid #e5e7eb;
  }

  .hamburger-btn {
    display: flex;
  }

}


/* ========== LAYOUT MOBILE KECIL (max-width: 768px) ========== */
@media (max-width: 768px) {
  .welcome-container {
    padding: 10px 16px;
  }

  .welcome-container h1 {
    font-size: 1.8rem;
  }

  .social-btn {
    font-size: 12px;
    padding: 8px 9px;
  }

  .social-btn i {
    font-size: 14px;
  }

  .subtitle {
    font-size: 1rem;
    margin-bottom: 10px;
  }

  .description {
    margin-bottom: 20px;
  }

  .suggestion-cards {
    gap: 10px;
  }

  .card {
    min-width: 100%;
    padding: 12px;
    flex-direction: row;
    align-items: center;
    text-align: left;
  }

  .card h3 {
    margin-bottom: 0;
    font-size: 1rem;
  }

  .card p {
    font-size: 0.8rem;
    margin-top: 0;
  }

  .chat-footer {
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .input-wrapper {
    padding: 6px 10px;
    border-radius: 50px;
    max-width: 100%;
    gap: 8px;
  }

  #userInput {
    font-size: 16px !important;
    padding: 8px 4px;
    min-width: 0;
  }

  .send-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 14px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .send-btn i {
    font-size: 12px;
  }

  .chat-container {
    padding-bottom: 70px;
  }

  .message {
    max-width: 95%;
    gap: 10px;
  }

  .message-content {
    font-size: 0.9rem;
    padding: 12px 16px 28px 18px;
  }

  .copy-btn {
    right: 8px;
    padding: 4px 9px;
  }
  .modal-card {
    width: 100%;
    max-width: 92%;
    padding: 16px 16px 18px;
    border-radius: 14px;
  }
}

/* iOS FIX */
@supports (-webkit-touch-callout: none) {
  input,
  textarea {
    font-size: 16px !important;
  }

  /* .chat-container {
    padding-bottom: 90px;
  } */
}
