/* Live Chat widget */
#lc-chat-widget {
  position: fixed;
  bottom: 20px;
  z-index: 99999;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  direction: rtl;
}
#lc-chat-widget.lc-position-right { right: 20px; }
#lc-chat-widget.lc-position-left  { left: 20px; }

.lc-hidden { display: none !important; }

.lc-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #2271b1;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
  position: relative;
}
.lc-toggle-btn:hover { background: #135e96; transform: translateY(-2px); }
.lc-bubble-icon { display: flex; }

.lc-unread {
  position: absolute;
  top: -6px;
  left: -6px;
  background: #d63638;
  color: #fff;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

#lc-chat-panel {
  position: absolute;
  bottom: 60px;
  width: 340px;
  max-width: calc(100vw - 40px);
  height: 460px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e4e7;
  animation: lc-pop 0.18s ease;
}
#lc-chat-widget.lc-position-right #lc-chat-panel { right: 0; }
#lc-chat-widget.lc-position-left  #lc-chat-panel { left: 0; }

@keyframes lc-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lc-header {
  background: #2271b1;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}
.lc-header strong { flex: 1; }
.lc-status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #46b450;
  box-shadow: 0 0 0 3px rgba(70, 180, 80, 0.3);
}
#lc-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
#lc-close:hover { opacity: 0.8; }

.lc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f6f7f7;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lc-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}
.lc-msg-visitor {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #dcdcde;
  border-bottom-right-radius: 4px;
}
.lc-msg-admin {
  align-self: flex-end;
  background: #2271b1;
  color: #fff;
  border-bottom-left-radius: 4px;
}
.lc-msg-time {
  display: block;
  font-size: 10px;
  opacity: 0.65;
  margin-top: 4px;
}
.lc-msg-system {
  align-self: center;
  background: transparent;
  color: #646970;
  font-size: 12px;
  padding: 4px;
}

.lc-name-form, .lc-send-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e2e4e7;
  background: #fff;
}
.lc-name-form input, .lc-send-form input {
  flex: 1;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
}
.lc-name-form input:focus, .lc-send-form input:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
}
.lc-name-form button, .lc-send-form button {
  background: #2271b1;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.lc-name-form button:hover, .lc-send-form button:hover { background: #135e96; }
.lc-send-form button:disabled { opacity: 0.6; cursor: not-allowed; }

@media (max-width: 480px) {
  #lc-chat-panel {
    width: calc(100vw - 24px);
    height: 70vh;
    bottom: 64px;
  }
  #lc-chat-widget.lc-position-right { right: 12px; }
  #lc-chat-widget.lc-position-left  { left: 12px; }
  .lc-toggle-label { display: none; }
  .lc-toggle-btn { padding: 14px; border-radius: 50%; }
}
