/* PROMO WIDGET */
#promo-widget{
  position:fixed;
  bottom:90px;
  right:20px;
  width:480px; /* wider on desktop */
  max-width:calc(100vw - 40px);
  background:white;
  border-radius:15px;
  box-shadow:0 12px 36px rgba(0,0,0,0.35);
  animation:fadeIn 0.3s ease;
  z-index:10002; /* ensure promo sits above chat-toggle/chat-box */
}

.promo-content{
  padding:26px 24px;
  position:relative;
}

.promo-content h3{
  margin-top:0;
  color:#075E54;
  font-size:18px;
  line-height:1.2;
}

.promo-btn{
  display:inline-block;
  margin-top:14px;
  padding:12px 18px;
  background:#25D366;
  color:white;
  text-decoration:none;
  border-radius:10px;
  transition:0.18s;
  font-size:15px;
  cursor:pointer;
}

.promo-btn:hover{
  transform:scale(1.05);
}

.close-btn{
  position:absolute;
  top:10px;
  right:15px;
  cursor:pointer;
  font-size:14px;
}

/* Floating Button */
#chat-toggle{
  position:fixed;
  bottom:20px;
  right:20px;
  background:#25D366;
  color:#fff;
  width:60px;
  height:60px;
  border-radius:50%;
  display:flex;
  justify-content:center;
  align-items:center;
  font-size:26px;
  cursor:pointer;
  box-shadow:0 5px 15px rgba(0,0,0,0.3);
  transition:0.3s;
  z-index:9999;
}

#chat-toggle:hover{
  transform:scale(1.1);
}

#chat-box.show{
  display:flex;
}

/* Header */
#chat-header{
  flex:0 0 auto;
  background:#075E54;
  color:#fff;
  padding:12px 15px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-weight:bold;
  font-size:14px;
}
#chat-header span:first-child{
  display:inline-block;
  max-width:calc(100% - 40px);
  white-space:normal;
  overflow-wrap:break-word;
  word-break:break-word;
}

#minimize-chat{
  cursor:pointer;
  font-size:20px;
  transition:0.2s;
}

#minimize-chat:hover{
  transform:scale(1.2);
}

/* Messages Area */
#chat-messages{
  flex:1 1 auto;
  min-height:0;
  padding:10px 10px 18px;
  background:#ece5dd;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  scroll-behavior:smooth;
  box-sizing:border-box;
}

/* Custom Scrollbar */
#chat-messages::-webkit-scrollbar{
  width:5px;
}
#chat-messages::-webkit-scrollbar-thumb{
  background:#ccc;
  border-radius:10px;
}

/* Bubble */
.msg{
  display:flex;
  flex-direction:column;
  max-width:85%;
  padding:10px 14px;
  margin:6px 0;
  border-radius:15px;
  font-size:14px;
  line-height:1.5;
  color:#111;
  font-weight:400;
  white-space:pre-wrap;
  word-break:break-word;
  overflow-wrap:break-word;
}
.msg-name{
  font-size:8px;
  font-weight:500;
  margin-bottom:6px;
  color:#8a8080;
}
.msg-text{
  margin:0;
  padding:0;
  overflow:visible;
}
.msg-image-wrap{
  display:inline-flex;
  max-width:100%;
  margin-top:6px;
  padding:4px;
  border-radius:14px;
  background:rgba(255,255,255,0.72);
  border:1px solid rgba(0,0,0,0.06);
}
.msg-image{
  display:block;
  width:min(240px, 100%);
  max-width:240px;
  max-height:280px;
  height:auto;
  border-radius:10px;
  object-fit:contain;
  background:#f7f7f7;
  box-shadow:0 2px 8px rgba(0,0,0,0.12);
}
.msg-time{
  display:inline-block;
  margin-top:6px;
  font-size:12px;
  color:#667781;
  text-align:right;
  line-height:1;
  align-self:flex-end;
}
.pre-chat{
  padding:10px 14px;
  color:#333;
  font-weight:600;
  background:transparent;
  text-align:left;
}

.name-prompt {
    position: fixed;
    bottom: 140px;
    right: 30px;
    width: 320px;
    display: none;
    z-index: 10001;
    background: #12225d;
    padding: 20px;
    border-radius: 10px;
    box-shadow: inset 5px 3px 2px 2px rgb(20 255 19 / 64%);
    align-items: center;
    gap: 8px;
}
.name-prompt input{
  flex:1;
  padding:8px 10px;
  border:1px solid #ddd;
  border-radius:6px;
}
.name-prompt button{
  background:#25D366;
  border:none;
  color:#fff;
  padding:8px 10px;
  border-radius:6px;
  cursor:pointer;
}
.name-prompt button#cancel-name{ background:#ccc; color:#222; margin-left:6px }
.user,
.admin{
  min-width:40px;
}
/* User Bubble */
/* User bubble (pengirim) */
.user{
  align-self:flex-end;
  background:#dcf8c6;
  border-bottom-right-radius:3px;
  margin-left:auto;
}

/* Admin Bubble */
.admin{
  align-self:flex-start;
  background:#fff;
  border-bottom-left-radius:3px;
  margin-right:auto;
}

.bot {
    align-self: flex-start;
    background: #fff;
    border-bottom-left-radius: 3px;
    margin-right: auto;
}

/* Input Area */
#chat-input{
  flex:0 0 auto;
  margin:0;
  display:flex;
  padding:8px;
  background:#f0f0f0;
  box-sizing:border-box;
}

#chat-input input{
  flex:1;
  padding:8px 12px;
  border-radius:20px;
  border:none;
  outline:none;
  font-size:14px;
}

#chat-input button{
  background:#25D366;
  border:none;
  color:white;
  margin-left:6px;
  border-radius:50%;
  width:36px;
  height:36px;
  cursor:pointer;
  transition:0.2s;
}

#chat-input button:hover{
  transform:scale(1.1);
}

#chat-input button:disabled{
  cursor:not-allowed;
  opacity:.6;
  transform:none;
}


/* Animations */
@keyframes fadeIn{
  from{opacity:0; transform:translateY(15px);}
  to{opacity:1; transform:translateY(0);}
}

@keyframes pop{
  from{transform:scale(0.9); opacity:0;}
  to{transform:scale(1); opacity:1;}
}
div, a, p, img, blockquote, form, fieldset, textarea, input, label, iframe, code, pre, select {

  overflow: visible;

} *
#promo-widget{
  position:fixed;
  right:20px;
  bottom:90px;
  width:480px;
  max-width:calc(100vw - 24px);
  box-sizing:border-box;
}

.promo-content{
  padding:22px;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.promo-text{
  white-space:normal;
  line-height:1.5;
  overflow-wrap:anywhere;
  word-break:break-word;
  font-size:15px;
}

@media (max-width:480px){
  #promo-widget{
    width:calc(100% - 24px);
    left:12px;
    right:12px;
    bottom:80px;
  }
  .promo-content{ padding:18px; }
  .promo-content h3{ font-size:16px; }
  .promo-text{ font-size:15px; }
  .promo-btn{ padding:12px 16px; font-size:15px; }
}
.msg-text a {
    color: #0066ff;
    text-decoration: underline;
    cursor: pointer;
    pointer-events: auto;
    word-break: break-all;
}
