* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 0 0, #1d2439 0, #020617 55%, #000 100%);
  color: #f9fafb;
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 520px;
  padding: 28px 16px 40px;
}

/* ---------- Header ---------- */

.app-header h1 {
  font-size: 1.8rem;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-header .emoji {
  font-size: 1.5rem;
}

.subtitle {
  font-size: 0.9rem;
  color: #9ca3af;
  margin: 0 0 16px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
}

/* ---------- Card / Form ---------- */

.card {
  background: rgba(15, 23, 42, 0.96);
  padding: 16px 14px 18px;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  gap: 4px;
}

input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #374151;
  background: #020617;
  color: #f9fafb;
  font-size: 0.95rem;
}

input::placeholder {
  color: #6b7280;
}

input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px #38bdf8;
}

button {
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #f9fafb;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.15s;
  box-shadow: 0 12px 25px rgba(22, 163, 74, 0.35);
}

button:hover {
  opacity: 0.96;
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(22, 163, 74, 0.5);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.25);
}

/* ---------- Result ---------- */

.result {
  margin-top: 18px;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 18px;
  padding: 14px 14px 16px;
  border: 1px solid rgba(55, 65, 81, 0.9);
}

.result h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.result p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.result ul {
  list-style: none;
  padding-left: 16px;
  margin: 0;
  font-size: 0.95rem;
}

.result ul li::marker {
  color: #22c55e;
}

.hidden {
  display: none;
}

/* ---------- History ---------- */

.history {
  margin-top: 20px;
  background: rgba(2, 6, 23, 0.9);
  border-radius: 18px;
  padding: 14px 14px 16px;
  border: 1px solid #1f2937;
}

.history h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.history-empty {
  margin: 0;
  font-size: 0.82rem;
  color: #9ca3af;
}

#history-list {
  list-style: none;
  padding-left: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  padding: 8px 10px;
  border-radius: 12px;
  background: #020617;
  border: 1px solid #111827;
  font-size: 0.9rem;
}

.history-main {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 8px;
}

.history-name {
  font-weight: 600;
}

.history-amount {
  font-weight: 500;
  color: #a5b4fc;
}

.history-meta {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* ---------- Responsive ---------- */

@media (min-width: 600px) {
  .app {
    padding-top: 40px;
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.history-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.btn-secondary {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}

.btn-secondary:hover {
  background: #111827;
  border-color: #9ca3af;
}

.bot-section {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 3rem;
  align-items: center;
  justify-content: center;
}

/* Text describe for bot */
.bot-text {
  max-width: 420px;
  font-size: 16px;
  line-height: 1.6;
}

.bot-text h2 {
  font-size: 24px;
  margin-bottom: 0.5rem;
}

.bot-text ul {
  padding-left: 1.2rem;
  margin: 0.8rem 0 1.2rem;
}

.bot-text code {
  background: #818080;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
}

/* Button add friend Bot in LINE */
.btn-line {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: #06c755;         /* Green LINE app*/
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-line:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}

/* Mockup chat zone*/
.bot-mockup {
  flex: 0 0 260px;
}

.phone-frame {
  width: 260px;
  height: 460px;
  border-radius: 30px;
  padding: 12px;
  background: #111;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
}

.chat-header {
  height: 40px;
  border-radius: 20px;
  background: #222;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-bottom: 8px;
}

.chat-body {
  flex: 1;
  background: #1f2933;
  border-radius: 22px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  font-size: 13px;
}

/* bubble */
.chat-bubble {
  max-width: 90%;
  padding: 8px 10px;
  border-radius: 16px;
  line-height: 1.4;
}

.chat-bubble.bot {
  background: #374151;
  color: #f9fafb;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  background: #4ade80;
  color: #064e3b;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Provides flexible layout on mobile devices */
@media (max-width: 768px) {
  .bot-section {
    flex-direction: column;
    align-items: stretch;
  }
  
  .bot-text {
    max-width: 100%;
  }
  
  .bot-mockup {
    align-self: center;
  }
}
