/* ============================================================
   DARK THEME — Terinspirasi dari HTML5 UP Landed
   ============================================================ */

:root {
  --bg-0: #0a0e1a;
  --bg-1: #0f1420;
  --bg-2: #151b2b;
  --bg-3: #1e2537;
  --border: #232b3d;
  --border-2: #2d3548;
  --text-0: #f1f5f9;
  --text-1: #e2e8f0;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --primary: #3b82f6;
  --primary-2: #06b6d4;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
}

/* Font sistem + base */
body {
  background: var(--bg-0) !important;
  color: var(--text-1) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Header */
header {
  background: var(--bg-1) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.logo {
  color: var(--text-0) !important;
}

/* Credit badge */
.credit-badge {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

.credit-badge .icon, .credit-badge .value {
  color: #60a5fa !important;
}

/* Tombol Top Up & Aktivasi */
.topup-btn {
  background: #3b82f6 !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35) !important;
  transition: all 0.2s !important;
}
.topup-btn:hover {
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.55) !important;
  transform: translateY(-1px);
}

.activate-btn {
  background: var(--bg-2) !important;
  color: var(--text-1) !important;
  border: 1px solid var(--border-2) !important;
}
.activate-btn:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* Grid fitur */










/* Card / konten */
.card, .workspace .card, [class*="card"]:not(.feature-card):not(.credit-badge) {
  background: var(--bg-2) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  color: var(--text-1) !important;
}

.card-title {
  color: var(--text-0) !important;
}

/* Heading */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-0) !important;
}

/* Hero */
.hero h1 {
  color: var(--text-0) !important;
}

.hero p {
  color: var(--text-2) !important;
}

/* Form input */
input, textarea, select {
  background: var(--bg-1) !important;
  color: var(--text-1) !important;
  border: 1px solid var(--border) !important;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
  outline: none !important;
}

input::placeholder, textarea::placeholder {
  color: var(--text-3) !important;
}

/* Tombol primary */
button.primary, .primary {
  background: #3b82f6 !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
  transition: all 0.25s !important;
}
button.primary:hover, .primary:hover {
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5) !important;
  transform: translateY(-1px) !important;
}

/* Tombol secondary */
button.secondary, .secondary {
  background: var(--bg-2) !important;
  color: var(--text-1) !important;
  border: 1px solid var(--border-2) !important;
}
button.secondary:hover, .secondary:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* Upload button */
.upload-btn {
  background: var(--bg-2) !important;
  color: var(--text-1) !important;
  border: 1px solid var(--border-2) !important;
}
.upload-btn:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* Status */
.status.error {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}
.status.success {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #6ee7b7 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}
.status.info {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #93c5fd !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

/* Progress */
.progress-bar-bg {
  background: var(--bg-3) !important;
}
.progress-bar-fill {
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%) !important;
}
.progress-header, .progress-step {
  color: var(--text-2) !important;
}

/* Output box */
.output {
  background: var(--bg-1) !important;
  color: var(--text-1) !important;
  border: 1px solid var(--border) !important;
}

/* Stats (jumlah kata) */
.stats {
  color: var(--text-2) !important;
}

/* Upload hint */
.upload-hint {
  color: var(--text-3) !important;
}

/* Modal */
.modal, [id$="Modal"] > div, [id$="modal"] > div {
  background: var(--bg-2) !important;
  color: var(--text-1) !important;
}

/* Tips box */
.tips, .form-group + div[style*="background:#f9fafb"], div[style*="background:#f9fafb"] {
  background: var(--bg-2) !important;
  color: var(--text-2) !important;
  border-color: var(--border) !important;
}

/* Info box */
div[style*="background:#eff6ff"] {
  background: rgba(59, 130, 246, 0.1) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

/* Panduan format sitasi */
div[style*="background:#eff6ff"] strong {
  color: #93c5fd !important;
}

/* Warning/info khusus */
div[style*="background:#fef3c7"] {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

/* Copyright */
#copyright-maswadi {
  color: var(--text-3) !important;
  border-color: var(--border) !important;
  background: transparent !important;
}
#copyright-maswadi strong {
  color: var(--text-2) !important;
}

/* Tombol WA tetap hijau (jangan di-dark) */
a[href*="wa.me"] {
  /* biarkan apa adanya */
}

/* Scrollbar gelap */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-1);
}
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Divider/garis */
hr, [style*="border-top:1px solid #e5e7eb"] {
  border-color: var(--border) !important;
}

/* Status error di tab */
.status {
  border-radius: 8px !important;
}

/* Select dropdown */
select option {
  background: var(--bg-2) !important;
  color: var(--text-1) !important;
}

/* File input */
.file-input {
  background: var(--bg-1) !important;
  color: var(--text-2) !important;
}



/* ============================================================
   CHAT AI — Full Dark
   ============================================================ */

.chat-wrapper {
  background: var(--bg-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  overflow: hidden;
}

.chat-header {
  background: var(--bg-3) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-0) !important;
}

.chat-header h2 {
  color: var(--text-0) !important;
}

