
/* =========================================
   i-LAB AI CHATBOT
   WordPress Version
========================================= */

.ilab-chatbot,
.ilab-chatbot * {
  box-sizing: border-box;
}

.ilab-chatbot {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 999999;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}


/* =========================================
   FLOATING LAUNCHER
========================================= */

.ilab-chatbot-launcher {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #0b1f3a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.2);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.ilab-chatbot-launcher:hover {
  transform: scale(1.03);

  box-shadow:
    0 14px 35px rgba(0, 0, 0, 0.25);
}

.ilab-chatbot-launcher:active {
  transform: scale(0.97);
}

.ilab-chatbot-launcher.is-hidden {
  display: none;
}


/* Launcher Logo */

.ilab-launcher-icon {
  width: 30px;
  height: 30px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  overflow: hidden;

  border-radius: 50%;

  background: #ffffff;
}

.ilab-launcher-icon img {
  width: 100%;
  height: 100%;

  object-fit: contain;

  display: block;
}


/* =========================================
   CHAT WINDOW
========================================= */

.ilab-chatbot-window {
  display: none;

  position: fixed;

  left: 24px;
  bottom: 24px;

  width: 420px;

  height: min(720px, 90vh);

  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);

  flex-direction: column;

  overflow: hidden;

  border: 1px solid rgba(0, 0, 0, 0.08);

  border-radius: 24px;

  background: #ffffff;

  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.2);

  animation: ilabChatOpen 0.2s ease-out;
}

.ilab-chatbot-window.is-open {
  display: flex;
}

@keyframes ilabChatOpen {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* =========================================
   HEADER
========================================= */

.ilab-chatbot-header {
  display: flex;
  align-items: center;

  gap: 12px;

  min-height: 72px;

  padding: 14px 16px;

  background: #0b1f3a;

  color: #ffffff;
}


/* Header Logo */

.ilab-chatbot-logo {
  width: 44px;
  height: 44px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  border-radius: 12px;

  background: #ffffff;
}

.ilab-chatbot-logo img {
  width: 100%;
  height: 100%;

  object-fit: contain;

  display: block;
}


/* Header Title */

.ilab-chatbot-title {
  min-width: 0;

  flex: 1;

  display: flex;
  flex-direction: column;

  gap: 4px;
}

.ilab-chatbot-title strong {
  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;

  font-size: 14px;

  font-weight: 700;
}

.ilab-online-status {
  display: flex;

  align-items: center;

  font-size: 11px;

  opacity: 0.82;
}

.ilab-online-status i {
  width: 7px;
  height: 7px;

  margin-right: 6px;

  flex-shrink: 0;

  border-radius: 50%;

  background: #25d366;
}


/* =========================================
   HEADER BUTTONS
========================================= */

.ilab-chatbot-icon-button {
  width: 36px;
  height: 36px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 0;

  border-radius: 9px;

  background: transparent;

  color: #ffffff;

  font-size: 16px;

  cursor: pointer;

  transition: background 0.2s ease;
}

.ilab-chatbot-icon-button:hover {
  background: rgba(255, 255, 255, 0.12);
}


/* =========================================
   MESSAGES
========================================= */

.ilab-chatbot-messages {
  flex: 1;

  overflow-y: auto;

  padding: 20px 16px;

  background: #f5f6f8;

  scroll-behavior: smooth;
}


/* Scrollbar */

.ilab-chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.ilab-chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ilab-chatbot-messages::-webkit-scrollbar-thumb {
  background: #c9ccd2;

  border-radius: 10px;
}


/* Message */

.ilab-chatbot-message {
  display: flex;

  width: 100%;

  margin-bottom: 12px;
}

.ilab-chatbot-user {
  justify-content: flex-end;
}

.ilab-chatbot-assistant {
  justify-content: flex-start;
}


/* =========================================
   MESSAGE BUBBLES
========================================= */

.ilab-chatbot-bubble {
  max-width: 85%;

  padding: 11px 14px;

  border-radius: 17px;

  font-size: 14px;

  line-height: 1.55;

  white-space: pre-wrap;

  word-break: break-word;
}


/* User */

.ilab-chatbot-user .ilab-chatbot-bubble {
  background: #0b1f3a;

  color: #ffffff;

  border-bottom-right-radius: 5px;
}


/* Assistant */

.ilab-chatbot-assistant .ilab-chatbot-bubble {
  background: #ffffff;

  color: #20242a;

  border: 1px solid #e2e4e8;

  border-bottom-left-radius: 5px;

  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.03);
}


