/* ---------------------------------------------
   DiPStrategy -- DARA Chat Widget
   style/dara.css
   --------------------------------------------- */

.dara-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 360px;
  pointer-events: none; /* tidak blokir klik saat chat tertutup */
}

.dara-box {
  width: 100%;
  background: #05213F;
  border-radius: 16px;
  border: 1px solid rgba(222,255,45,0.15);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 520px;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.22,1,0.36,1),
              transform 0.3s cubic-bezier(0.22,1,0.36,1);
  transform-origin: bottom right;
}

.dara-box.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all; /* aktifkan klik hanya saat terbuka */
}

.dara-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.dara-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dara-avatar {
  position: relative;
  width: 36px; height: 36px;
  background: rgba(222,255,45,0.1);
  border-radius: 50%;
  border: 1.5px solid rgba(222,255,45,0.25);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.dara-avatar img { width: 18px; height: 18px; }

.dara-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 9px; height: 9px;
  background: #DEFF2D;
  border-radius: 50%;
  border: 2px solid #05213F;
  animation: daraPulse 2s infinite;
}

@keyframes daraPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.dara-name {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: #DEFF2D;
}

.dara-subtitle {
  display: block;
  font-size: 9px;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  margin-top: 1px;
}

.dara-close {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.06);
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: rgba(255,255,255,0.5);
  transition: background 0.2s, color 0.2s;
}

.dara-close:hover { background: rgba(255,255,255,0.12); color: #fff; }
.dara-close svg { width: 14px; height: 14px; }

.dara-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.dara-messages::-webkit-scrollbar { width: 3px; }
.dara-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.dara-msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: daraMsgIn 0.25s ease;
}

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

.dara-msg--bot  { align-items: flex-start; }
.dara-msg--user { align-items: flex-end; }

.dara-bubble {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 12px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  line-height: 1.6;
}

.dara-msg--bot  .dara-bubble { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.88); border-bottom-left-radius: 3px; }
.dara-msg--user .dara-bubble { background: #DEFF2D; color: #05213F; font-weight: 500; border-bottom-right-radius: 3px; }

.dara-time {
  font-family: 'Barlow', sans-serif;
  font-size: 10px;
  color: rgba(255,255,255,0.2);
  padding: 0 3px;
}

.dara-typing {
  display: flex; align-items: center; gap: 5px;
  padding: 10px 14px;
}

.dara-typing span {
  width: 6px; height: 6px;
  background: rgba(222,255,45,0.5);
  border-radius: 50%;
  animation: daraTyping 1.2s infinite;
}

.dara-typing span:nth-child(2) { animation-delay: 0.2s; }
.dara-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes daraTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

.dara-chips {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 4px;
}

.dara-chip {
  font-family: 'Barlow', sans-serif;
  font-size: 11px; font-weight: 500; letter-spacing: 0.04em;
  color: #DEFF2D;
  background: rgba(222,255,45,0.08);
  border: 1px solid rgba(222,255,45,0.2);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.dara-chip:hover { background: rgba(222,255,45,0.15); border-color: rgba(222,255,45,0.45); }

.dara-input-wrap {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.12);
  flex-shrink: 0;
}

.dara-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px 12px;
  color: rgba(255,255,255,0.88);
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  resize: none; outline: none;
  min-height: 36px; max-height: 90px;
  transition: border-color 0.2s;
}

.dara-input::placeholder { color: rgba(255,255,255,0.22); }
.dara-input:focus { border-color: rgba(222,255,45,0.35); }

.dara-send {
  width: 36px; height: 36px;
  background: #DEFF2D;
  border: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; color: #05213F;
  transition: background 0.2s, transform 0.15s;
}

.dara-send:hover { background: #f0ff50; transform: scale(1.05); }
.dara-send svg { width: 15px; height: 15px; }

.dara-footer {
  font-family: 'Barlow', sans-serif;
  font-size: 10px;
  color: rgba(255,255,255,0.18);
  text-align: center;
  padding: 7px 14px 9px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.dara-footer a { color: rgba(222,255,45,0.45); text-decoration: none; }
.dara-footer a:hover { color: #DEFF2D; }

/* --- FLOATING FAB (muncul saat hero button hilang dari viewport) --- */
.dara-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 998;
  width: 52px;
  height: 52px;
  background: #DEFF2D;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(222,255,45,0.35);
  pointer-events: none;
  opacity: 0;
  transform: translateX(80px);
  transition: opacity 0.35s cubic-bezier(0.22,1,0.36,1),
              transform 0.35s cubic-bezier(0.22,1,0.36,1);
}

.dara-fab.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

.dara-fab:hover {
  background: #f0ff50;
  transform: translateX(0) scale(1.08);
  box-shadow: 0 12px 36px rgba(222,255,45,0.5);
}

.dara-fab img {
  width: 24px;
  height: 24px;
}

@media (max-width: 480px) {
  .dara-widget { bottom: 16px; right: 16px; left: 16px; width: auto; }
  .dara-fab { bottom: 16px; right: 16px; }
}