.model-tag {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.chat-header .secondary {
  background: var(--bg-2) !important;
  color: var(--text-1) !important;
  border: 1px solid var(--border-2) !important;
}

.chat-messages {
  background: var(--bg-1) !important;
  color: var(--text-1) !important;
}

.chat-welcome {
  color: var(--text-1) !important;
}

.chat-welcome h3 {
  color: var(--text-0) !important;
}

.chat-welcome p {
  color: var(--text-2) !important;
}

.chat-suggestions .suggestion {
  background: var(--bg-2) !important;
  color: var(--text-1) !important;
  border: 1px solid var(--border-2) !important;
  transition: all 0.2s !important;
}

.chat-suggestions .suggestion:hover {
  border-color: var(--primary) !important;
  color: #60a5fa !important;
  background: var(--bg-3) !important;
}

.chat-input-bar {
  background: var(--bg-2) !important;
  border-top: 1px solid var(--border) !important;
}

#chatInput {
  background: var(--bg-1) !important;
  color: var(--text-1) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
}

#chatInput::placeholder {
  color: var(--text-3) !important;
}

#chatInput:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.send-btn {
  background: #3b82f6 !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

.send-btn:hover {
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.5) !important;
}

/* Pesan user & AI */
.message, .chat-message, [class*="msg-"] {
  color: var(--text-1) !important;
}

.user-message, .msg-user, .message.user {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #bfdbfe !important;
  border: 1px solid rgba(59, 130, 246, 0.25) !important;
}

.ai-message, .msg-ai, .message.ai, .message.assistant {
  background: var(--bg-3) !important;
  color: var(--text-1) !important;
  border: 1px solid var(--border) !important;
}

/* Isi pesan (biasanya div dengan text) */
.chat-messages div {
  color: inherit;
}

/* Loading indicator */
.loading, .typing {
  color: var(--text-2) !important;
}


/* ============================================================
   FORCE CHAT BUBBLE v2 — berdasarkan inspect JS
   ============================================================ */

/* Base untuk semua pesan */
.msg {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.msg .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--bg-3) !important;
  border: 1px solid var(--border) !important;
  flex-shrink: 0;
}

.msg .bubble {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 80%;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* Pesan AI (assistant) — abu gelap */
.msg.assistant .bubble,
.msg.ai .bubble {
  background: var(--bg-3) !important;
  color: var(--text-1) !important;
  border: 1px solid var(--border) !important;
  border-top-left-radius: 4px;
}

/* Pesan user — biru */
.msg.user {
  flex-direction: row-reverse;
}
.msg.user .bubble {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #bfdbfe !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
  border-top-right-radius: 4px;
}

/* Force teks dalam bubble */
.msg .bubble,
.msg .bubble * {
  color: inherit !important;
}

/* Typing indicator */
.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-2) !important;
  animation: typing-bounce 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Chat welcome */
.chat-welcome {
  color: var(--text-2) !important;
}
.chat-welcome h3 {
  color: var(--text-0) !important;
}
.chat-welcome p {
  color: var(--text-2) !important;
}