/* =========================================
   TYPING INDICATOR
========================================= */

.ilab-chatbot-typing {
  display: flex;

  align-items: center;

  gap: 4px;
}

.ilab-chatbot-typing span {
  display: inline-block;

  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: #7b8088;

  animation: ilabTyping 1s infinite;
}

.ilab-chatbot-typing span:nth-child(2) {
  animation-delay: 150ms;
}

.ilab-chatbot-typing span:nth-child(3) {
  animation-delay: 300ms;
}

.ilab-chatbot-typing small {
  margin-left: 5px;

  color: #777d86;

  font-size: 11px;
}

@keyframes ilabTyping {
  0%,
  100% {
    opacity: 0.3;

    transform: translateY(0);
  }

  50% {
    opacity: 1;

    transform: translateY(-2px);
  }
}


/* =========================================
   INPUT AREA
========================================= */

.ilab-chatbot-input-area {
  flex-shrink: 0;

  padding: 12px 14px;

  background: #ffffff;

  border-top: 1px solid #e4e5e8;
}


/* =========================================
   QUICK ACTIONS
========================================= */

.ilab-chatbot-quick-actions {
  display: flex;

  flex-wrap: wrap;

  gap: 7px;

  margin-bottom: 11px;
}

.ilab-chatbot-quick {
  min-height: 31px;

  padding: 6px 11px;

  border: 1px solid #dedfe3;

  border-radius: 999px;

  background: #f4f5f7;

  color: #34383e;

  font-size: 11px;

  font-weight: 500;

  cursor: pointer;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.ilab-chatbot-quick:hover {
  background: #0b1f3a;

  border-color: #0b1f3a;

  color: #ffffff;
}

.ilab-chatbot-quick:disabled {
  opacity: 0.5;

  cursor: not-allowed;
}


/* =========================================
   FORM
========================================= */

#ilab-chatbot-form {
  display: flex;

  align-items: flex-end;

  gap: 8px;

  width: 100%;
}


/* Textarea */

#ilab-chatbot-input {
  flex: 1;

  width: 100%;

  min-width: 0;

  min-height: 44px;

  max-height: 112px;

  resize: none;

  padding: 11px 13px;

  border: 1px solid #d7d9de;

  border-radius: 16px;

  outline: none;

  background: #ffffff;

  color: #22252a;

  font-family: inherit;

  font-size: 13px;

  line-height: 1.4;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

#ilab-chatbot-input::placeholder {
  color: #92969d;
}

#ilab-chatbot-input:focus {
  border-color: #0b1f3a;

  box-shadow:
    0 0 0 2px rgba(11, 31, 58, 0.1);
}

#ilab-chatbot-input:disabled {
  opacity: 0.6;
}


/* =========================================
   SEND BUTTON
========================================= */

#ilab-chatbot-send {
  width: 44px;
  height: 44px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 0;

  border-radius: 16px;

  background: #0b1f3a;

  color: #ffffff;

  font-size: 17px;

  cursor: pointer;

  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

#ilab-chatbot-send:hover:not(:disabled) {
  transform: scale(1.04);
}

#ilab-chatbot-send:active:not(:disabled) {
  transform: scale(0.96);
}

#ilab-chatbot-send:disabled {
  opacity: 0.5;

  cursor: not-allowed;
}


/* =========================================
   POWERED BY
========================================= */

.ilab-chatbot-powered {
  display: flex;

  align-items: center;

  justify-content: center;

  gap: 5px;

  margin-top: 8px;

  color: #8a8e95;

  font-size: 10px;
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 600px) {
  .ilab-chatbot {
    left: 0;
    right: 0;
    bottom: 12px;
    width: 100%;
  }

  .ilab-chatbot-window {
    left: 50%;
    right: auto;
    bottom: 12px;

    width: calc(100vw - 24px);
    height: 75vh;

    max-width: none;
    max-height: none;

    transform: translateX(-50%);
    border-radius: 22px;
  }

  .ilab-chatbot-header {
    min-height: 68px;
  }

  .ilab-chatbot-messages {
    padding: 16px 13px;
  }

  .ilab-chatbot-bubble {
    max-width: 88%;
    font-size: 13px;
  }

  .ilab-chatbot-quick-actions {
    max-height: 74px;
    overflow-y: auto;
  }
}