/**
 * LPK UHAMKA Virtual Assistant Stylesheet
 * Native CSS - Zero dependencies
 *
 * @package LPK_UHAMKA_SIMKERMA
 */

:root {
  --lpk-cb-primary: #0B2A4A;
  --lpk-cb-primary-hover: #071F38;
  --lpk-cb-accent: #1E5AA8;
  --lpk-cb-accent-light: #EBF3FC;
  --lpk-cb-bg: #FFFFFF;
  --lpk-cb-bg-subtle: #F8FAFC;
  --lpk-cb-text: #1E293B;
  --lpk-cb-text-muted: #64748B;
  --lpk-cb-border: #E2E8F0;
  --lpk-cb-user-bubble: #0B2A4A;
  --lpk-cb-user-text: #FFFFFF;
  --lpk-cb-bot-bubble: #F1F5F9;
  --lpk-cb-bot-text: #1E293B;
  --lpk-cb-radius: 16px;
  --lpk-cb-shadow: 0 10px 25px -5px rgba(11, 42, 74, 0.15), 0 8px 10px -6px rgba(11, 42, 74, 0.1);
  --lpk-cb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#lpk-chatbot-widget {
  position: fixed;
  bottom: 92px;
  right: 24px;
  z-index: 99999;
  font-family: var(--lpk-cb-font);
  box-sizing: border-box;
}

#lpk-chatbot-widget *,
#lpk-chatbot-widget *::before,
#lpk-chatbot-widget *::after {
  box-sizing: inherit;
}

/* Floating Launcher Button */
#lpk-chatbot-launcher {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #071F49 0%, #0B2A4A 60%, #1E5AA8 100%);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 8px 24px rgba(11, 42, 74, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
  outline-offset: 3px;
}

#lpk-chatbot-launcher:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px rgba(11, 42, 74, 0.45);
}

#lpk-chatbot-launcher:focus-visible {
  outline: 3px solid var(--lpk-cb-accent);
}

#lpk-chatbot-launcher svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

/* Chat Popup Panel */
#lpk-chatbot-panel {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 380px;
  height: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background-color: var(--lpk-cb-bg);
  border-radius: var(--lpk-cb-radius);
  box-shadow: 0 16px 40px -8px rgba(11, 42, 74, 0.22), 0 8px 16px -4px rgba(11, 42, 74, 0.12);
  border: 1px solid var(--lpk-cb-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

#lpk-chatbot-panel.lpk-is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Panel Header */
.lpk-chatbot-header {
  background: linear-gradient(135deg, #071F49 0%, #0B2A4A 60%, #143C6D 100%);
  color: #FFFFFF;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: var(--lpk-cb-radius);
  border-top-right-radius: var(--lpk-cb-radius);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lpk-chatbot-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lpk-chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  padding: 3px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.lpk-chatbot-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.lpk-chatbot-avatar svg {
  width: 22px;
  height: 22px;
  fill: var(--lpk-cb-primary);
}

.lpk-chatbot-title-group h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lpk-chatbot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 3px;
}

.lpk-chatbot-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22C55E;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.lpk-chatbot-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.lpk-chatbot-close:hover {
  background-color: rgba(255, 255, 255, 0.22);
  transform: rotate(90deg);
}

.lpk-chatbot-close:focus-visible {
  outline: 2px solid #FFFFFF;
}

/* Panel Body & Messages */
.lpk-chatbot-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: var(--lpk-cb-bg-subtle);
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

.lpk-chatbot-body::-webkit-scrollbar {
  width: 6px;
}

.lpk-chatbot-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 3px;
}

.lpk-chatbot-message {
  display: flex;
  flex-direction: column;
  max-width: 84%;
  word-break: break-word;
  animation: lpk-cb-fade-in 0.2s ease-out;
}

@keyframes lpk-cb-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.lpk-chatbot-message.lpk-from-bot {
  align-self: flex-start;
}

.lpk-chatbot-message.lpk-from-user {
  align-self: flex-end;
}

.lpk-chatbot-bubble {
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
}

.lpk-from-bot .lpk-chatbot-bubble {
  background-color: #FFFFFF;
  color: var(--lpk-cb-bot-text);
  border: 1px solid var(--lpk-cb-border);
  box-shadow: 0 2px 8px rgba(11, 42, 74, 0.05);
  border-bottom-left-radius: 4px;
}

.lpk-from-user .lpk-chatbot-bubble {
  background: linear-gradient(135deg, #0B2A4A 0%, #1E5AA8 100%);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(11, 42, 74, 0.2);
  border-bottom-right-radius: 4px;
}

/* Action Links in Bot Messages */
.lpk-chatbot-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.lpk-chatbot-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--lpk-cb-primary);
  background-color: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.lpk-chatbot-action-btn:hover {
  background-color: var(--lpk-cb-accent-light);
  border-color: var(--lpk-cb-accent);
  color: var(--lpk-cb-accent);
  transform: translateX(3px);
  box-shadow: 0 2px 6px rgba(30, 90, 168, 0.15);
}

/* Quick Action Chips */
.lpk-chatbot-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
  margin-top: 4px;
}

.lpk-chatbot-chip {
  background-color: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 20px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 500;
  color: var(--lpk-cb-primary);
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.lpk-chatbot-chip:hover {
  background-color: var(--lpk-cb-accent-light);
  border-color: var(--lpk-cb-accent);
  color: var(--lpk-cb-accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(30, 90, 168, 0.15);
}

.lpk-chatbot-chip:focus-visible {
  outline: 2px solid var(--lpk-cb-accent);
}

/* Typing Indicator */
.lpk-chatbot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background-color: #FFFFFF;
  border: 1px solid var(--lpk-cb-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.lpk-chatbot-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--lpk-cb-text-muted);
  animation: lpk-cb-bounce 1.4s infinite ease-in-out both;
}

.lpk-chatbot-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.lpk-chatbot-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes lpk-cb-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Footer / Input Area */
.lpk-chatbot-footer {
  padding: 12px 14px;
  background-color: var(--lpk-cb-bg);
  border-top: 1px solid var(--lpk-cb-border);
}

.lpk-chatbot-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lpk-chatbot-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--lpk-cb-border);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--lpk-cb-text);
  background-color: #FFFFFF;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  font-family: inherit;
}

.lpk-chatbot-input:focus {
  border-color: var(--lpk-cb-accent);
  box-shadow: 0 0 0 3px rgba(30, 90, 168, 0.15);
}

.lpk-chatbot-send-btn {
  background: linear-gradient(135deg, #0B2A4A 0%, #1E5AA8 100%);
  color: #FFFFFF;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(11, 42, 74, 0.25);
  padding: 0;
}

.lpk-chatbot-send-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #071F38 0%, #174A8C 100%);
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 12px rgba(30, 90, 168, 0.35);
}

.lpk-chatbot-send-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.96);
}

.lpk-chatbot-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.lpk-chatbot-send-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  margin-left: 2px;
  transition: transform 0.15s ease;
}

.lpk-chatbot-send-btn:hover:not(:disabled) svg {
  transform: scale(1.1);
}

.lpk-chatbot-disclaimer {
  font-size: 10.5px;
  color: var(--lpk-cb-text-muted);
  text-align: center;
  margin-top: 6px;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  #lpk-chatbot-widget {
    bottom: 80px;
    right: 16px;
  }
  #lpk-chatbot-panel {
    bottom: 70px;
    right: 0;
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    max-height: 560px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #lpk-chatbot-panel,
  #lpk-chatbot-launcher,
  .lpk-chatbot-message,
  .lpk-chatbot-typing-dot {
    transition: none !important;
    animation: none !important;
  }
}