/* Suggestions */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}
.suggestion {
  background: var(--bg-2) !important;
  color: var(--text-1) !important;
  border: 1px solid var(--border-2) !important;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.suggestion:hover {
  border-color: var(--primary) !important;
  color: #60a5fa !important;
  background: var(--bg-3) !important;
}


/* ============================================================
   FIX TOTAL V2 — Layout Header + Grid
   ============================================================ */

header {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px !important;
  padding: 12px 14px !important;
  border: none !important;
  border-bottom: 1px solid #232b3d !important;
  background: #0f1420 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

header > div:first-child {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  gap: 10px !important;
}

header .logo {
  font-size: 14px !important;
  line-height: 1.3 !important;
  color: #f1f5f9 !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  word-break: break-word !important;
}

header #googleLoginBtn,
header #userChip {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

header > div:nth-child(2) {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}

header .topup-btn,
header .activate-btn {
  padding: 8px 14px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
}

header .credit-badge {
  padding: 6px 12px !important;
  font-size: 13px !important;
}















a[href*="wa.me/6285337548960"] {
  max-width: calc(100% - 28px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

div[style*="text-align:center;margin:20px 0 8px"] {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 0 14px !important;
}

div[style*="text-align:center;margin:20px 0 8px"] > a {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

#footer-admin-contact {
  display: none !important;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
}

* {
  box-sizing: border-box !important;
}


/* ============================================================
   GRID FINAL — DEFINITIF (setelah semua CSS lama dihapus)
   ============================================================ */
.feature-grid-wrapper {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 12px 0 8px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}
.feature-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  padding: 0 12px !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  justify-content: stretch !important;
  align-items: stretch !important;
  justify-items: stretch !important;
}
.feature-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 96px !important;
  background: #151b2b !important;
  border: 1px solid #232b3d !important;
  border-radius: 12px !important;
  padding: 14px 6px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  box-sizing: border-box !important;
  flex: 1 1 auto !important;
  align-self: stretch !important;
  box-shadow: none !important;
  transform: none !important;
  margin: 0 !important;
}
.feature-card:hover {
  border-color: #3b82f6 !important;
  background: #1e2537 !important;
}
.feature-card.active {
  background: #3b82f6 !important;
  border-color: transparent !important;
  box-shadow: 0 6px 18px rgba(30, 58, 138, 0.5) !important;
}
.feature-card .feature-icon {
  font-size: 30px !important;
  line-height: 1 !important;
  margin: 0 !important;
}
.feature-card .feature-label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #e2e8f0 !important;
  text-align: center !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.feature-card.active .feature-label {
  color: #ffffff !important;
}


/* ============================================================
   BORDER-HIGHLIGHT-FINAL — Border + Highlight untuk Feature Card
   ============================================================ */

/* Card Normal — ada border */
.feature-card,
button.feature-card,
html body .feature-card,
html body button.feature-card {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 96px !important;
  background: #151b2b !important;
  border: 1.5px solid #2d3548 !important;
  border-radius: 12px !important;
  padding: 14px 6px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  cursor: pointer !important;
  transition: all 0.25s !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

/* Hover — border biru cerah */
.feature-card:hover,
button.feature-card:hover,
html body .feature-card:hover {
  border-color: #3b82f6 !important;
  background: #1e2537 !important;
  transform: translateY(-1px) !important;
}

/* ACTIVE — background biru tua + border biru cerah */
.feature-card.active,
button.feature-card.active,
html body .feature-card.active,
html body button.feature-card.active {
  background: #3b82f6 !important;
  background-image: none !important;
  background-color: #3b82f6 !important;
  border: 2px solid #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3), 0 6px 18px rgba(59, 130, 246, 0.5) !important;
  transform: translateY(-2px) !important;
}

/* Active hover tetap terang */
.feature-card.active:hover,
button.feature-card.active:hover {
  background: #60a5fa !important;
  border-color: #93c5fd !important;
}

/* Label normal */
.feature-card .feature-label,
html body .feature-card .feature-label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #e2e8f0 !important;
  text-align: center !important;
  line-height: 1.2 !important;
  margin: 0 !important;
}

/* Label active */
.feature-card.active .feature-label,
html body .feature-card.active .feature-label {
  color: #ffffff !important;
  font-weight: 700 !important;
}

/* Icon active */
.feature-card.active .feature-icon,
html body .feature-card.active .feature-icon {
  filter: drop-shadow(0 2px 4px rgba(96, 165, 250, 0.5)) !important;
}


/* ============================================================
   LIGHT BLUE ACTIVE — Final Override
   ============================================================ */
html body .feature-card.active,
html body button.feature-card.active,
html body .feature-grid .feature-card.active {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%) !important;
  background-color: #3b82f6 !important;
  background-image: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%) !important;
  border: 2px solid #93c5fd !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.3), 0 6px 20px rgba(59, 130, 246, 0.45) !important;
  transform: translateY(-2px) !important;
}

html body .feature-card.active .feature-label,
html body button.feature-card.active .feature-label {
  color: #ffffff !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
}

html body .feature-card.active .feature-icon {
  filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.4)) !important;
}


/* ============================================================
   NO-GLOW-FINAL — Hapus efek memencar, biar clean
   ============================================================ */

/* Card Normal — clean border, shadow halus */
html body .feature-card,
html body button.feature-card,
html body .feature-grid > button.feature-card {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 96px !important;
  background: #151b2b !important;
  border: 1.5px solid #2d3548 !important;
  border-radius: 12px !important;
  padding: 14px 6px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  box-shadow: none !important;         /* ← HAPUS shadow */
  transform: none !important;          /* ← HAPUS transform */
  filter: none !important;             /* ← HAPUS filter */
  outline: none !important;            /* ← HAPUS outline */
}

/* Hover — hanya border biru */
html body .feature-card:hover,
html body button.feature-card:hover {
  border-color: #3b82f6 !important;
  background: #1e2537 !important;
  box-shadow: none !important;
  transform: none !important;
}

/* ACTIVE — biru muda SOLID, tanpa glow */
html body .feature-card.active,
html body button.feature-card.active,
html body .feature-grid > button.feature-card.active {
  background: #3b82f6 !important;
  background-color: #3b82f6 !important;
  background-image: none !important;
  border: 2px solid #3b82f6 !important;
  color: #ffffff !important;
  box-shadow: none !important;         /* ← HAPUS glow */
  transform: none !important;          /* ← HAPUS transform */
  outline: none !important;
  filter: none !important;
  text-shadow: none !important;
}

/* Label active */
html body .feature-card.active .feature-label,
html body button.feature-card.active .feature-label {
  color: #ffffff !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}

/* Icon active — tanpa glow */
html body .feature-card.active .feature-icon {
  filter: none !important;
  text-shadow: none !important;
}

/* Hapus pseudo-element yang bikin glow */
html body .feature-card::before,
html body .feature-card::after,
html body .feature-card.active::before,
html body .feature-card.active::after {
  display: none !important;
  content: none !important;
}
