:root {
  --iscb-primary: #1a73e8;
  --iscb-window-bg: #ffffff;
  --iscb-header-text: #ffffff;
  --iscb-bot-bubble-bg: #f1f3f4;
  --iscb-bot-bubble-text: #202124;
  --iscb-user-bubble-bg: var(--iscb-primary);
  --iscb-user-bubble-text: #ffffff;
  --iscb-border-radius: 16px;
  --iscb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --iscb-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.08);
}

#iscb_chat_launcher {
	position: fixed;
	bottom: 100px;
	right: 20px;
	z-index: 999990;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--iscb-primary) !important;
	color: #ffffff;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease;
	border: none;
	outline: none;
	padding: 0;
}

#iscb_chat_launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

#iscb_chat_launcher.iscb_pos_left {
  right: auto !important;
  left: 20px !important;
}

#iscb_chat_launcher svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

#iscb_chat_launcher .iscb_icon_close {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  z-index: 3;
}

#iscb_chat_launcher.iscb_active .iscb_icon_chat {
  display: flex;
}

#iscb_chat_launcher.iscb_active .iscb_icon_close {
  display: flex;
}

#iscb_chat_launcher .iscb_unread_badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #ff3b30;
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: block;
  z-index: 2;
}

#iscb_chat_window {
	position: fixed;
	bottom: 170px;
	right: 20px;
	z-index: 999991;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: calc( 100vh - 210px );
	max-height: calc(100vh - 180px);
	background: var(--iscb-window-bg);
	border-radius: var(--iscb-border-radius);
	box-shadow: var(--iscb-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-family: var(--iscb-font);
	opacity: 0;
	visibility: hidden;
	transform: translateY(20px) scale(0.95);
	transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
	max-height: 500px;
}

.iscb_icon_chat, .iscb_icon_close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.iscb_launcher_avatar_img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

#iscb_chat_window.iscb_pos_left {
  right: auto !important;
  left: 20px !important;
}

#iscb_chat_window.iscb_open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

@media (max-width: 600px) {
  #iscb_chat_launcher {
    bottom: 75px !important;
    width: 54px !important;
    height: 54px !important;
  }

  #iscb_chat_launcher.iscb_pos_left {
    left: 12px !important;
    right: auto !important;
  }

  #iscb_chat_launcher.iscb_pos_right {
    right: 12px !important;
    left: auto !important;
  }

  #iscb_chat_window {
    bottom: 140px !important;
    left: 10px !important;
    right: 10px !important;
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    height: calc(100vh - 155px) !important;
    max-height: calc(100vh - 155px) !important;
  }
}

.iscb_chat_header {
  background: var(--iscb-primary) !important;
  color: var(--iscb-header-text);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.iscb_header_info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.iscb_avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.iscb_avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.iscb_header_title {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
}

.iscb_header_status {
  font-size: 12px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.iscb_status_dot {
  width: 7px;
  height: 7px;
  background-color: #34c759;
  border-radius: 50%;
}

.iscb_close_btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  padding: 4px;
  transition: opacity 0.2s ease;
}

.iscb_close_btn:hover {
  opacity: 1;
}

/* Chat Messages Body */
.iscb_chat_body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8f9fa;
}

/* Message Item */
.iscb_msg_row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 85%;
  animation: iscbFadeIn 0.3s ease forwards;
}

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

.iscb_msg_row.iscb_msg_bot {
  align-self: flex-start;
}

.iscb_msg_row.iscb_msg_user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.iscb_msg_bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.iscb_msg_bot .iscb_msg_bubble {
  background-color: var(--iscb-bot-bubble-bg);
  color: var(--iscb-bot-bubble-text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.iscb_msg_user .iscb_msg_bubble {
  background-color: var(--iscb-primary) !important;
  color: #ffffff !important;
  border-bottom-right-radius: 4px;
}

.iscb_actions_container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-left: 4px;
  animation: iscbFadeIn 0.4s ease forwards;
}

.iscb_action_btn {
  background-color: #ffffff;
  color: var(--iscb-primary);
  border: 1.5px solid var(--iscb-primary);
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.iscb_action_btn:hover {
  background-color: var(--iscb-primary) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.iscb_chat_footer {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  gap: 8px;
}

.iscb_chat_input {
  flex: 1;
  border: 1px solid #ced4da;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 14px;
  outline: none;
  font-family: var(--iscb-font);
  transition: border-color 0.2s ease;
}

.iscb_chat_input:focus {
  border-color: var(--iscb-primary);
}

.iscb_send_btn {
  background: var(--iscb-primary) !important;
  border: none;
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.iscb_wa_btn_wrap {
  margin-top: 10px;
}

.iscb_whatsapp_btn {
  background-color: #25D366 !important;
  color: #ffffff !important;
  border: none !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

.iscb_whatsapp_btn:hover {
  background-color: #1ebe5d !important;
  color: #ffffff !important;
}

.iscb_sub_actions_container {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
  animation: iscbFadeIn 0.3s ease forwards;
}

.iscb_sub_action_btn {
  background-color: #ffffff !important;
  color: #1a73e8 !important;
  border: 1.5px solid #1a73e8 !important;
  padding: 8px 12px !important;
  border-radius: 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.iscb_sub_action_btn:hover {
  background-color: #1a73e8 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.iscb_dot_amber {
  background-color: #ff9500 !important;
}

.iscb_dot_green {
  background-color: #34c759 !important;
}

/* Typing Indicator Animation */
.iscb_typing_bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
}

.iscb_typing_bubble .iscb_dot {
  width: 6px;
  height: 6px;
  background-color: #8e8e93;
  border-radius: 50%;
  animation: iscbBounce 1.2s infinite ease-in-out;
}

.iscb_typing_bubble .iscb_dot:nth-child(2) {
  animation-delay: 0.2s;
}

.iscb_typing_bubble .iscb_dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes iscbBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}

.iscb_send_btn:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

.iscb_send_btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Scroll to Bottom Floating Button & Unread Count Badge */
.iscb_scroll_down_btn {
  position: absolute;
  bottom: 68px;
  right: 18px;
  z-index: 999;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff !important;
  color: var(--iscb-primary, #1a73e8) !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  outline: none;
  padding: 0;
}

.iscb_scroll_down_btn:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
  background: #f8fafc !important;
}

.iscb_scroll_down_btn svg {
  fill: var(--iscb-primary, #1a73e8);
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.iscb_scroll_badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: #25d366 !important;
  color: #ffffff !important;
  font-size: 11px;
  font-weight: 700;
  min-width: 19px;
  height: 19px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  border: 2px solid #ffffff;
  animation: iscbBadgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes iscbBadgePop {
  0% { transform: scale(0.5); }
  100% { transform: scale(1); }
}
