/* Chat widget (replaces Tawk.to) - see js/app/chat-widget.js */

.ll-chat {
  position: fixed;
  z-index: 100000;
  right: 20px;
  bottom: 90px;
  font-family: 'Open Sans', sans-serif;
  /* The wrapper keeps the hidden panel's size; don't let it swallow taps on the page beneath. */
  pointer-events: none;
}

.ll-chat-panel {
  display: flex;
  flex-direction: column;
  width: 340px;
  max-width: calc(100vw - 40px);
  height: 440px;
  max-height: calc(100vh - 120px);
  overflow: hidden;
  border-radius: 14px;
  background: #FFFFFF;
  box-shadow: 0 16px 48px rgba(11, 7, 29, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.ll-chat.open .ll-chat-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
}

.ll-chat-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(45deg, #051dff 0, #b500ff 100%);
  color: #FFFFFF;
}

.ll-chat-avatar {
  flex: none;
  width: 42px;
  height: 42px;
  margin-right: 12px;
}

/* The logo is already a rounded app-icon square - show it whole, uncropped. */
.ll-chat-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 6px rgba(11, 7, 29, 0.35));
}

.ll-chat-title {
  flex: 1;
  line-height: 1.3;
}

.ll-chat-status {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.ll-chat-status i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: ll-chat-pulse 2s infinite;
}

.ll-chat-status.offline i {
  background: #bababa;
  animation: none;
}

.ll-chat-close {
  border: 0;
  background: none;
  color: #FFFFFF;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

.ll-chat-close:hover {
  opacity: 1;
}

.ll-chat-log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  overflow-y: auto;
  background: #F5F4FA;
}

.ll-chat-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  animation: ll-chat-in 0.2s ease;
}

.ll-chat-msg-agent {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: #FFFFFF;
  color: #0B071D;
  box-shadow: 0 1px 2px rgba(11, 7, 29, 0.08);
}

.ll-chat-msg-user {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: #3f51b5;
  color: #FFFFFF;
}

.ll-chat-typing span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 2px;
  border-radius: 50%;
  background: #878787;
  animation: ll-chat-bounce 1.2s infinite ease-in-out;
}

.ll-chat-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.ll-chat-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.ll-chat-cta {
  align-self: flex-start;
  padding: 8px 16px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(45deg, #051dff 0, #b500ff 100%);
  color: #FFFFFF;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  animation: ll-chat-in 0.2s ease;
}

.ll-chat-form {
  display: flex;
  align-items: center;
  padding-right: 10px;
  border-top: 1px solid #EFEFEF;
  background: #FFFFFF;
}

.ll-chat-input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 0;
  outline: 0;
  color: #0B071D;
  font-size: 14px;
}

.ll-chat-input:disabled {
  background: #FFFFFF;
}

.ll-chat-send {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(45deg, #051dff 0, #b500ff 100%);
  color: #FFFFFF;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.ll-chat-send svg {
  width: 17px;
  height: 17px;
  margin-left: 2px;
  fill: currentColor;
}

/* style.css sets button:hover/:active/:focus to near-black; override for the chat's buttons. */
.ll-chat-send:hover,
.ll-chat-send:active,
.ll-chat-send:focus {
  color: #BABABA;
}

.ll-chat-close:hover,
.ll-chat-close:active,
.ll-chat-close:focus,
.ll-chat-cta:hover,
.ll-chat-cta:active,
.ll-chat-cta:focus {
  color: #FFFFFF;
}

.ll-chat-send:hover {
  transform: scale(1.08);
}

.ll-chat-send:active {
  transform: scale(0.94);
}

.ll-chat-send:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

@keyframes ll-chat-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-5px); opacity: 1; }
}

@keyframes ll-chat-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes ll-chat-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@media (max-width: 480px) {
  .ll-chat {
    right: 16px;
    bottom: 80px;
  }

  .ll-chat-panel {
    width: calc(100vw - 32px);
    max-width: none;
  }
}

/* iOS Safari zooms into any field under 16px on focus and stays zoomed, leaving the page wider than the screen. */
@media (pointer: coarse) {
  .ll-chat-input {
    font-size: 16px;
  }
}
