/* ============================================
   KUSH ERP — Support Chat Widget
   ============================================ */

/* Floating button */
#kush-chat-btn {
  position: fixed;
  bottom: 28px; left: 28px;
  width: 60px; height: 60px;
  background: linear-gradient(135deg, #57917b 0%, #3d7a62 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(87,145,123,.55);
  z-index: 9998;
  transition: transform .25s, box-shadow .25s;
  animation: kush-pulse 3s ease-in-out infinite;
}
#kush-chat-btn:hover { transform: scale(1.1); box-shadow: 0 8px 32px rgba(87,145,123,.7); }
@keyframes kush-pulse {
  0%,100% { box-shadow: 0 6px 24px rgba(87,145,123,.55); }
  50%      { box-shadow: 0 6px 24px rgba(87,145,123,.55), 0 0 0 10px rgba(87,145,123,.12); }
}

/* Notification dot */
#kush-notif-dot {
  position: absolute; top: 1px; right: 1px;
  width: 14px; height: 14px;
  background: #f0a500;
  border-radius: 50%; border: 2px solid #fff;
  display: none;
  animation: kush-bounce .6s ease-in-out infinite alternate;
}
@keyframes kush-bounce { from { transform: scale(.8); } to { transform: scale(1.1); } }

/* Chat box */
#kush-chat-box {
  position: fixed;
  bottom: 100px; left: 24px;
  width: 350px; max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,34,42,.22);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d4e8e0;
}
#kush-chat-box.kush-open { display: flex; }

/* Header */
#kush-chat-head {
  background: linear-gradient(135deg, #00222a 0%, #57917b 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}

/* Messages area */
#kush-msgs {
  flex: 1; overflow-y: auto;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: #f7faf8;
  min-height: 60px; max-height: 200px;
}
.km { display: flex; }
.km-bot { justify-content: flex-start; }
.km-user { justify-content: flex-end; }
.km-b {
  max-width: 85%; padding: 9px 13px;
  border-radius: 14px; font-size: .84rem; line-height: 1.55;
}
.km-bot .km-b {
  background: #fff; color: #1a2e26;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,34,42,.08);
}
.km-user .km-b {
  background: #57917b; color: #fff;
  border-bottom-right-radius: 4px;
}

/* Quick service buttons */
#kush-quick-panel {
  padding: 14px 16px;
  border-top: 1px solid #e8eee9;
  background: #fff;
}
#kush-service-btns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px;
}
.kush-qbtn {
  background: #f0f6f2;
  color: #3d6b55;
  border: 1.5px solid #d4e8e0;
  border-radius: 10px;
  padding: 9px 8px;
  font-size: .79rem; font-weight: 600;
  cursor: pointer; text-align: center;
  transition: all .2s;
  font-family: 'Poppins', sans-serif;
  line-height: 1.3;
}
.kush-qbtn:hover { background: #57917b; color: #fff; border-color: #57917b; transform: translateY(-1px); }

/* Form panel */
#kush-form-panel {
  padding: 14px 16px;
  border-top: 1px solid #e8eee9;
  background: #fff;
}

/* Inputs */
.kush-inp {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid #d4e8e0; border-radius: 9px;
  font-size: .84rem; font-family: 'Poppins', sans-serif;
  outline: none; box-sizing: border-box;
  transition: border-color .2s;
}
.kush-inp:focus { border-color: #57917b; box-shadow: 0 0 0 3px rgba(87,145,123,.12); }
.kush-inp.err { border-color: #e53e3e !important; }

/* Submit button */
#kush-submit-btn {
  background: linear-gradient(135deg, #57917b, #3d7a62);
  color: #fff; border: none; border-radius: 9px;
  padding: 11px 16px; font-size: .88rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-family: 'Poppins', sans-serif;
  transition: all .3s; width: 100%;
}
#kush-submit-btn:hover { background: linear-gradient(135deg, #3d7a62, #00222a); transform: translateY(-1px); }
#kush-submit-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Typing dots */
.kush-dots { display: inline-flex; gap: 4px; align-items: center; padding: 4px 2px; }
.kush-dots span {
  width: 7px; height: 7px; background: #57917b; border-radius: 50%;
  animation: kush-dot 1.2s ease-in-out infinite;
}
.kush-dots span:nth-child(2) { animation-delay: .2s; }
.kush-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes kush-dot {
  0%,80%,100% { transform: scale(.7); opacity: .5; }
  40%          { transform: scale(1); opacity: 1; }
}

@media(max-width:480px) {
  #kush-chat-box { left: 8px; bottom: 90px; width: calc(100vw - 16px); }
  #kush-chat-btn { left: 14px; bottom: 18px; width: 54px; height: 54px; }
  #kush-service-btns { grid-template-columns: 1fr; }
}
