/* -----------------------------------------
   ROOT VARIABLES
------------------------------------------ */
:root {
  --bg1: #050b2a;
  --bg2: #34185b;
  --bg3: #ff5fa2;

  --glass: rgba(15, 23, 42, 0.7);
  --glass-soft: rgba(15, 23, 42, 0.55);

  --border-glass: rgba(148, 163, 184, 0.45);

  --accent: #a855f7;
  --accent-soft: rgba(168, 85, 247, 0.2);
  --accent-secondary: #38bdf8;

  --text-main: #f9fafb;
  --text-soft: #cbd5f5;

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius: 14px;
}

/* RESET */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top left, #ff8ba7 0, transparent 50%),
    radial-gradient(circle at bottom right, #1d4ed8 0, transparent 55%),
    radial-gradient(circle at top right, #6d28d9 0, #020617 70%);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* -----------------------------------------
   ORBIT DECORATION
------------------------------------------ */
.orbits {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.orbit-ring {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  border: 20px solid rgba(236, 72, 153, 0.25);
  filter: blur(1px);
}

.orbit-ring.one {
  right: -120px;
  top: 40%;
  transform: rotate(-20deg);
}

.orbit-ring.two {
  left: -150px;
  top: -80px;
  border-color: rgba(56, 189, 248, 0.25);
  transform: rotate(25deg);
}

/* -----------------------------------------
   APP SHELL
------------------------------------------ */
.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  height: 94vh;
  max-height: 820px;

  padding: 16px 16px 20px;
  border-radius: 40px;

  background: linear-gradient(145deg, rgba(15,23,42,0.9), rgba(15,23,42,0.82));
  border: 1px solid rgba(148,163,184,0.55);
  box-shadow:
    0 40px 120px rgba(15,23,42,0.95),
    0 0 0 1px rgba(15,23,42,0.9);

  backdrop-filter: blur(26px);
  display: flex;
  flex-direction: column;
}

/* MOBILE FIX */
@media (max-width: 600px) {
  .app-shell {
    max-width: none;
    height: 100vh;
    border-radius: 0;
    border-left: none !important;
    border-right: none !important;
  }
}

/* -----------------------------------------
   STATUS BAR
------------------------------------------ */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  opacity: 0.85;
  padding-bottom: 10px;
}

.status-dots {
  display: flex;
  gap: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(248,250,252,0.8);
}

/* -----------------------------------------
   SCREEN WRAPPER
------------------------------------------ */
.screen {
  flex: 1;
  padding: 20px 18px 16px;
  display: none;
  flex-direction: column;
  border-radius: 26px;

  background:
    radial-gradient(circle at top, rgba(129,140,248,0.4), transparent 60%),
    radial-gradient(circle at bottom, rgba(236,72,153,0.4), transparent 60%),
    rgba(15,23,42,0.9);

  border: 1px solid var(--border-glass);

  overflow: hidden;
}

.screen.active {
  display: flex !important;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -----------------------------------------
   BOT HERO (WELCOME)
------------------------------------------ */
.bot-hero {
  width: 150px;
  height: 150px;
  border-radius: 999px;
  margin: 10px auto 18px;

  background: radial-gradient(circle at 30% 0, #f9fafb, #e5e7eb);
  box-shadow:
    0 0 0 8px rgba(15,23,42,0.9),
    0 32px 60px rgba(15,23,42,0.95);

  display: flex;
  align-items: center;
  justify-content: center;

  animation: floatHero 3.8s ease-in-out infinite;
  position: relative;
}

@keyframes floatHero {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.bot-face {
  width: 70%;
  height: 70%;
  border-radius: 30px;
  background: linear-gradient(145deg, #020617, #1e293b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

/* -----------------------------------------
   TITLES
------------------------------------------ */
.title-lg {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
}

.subtitle {
  text-align: center;
  font-size: 13px;
  margin-top: 6px;
  color: var(--text-soft);
}

/* -----------------------------------------
   BUTTONS
------------------------------------------ */
.btn-primary {
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent));
  color: #0b1120;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 14px 35px rgba(59,130,246,0.9);
}

.btn-secondary {
  margin-top: 10px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
  background: rgba(15,23,42,0.9);
  color: var(--text-main);
  cursor: pointer;
}

/* -----------------------------------------
   HOME SCREEN
------------------------------------------ */
.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.screen-header-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-small {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #facc15, #f97373);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #0f172a;
}

.screen-title {
  font-size: 15px;
  font-weight: 600;
}

.screen-sub {
  font-size: 11px;
  color: var(--text-soft);
}

.badge-online {
  background: rgba(34,197,94,0.16);
  border: 1px solid rgba(34,197,94,0.5);
  color: #bbf7d0;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot-green {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
}

/* CARDS */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.45);
  padding: 12px;
  border-radius: 18px;
  display: flex;
  justify-content: space-between;
}

.card-title {
  font-weight: 600;
  font-size: 13px;
}

.card-sub {
  font-size: 11px;
  color: var(--text-soft);
}

.pill-soft {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: radial-gradient(circle at top, rgba(129,140,248,0.45), rgba(56,189,248,0.6));
  color: #0b1120;
  font-weight: 600;
}

/* RECENT LIST */
.section-title {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  text-transform: uppercase;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-item {
  background: rgba(15,23,42,0.85);
  border: 1px solid rgba(148,163,184,0.45);
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
}

/* FOOTER */
.home-footer {
  margin-top: auto;
  text-align: center;
  font-size: 10px;
  color: var(--text-soft);
}

.btn-back {
  margin-top: 8px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.7);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-soft);
  cursor: pointer;
}

/* -----------------------------------------
   CHAT SCREEN
------------------------------------------ */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-row {
  display: flex;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: 75%;
  padding: 10px 12px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.45;
}

.chat-bubble.bot {
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(148,163,184,0.45);
}

.chat-bubble.user {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent));
  border: 1px solid rgba(255,255,255,0.4);
  color: #0b1120;
}

