/* ==========================================
   CHATBOT - LEFT SIDE (MATCHING TAWK BOTTOM)
========================================== */

.chatbot-wrapper {
  position: fixed;
  bottom: 20px;      /* Tawk ke barabar */
  left: 30px;
  right: auto;
  z-index: 99999;
  font-family: 'Poppins', sans-serif;
}

/* ==========================================
   TOGGLE BUTTON - CIRCULAR TEXT
========================================== */
#chatbotToggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 120px;
  height: 120px;
  padding: 0;
  transition: 0.3s ease;
  animation: chatbotPulse 2s infinite;
}

#chatbotToggle:hover {
  transform: scale(1.05);
}

/* ==========================================
   CIRCULAR TEXT - "Chat on WhatsApp"
========================================== */
#chatbotToggle .circle-text {
  position: absolute;
  width: 120px;
  height: 120px;
  animation: spinText 20s linear infinite;
}

#chatbotToggle .circle-text svg {
  width: 120px;
  height: 120px;
}

#chatbotToggle .circle-text text {
  fill: #c9a84c;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
}

#chatbotToggle:hover .circle-text {
  animation-duration: 8s;
}

@keyframes spinText {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==========================================
   LOGO - CENTER
========================================== */
#chatbotToggle img {
  position: relative;
  z-index: 2;
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: rgb(2, 22, 75);
  border-radius: 50%;
  padding: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  border: 3px solid #c9a84c;
}

@keyframes chatbotPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

/* ==========================================
   CHATBOX
========================================== */
.chatbot-box {
  position: fixed;
  bottom: 145px;
  left: 30px;
  right: auto;
  width: 370px;
  height: 580px;
  background: white;
  border-radius: 24px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-box.active {
  display: flex;
  animation: chatbotFade 0.35s ease;
}

@keyframes chatbotFade {
  from {
    opacity: 0;
    transform: translateY(25px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================
   HEADER
========================================== */
.chatbot-header {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #c9a84c;
}

.chatbot-header strong {
  font-size: 20px;
  font-weight: 700;
}

.chatbot-header p {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.85;
}

#chatbotClose {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: 0.3s;
}

#chatbotClose:hover {
  transform: rotate(90deg);
  color: #c9a84c;
}

/* ==========================================
   MESSAGES
========================================== */
.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: linear-gradient(to bottom, #f8fafc, #eef2f7);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==========================================
   MESSAGE
========================================== */
.chat-message {
  max-width: 85%;
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.6;
  font-size: 14px;
  word-wrap: break-word;
  animation: messageFade 0.25s ease;
}

@keyframes messageFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   BOT MESSAGE
========================================== */
.chat-message.bot {
  background: white;
  color: #0f172a;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* ==========================================
   USER MESSAGE
========================================== */
.chat-message.user {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}

/* ==========================================
   TYPING LOADER
========================================== */
.chat-message.typing-loader {
  background: white;
  color: #999;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  font-style: italic;
  animation: pulseLoader 1.2s infinite;
}

@keyframes pulseLoader {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* ==========================================
   INPUT AREA
========================================== */
.chatbot-input-area {
  padding: 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  background: white;
}

/* ==========================================
   INPUT
========================================== */
#chatbotInput {
  flex: 1;
  height: 50px;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  padding: 0 16px;
  outline: none;
  font-size: 14px;
  transition: 0.3s ease;
}

#chatbotInput:focus {
  border-color: #c9a84c;
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

#chatbotInput:disabled {
  opacity: 0.6;
}

/* ==========================================
   SEND BUTTON
========================================== */
#chatbotSend {
  min-width: 95px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #c9a84c, #f5d742);
  color: #0f172a;
  cursor: pointer;
  font-weight: 700;
  transition: 0.3s ease;
}

#chatbotSend:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.4);
}

#chatbotSend:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================
   SCROLLBAR
========================================== */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #c9a84c;
  border-radius: 20px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 20px;
}

