/* PROMO WIDGET */
#promo-widget{
  position:fixed;
  bottom:90px;
  right:20px;
  width:320px;
  background:white;
  border-radius:15px;
  box-shadow:0 10px 30px rgba(0,0,0,0.3);
  animation:fadeIn 0.3s ease;
  z-index:9998;
}

.promo-content{
  padding:20px;
  position:relative;
}

.promo-content h3{
  margin-top:0;
  color:#075E54;
}

.promo-btn{
  display:inline-block;
  margin-top:10px;
  padding:10px 15px;
  background:#25D366;
  color:white;
  text-decoration:none;
  border-radius:8px;
  transition:0.2s;
}

.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 */
#chat-box{
  position:fixed;
  bottom:20px;
  right:20px;
  width:320px;
  height:min(450px, calc(100vh - 40px));
  max-height:calc(100vh - 40px);
  background:#fff;
  border-radius:15px;
  box-shadow:0 10px 30px rgba(0,0,0,0.3);
  display:none;
  flex-direction:column;
  overflow:hidden;
  animation:fadeIn 0.3s ease;
  z-index:9999;
  box-sizing:border-box;
}

#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;
}
.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:20px;
  width:320px;
  display:none;
  z-index:10001;
  background:#fff;
  padding:10px;
  border-radius:10px;
  box-shadow:0 6px 18px rgba(0,0,0,0.18);
  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:#eef2ff;
  border-bottom-left-radius:3px;
  margin-right:auto;
  border:1px solid rgba(59,130,246,0.18);
}

/* 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);
}

/* Responsive Mobile */
@media(max-width:480px){
  #chat-box{
    width:95%;
    right:2.5%;
    bottom:80px;
  }
}

/* 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:320px;
    max-width:calc(100vw - 20px);
    box-sizing:border-box;
}

.promo-content{
    padding:20px;
    word-break:break-word;
    overflow-wrap:anywhere;
}

.promo-text{
    white-space:normal;
    line-height:1.5;
    overflow-wrap:anywhere;
    word-break:break-word;
}

@media (max-width:480px){
    #promo-widget{
        width:calc(100% - 20px);
        left:10px;
        right:10px;
        bottom:80px;
    }
}