.chat-meta {
  font-size: 10px;
  margin-top: 2px;
  color: rgba(148,163,184,0.9);
}

/* TYPING */
.typing-dots {
  display: inline-flex;
  gap: 4px;
}

.dot-typing {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(248,250,252,0.8);
  opacity: 0.3;
  animation: blink 1s infinite;
}

.dot-typing:nth-child(2) { animation-delay: 0.15s; }
.dot-typing:nth-child(3) { animation-delay: 0.3s; }

@keyframes blink {
  0%,100% { opacity: 0.2; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-1px); }
}

/* INPUT BAR */
.input-bar {
  display: flex;
  align-items: center;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.8);
  border-radius: 999px;
  padding: 8px 10px;
}

.input-main {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
}

.btn-send {
  border: none;
  border-radius: 999px;
  padding: 7px 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: #0b1120;
}

.chat-helper {
  margin-top: 6px;
  font-size: 10px;
  text-align: center;
  opacity: 0.85;
  color: var(--text-soft);
}
/* ============================================================
   FIX BUBBLE CHAT UI — PROFESSIONAL MODERN STYLE
   ============================================================ */

/* USER & BOT BUBBLE — Minimum size */
.chat-bubble {
  min-width: 86px;
  min-height: 38px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  word-break: break-word;
}

/* USER BUBBLE (kanan) */
.chat-row.user .chat-bubble {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent));
  color: #0b1120;
  border: 1px solid rgba(255,255,255,0.45);

  /* Rounded asymmetric (chat modern) */
  border-radius: 18px 18px 4px 18px !important;
}

/* BOT BUBBLE (kiri) */
.chat-row.bot .chat-bubble {
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(148,163,184,0.45);
  color: #e5e7eb;

  /* Rounded asymmetric (chat modern) */
  border-radius: 18px 18px 18px 4px !important;
}

/* ALIGNMENT FIX */
.chat-row {
  display: flex;
  width: 100%;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-row.bot {
  justify-content: flex-start;
}

/* META (AI/You · now) */
.chat-meta {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(148,163,184,0.75);
}

/* TYPING INDICATOR — LEBIH HIDUP */
.dot-typing {
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.8);
  opacity: 0.35;
  animation: blink 1s infinite ease-in-out;
}