/* ==========================================
   ========== RESPONSIVE ==========
========================================== */

/* ----- TABLET (1024px) ----- */
@media (max-width: 1024px) {
  .chatbot-wrapper {
    bottom: 20px;
    left: 25px;
  }

  .chatbot-box {
    width: 360px;
    height: 560px;
    left: 25px;
    bottom: 145px;
  }

  #chatbotToggle {
    width: 110px;
    height: 110px;
  }

  #chatbotToggle .circle-text {
    width: 110px;
    height: 110px;
  }

  #chatbotToggle .circle-text svg {
    width: 110px;
    height: 110px;
  }

  #chatbotToggle .circle-text text {
    font-size: 10px;
  }

  #chatbotToggle img {
    width: 50px;
    height: 50px;
    padding: 6px;
  }
}

/* ----- MOBILE (768px) ----- */
@media (max-width: 768px) {
  .chatbot-wrapper {
    bottom: 16px;
    left: 16px;
  }

  #chatbotToggle {
    width: 100px;
    height: 100px;
  }

  #chatbotToggle .circle-text {
    width: 100px;
    height: 100px;
  }

  #chatbotToggle .circle-text svg {
    width: 100px;
    height: 100px;
  }

  #chatbotToggle .circle-text text {
    font-size: 9px;
    letter-spacing: 1px;
  }

  #chatbotToggle img {
    width: 44px;
    height: 44px;
    padding: 5px;
    border-width: 2px;
  }

  .chatbot-box {
    position: fixed;
    left: 16px;
    right: auto;
    bottom: 130px;
    width: calc(100vw - 32px);
    max-width: 420px;
    height: 70vh;
    max-height: 560px;
    border-radius: 22px;
  }

  .chatbot-header {
    padding: 16px 18px;
  }

  .chatbot-header strong {
    font-size: 18px;
  }

  .chatbot-header p {
    font-size: 12px;
  }

  #chatbotClose {
    font-size: 22px;
  }

  .chatbot-messages {
    padding: 16px;
    gap: 12px;
  }

  .chat-message {
    max-width: 88%;
    font-size: 14px;
    padding: 12px 15px;
    border-radius: 16px;
  }

  .chatbot-input-area {
    padding: 12px 16px;
    gap: 10px;
  }

  #chatbotInput {
    height: 46px;
    font-size: 14px;
    padding: 0 14px;
    border-radius: 12px;
  }

  #chatbotSend {
    min-width: 80px;
    font-size: 14px;
    border-radius: 12px;
  }
}

/* ----- SMALL MOBILE (480px) ----- */
@media (max-width: 480px) {
  .chatbot-wrapper {
    bottom: 14px;
    left: 14px;
  }

  #chatbotToggle {
    width: 85px;
    height: 85px;
  }

  #chatbotToggle .circle-text {
    width: 85px;
    height: 85px;
  }

  #chatbotToggle .circle-text svg {
    width: 85px;
    height: 85px;
  }

  #chatbotToggle .circle-text text {
    font-size: 7.5px;
    letter-spacing: 0.8px;
  }

  #chatbotToggle img {
    width: 38px;
    height: 38px;
    padding: 4px;
    border-width: 2px;
  }

  .chatbot-box {
    position: fixed;
    left: 10px;
    right: auto;
    bottom: 105px;
    width: calc(100vw - 20px);
    max-width: 360px;
    height: 65vh;
    max-height: 520px;
    border-radius: 18px;
  }

  .chatbot-header {
    padding: 14px 16px;
  }

  .chatbot-header strong {
    font-size: 16px;
  }

  .chatbot-header p {
    font-size: 11px;
    margin-top: 2px;
  }

  #chatbotClose {
    font-size: 20px;
  }

  .chatbot-messages {
    padding: 12px 14px;
    gap: 10px;
  }

  .chat-message {
    max-width: 92%;
    font-size: 13px;
    padding: 10px 13px;
    border-radius: 14px;
  }

  .chatbot-input-area {
    padding: 10px 12px;
    gap: 8px;
  }

  #chatbotInput {
    height: 42px;
    font-size: 13px;
    padding: 0 12px;
    border-radius: 10px;
  }

  #chatbotSend {
    min-width: 68px;
    font-size: 13px;
    border-radius: 10px;
    padding: 0 14px;
  }
}

