/* ============================================
   LINUM BROW — Chatbot Widget
   ============================================ */

/* TRIGGER */
.lb-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 9999;
}

.lb-tooltip {
  background: #F5EFEA;
  border-radius: 50px;
  padding: 11px 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: #2b2b2b;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  box-shadow: 0px 2px 8px rgba(0,0,0,0.08);
  animation: lbFadeUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
  transform-origin: bottom right;
  transition: opacity 0.2s, transform 0.2s;
  cursor: default;
}

.lb-tooltip.lb-hide {
  opacity: 0;
  transform: scale(0.85) translateY(6px);
  pointer-events: none;
}

.lb-tooltip-x {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  font-size: 18px;
  color: rgba(82,54,38,0.5);
  cursor: pointer;
  margin-left: 0;
  line-height: 1;
  transition: max-width 0.2s, opacity 0.2s, margin-left 0.2s;
}

.lb-tooltip:hover .lb-tooltip-x {
  max-width: 20px;
  opacity: 1;
  margin-left: 8px;
}

.lb-tooltip-x:hover { color: #523626; }

.lb-fab {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #F5EFEA;
  box-shadow: 0px 2px 10px rgba(0,0,0,0.1);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
}

.lb-fab:hover {
  transform: scale(1.07);
  box-shadow: 0px 4px 16px rgba(0,0,0,0.13);
}

.lb-fab img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* CHAT PROZOR */
#lb-chat {
  position: fixed;
  bottom: 104px;
  right: 24px;
  width: 350px;
  background: linear-gradient(163.5deg, #F5EFEA -16.06%, #FFFFFF 47.73%, #F5EFEA 110.31%);
  border-radius: 24px;
  box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.06);
  overflow: hidden; /* ← vrati na hidden */
  display: flex;
  flex-direction: column;
  height: 560px; /* ← fiksna visina, ne auto */
  max-height: calc(100svh - 120px);
  z-index: 9998;
  transform-origin: bottom right;
  transform: scale(0.85);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease, background 0.4s ease;
}


#lb-chat.lb-open {
  transform: scale(1);
  opacity: 1;
  pointer-events: all;
}

#lb-chat.lb-active {
  background: #ffffff;
}

/* HEADER */
.lb-chat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 20px 0;
  flex-shrink: 0;
}

.lb-logo {
  height: 80px;
  width: auto;
  object-fit: contain;
  display: block;
}

.lb-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F5EFEA;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #2b2b2b;
  transition: opacity 0.15s;
  flex-shrink: 0;
  margin-top: 4px;
}

.lb-close:hover { opacity: 0.7; }

/* MESSAGES */
.lb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  /* makni max-height: 300px */
}



.lb-messages::-webkit-scrollbar { width: 3px; }
.lb-messages::-webkit-scrollbar-thumb { background: rgba(82,54,38,0.15); border-radius: 3px; }

.lb-msg {
  max-width: 88%;
  font-size: 15px;
  line-height: 1.6;
  font-family: 'Poppins', sans-serif;
  animation: lbMsgIn 0.25s ease;
}

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

.lb-bot { color: #2b2b2b; align-self: flex-start; }

.lb-user {
  background: #F7F1ED;
  box-shadow: 0px 2px 3px 0px rgba(120,120,120,0.13);
  color: #2b2b2b;
  border-radius: 20px 20px 4px 20px;
  padding: 10px 16px;
  align-self: flex-end;
}

/* SUGGESTIONS */
.lb-suggestions {
  padding: 0 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  min-height: 14px; /* ← ostavi malo prostora čak i kad su prazni */

}

.lb-left  { align-items: flex-start; }
.lb-right { align-items: flex-end; }

.lb-right .lb-s-btn {
  background: #fff;
  box-shadow: 0px 2px 3px 0px rgba(120,120,120,0.13);
}
.lb-s-btn {
  background: #F7F1ED;
  box-shadow: 0px 2px 3px 0px rgba(120,120,120,0.13);
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  color: #2b2b2b;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.15s, transform 0.15s;
}

.lb-s-btn:hover { opacity: 0.75; transform: scale(0.98); }
.lb-s-btn.lb-used { display: none; }

/* INPUT */
.lb-input-row {
  padding: 10px 16px 18px;
  flex-shrink: 0;

}

.lb-input-wrap { position: relative; }

.lb-input {
  width: 100%;
  box-sizing: border-box; 
  border: 1.5px solid rgba(82,54,38,0.15);
  border-radius: 50px;
  padding: 13px 50px 13px 20px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  color: #2b2b2b;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.lb-input:focus { border-color: rgba(82,54,38,0.35); }
.lb-input::placeholder { color: rgba(82,54,38,0.35); }

.lb-send {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  padding: 0;
}

.lb-send img { width: 22px; height: 22px; object-fit: contain; }
.lb-send.lb-visible { opacity: 1; pointer-events: auto; }
.lb-send:hover { transform: translateY(-50%) scale(1.1); }

/* TYPING */
.lb-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  align-self: flex-start;
  padding: 6px 2px;
  animation: lbMsgIn 0.25s ease;
}

.lb-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(82,54,38,0.3);
  animation: lbBounce 1.2s infinite;
}

.lb-typing span:nth-child(2) { animation-delay: 0.2s; }
.lb-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes lbBounce {
  0%,60%,100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

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

/* MOBIL — fullscreen */
@media (max-width: 480px) {
  #lb-chat {
    width: 100%;
    height: 100dvh; /* ← dynamic viewport height, radi na mobu */
    max-height: 100dvh; /* ← override max-height od gore */
    bottom: 0;
    right: 0;
    border-radius: 0;
    transform-origin: bottom center;
  }

  .lb-trigger {
    bottom: 16px;
    right: 16px;
  }
}

.admin-bar #lb-chat {
  max-height: calc(100svh - 32px);
}

@media (max-width: 782px) {
  .admin-bar #lb-chat {
    max-height: calc(100dvh - 46px);
  }
}