/* ----- VERY SMALL (360px) ----- */
@media (max-width: 360px) {
  .chatbot-wrapper {
    bottom: 10px;
    left: 10px;
  }

  #chatbotToggle {
    width: 75px;
    height: 75px;
  }

  #chatbotToggle .circle-text {
    width: 75px;
    height: 75px;
  }

  #chatbotToggle .circle-text svg {
    width: 75px;
    height: 75px;
  }

  #chatbotToggle .circle-text text {
    font-size: 6.5px;
    letter-spacing: 0.5px;
  }

  #chatbotToggle img {
    width: 32px;
    height: 32px;
    padding: 3px;
    border-width: 1.5px;
  }

  .chatbot-box {
    left: 6px;
    right: auto;
    bottom: 95px;
    width: calc(100vw - 12px);
    max-width: 320px;
    height: 60vh;
    max-height: 460px;
    border-radius: 16px;
  }

  .chatbot-header {
    padding: 12px 14px;
  }

  .chatbot-header strong {
    font-size: 15px;
  }

  #chatbotClose {
    font-size: 18px;
  }

  .chatbot-messages {
    padding: 10px 12px;
    gap: 8px;
  }

  .chat-message {
    max-width: 95%;
    font-size: 12px;
    padding: 8px 11px;
    border-radius: 12px;
  }

  .chatbot-input-area {
    padding: 8px 10px;
    gap: 6px;
  }

  #chatbotInput {
    height: 38px;
    font-size: 12px;
    padding: 0 10px;
    border-radius: 8px;
  }

  #chatbotSend {
    min-width: 58px;
    font-size: 12px;
    border-radius: 8px;
    padding: 0 10px;
  }
}

/* ----- SHORT HEIGHT PHONES ----- */
@media (max-height: 750px) {
  .chatbot-box {
    height: 58vh !important;
    max-height: 480px !important;
    bottom: 105px;
  }
}

@media (max-height: 650px) {
  .chatbot-box {
    height: 50vh !important;
    max-height: 400px !important;
    bottom: 95px;
  }
}

/* ----- LANDSCAPE MODE ----- */
@media (max-height: 500px) and (orientation: landscape) {
  .chatbot-box {
    height: 72vh !important;
    max-height: 360px !important;
    bottom: 95px;
    width: 55vw !important;
    max-width: 420px;
  }

  .chatbot-messages {
    padding: 8px 14px;
    gap: 6px;
  }

  .chat-message {
    font-size: 12px;
    padding: 6px 10px;
  }

  .chatbot-header {
    padding: 8px 14px;
  }

  .chatbot-header strong {
    font-size: 14px;
  }

  .chatbot-header p {
    display: none;
  }

  #chatbotInput {
    height: 34px;
    font-size: 12px;
    padding: 0 10px;
  }

  #chatbotSend {
    min-width: 56px;
    font-size: 12px;
    padding: 0 10px;
  }

  .chatbot-input-area {
    padding: 6px 10px;
    gap: 6px;
  }

  #chatbotToggle {
    width: 70px;
    height: 70px;
  }

  #chatbotToggle .circle-text {
    width: 70px;
    height: 70px;
  }

  #chatbotToggle .circle-text svg {
    width: 70px;
    height: 70px;
  }

  #chatbotToggle .circle-text text {
    font-size: 6px;
    letter-spacing: 0.5px;
  }

  #chatbotToggle img {
    width: 30px;
    height: 30px;
    padding: 3px;
  }
}