:root {
  --makna-primary: #2d2c69;
  --makna-accent: #ee437f;
  --makna-accent-dark: #c92d66;
  --makna-surface: #ffffff;
  --makna-muted: #f5f7fb;
  --makna-border: rgba(17, 24, 39, 0.10);
  --makna-text: #111827;
  --makna-subtle: #6b7280;
  --makna-shadow: 0 18px 48px rgba(17, 24, 39, 0.18);
}

.chatbot-box,
.chatbot-box *,
.chatbot-toggle,
.chatbot-notification {
  -webkit-tap-highlight-color: transparent;
  font-family: Arial, Helvetica, sans-serif;
}

.chatbot-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 9999;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: var(--makna-surface);
  box-shadow: 0 14px 32px rgba(45, 44, 105, 0.24);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.chatbot-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(45, 44, 105, 0.30);
}

.chatbot-notification {
  position: fixed;
  right: 92px;
  bottom: 28px;
  max-width: 240px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--makna-surface);
  color: #374151;
  border: 1px solid var(--makna-border);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 9998;
}

.chatbot-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.chatbot-logo {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: transparent;
  object-fit: contain;
  display: block;
}

.chatbot-logo.animated {
  display: none;
}

.chatbot-box {
  position: fixed;
  right: 18px;
  bottom: 96px;
  width: 372px;
  height: 540px;
  background: var(--makna-surface);
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 18px;
  box-shadow: var(--makna-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  z-index: 9998;
}

.chatbot-box.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.chatbot-box.expanded {
  width: min(92vw, 520px);
  height: min(86vh, 680px);
}

.chatbot-header {
  position: relative;
  padding: 14px 14px 13px;
  background: linear-gradient(135deg, var(--makna-primary) 0%, #403c89 58%, var(--makna-accent) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chatbot-header span {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.chatbot-header small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 500;
}

.clear-chat-btn,
.expand-btn,
.close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background-color: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: none;
  opacity: 1;
  appearance: none;
  -webkit-appearance: none;
}

.header-btn-icon {
  display: block;
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.clear-chat-btn {
  background-color: rgba(255, 255, 255, 0.14) !important;
}

.clear-chat-btn:hover,
.expand-btn:hover,
.close-btn:hover {
  background-color: #ffffff !important;
  color: var(--makna-primary) !important;
  border-color: #ffffff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.chatbot-logo-small {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.64);
  object-fit: contain;
  display: block;
}

.chatbot-body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  background: linear-gradient(180deg, #f7f8fb 0%, #ffffff 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(45, 44, 105, 0.28) transparent;
}

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

.chatbot-body::-webkit-scrollbar-thumb {
  background: rgba(45, 44, 105, 0.24);
  border-radius: 999px;
}

.chatbot-message {
  margin: 0;
  padding: 11px 13px;
  border-radius: 14px;
  max-width: 85%;
  line-height: 1.45;
  font-size: 14px;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.bot {
  background: var(--makna-surface);
  border: 1px solid rgba(17, 24, 39, 0.08);
  color: var(--makna-text);
  align-self: flex-start;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06);
  border-top-left-radius: 6px;
}

.user {
  background: var(--makna-primary);
  color: #ffffff;
  align-self: flex-end;
  border-top-right-radius: 6px;
  box-shadow: 0 8px 20px rgba(45, 44, 105, 0.18);
}

.chatbot-message a {
  color: var(--makna-accent-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.predefined-texts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
  padding: 12px;
  border: 1px solid rgba(45, 44, 105, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.05);
}

.predefined-toggle {
  align-self: flex-start;
  color: var(--makna-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: default;
}

.predefined-toggle::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M8 6a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1Zm0 6a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1Zm0 6a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1ZM3 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M8 6a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1Zm0 6a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1Zm0 6a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1ZM3 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.faq-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
}

.faq-item {
  background: #f8f9fd;
  color: #293056;
  border: 1px solid rgba(45, 44, 105, 0.10);
  padding: 9px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  white-space: normal;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  overflow-wrap: anywhere;
  box-shadow: none;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.faq-item:hover {
  color: var(--makna-accent-dark);
  border-color: rgba(238, 67, 127, 0.34);
  background: #fff4f8;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(238, 67, 127, 0.10);
}

.faq-item:focus-visible {
  outline: 3px solid rgba(238, 67, 127, 0.18);
  outline-offset: 2px;
}

.back-to-top {
  position: absolute;
  right: 16px;
  bottom: 84px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--makna-primary);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  box-shadow: 0 8px 18px rgba(45, 44, 105, 0.18);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
  z-index: 100;
}

.back-to-top:hover {
  transform: translateY(-1px);
  background: var(--makna-accent);
  box-shadow: 0 10px 20px rgba(238, 67, 127, 0.24);
}

.back-to-top:focus-visible {
  outline: 3px solid rgba(45, 44, 105, 0.22);
  outline-offset: 3px;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-icon {
  display: block;
  width: 18px;
  height: 18px;
}

.ter-action-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.ter-prompt {
  margin-top: 4px;
  padding: 12px;
  border-radius: 12px;
  background: #fff4f8;
  border: 1px solid rgba(238, 67, 127, 0.22);
  color: #3f2340;
}

.ter-btn {
  padding: 9px 13px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.ter-btn.primary {
  background: var(--makna-primary);
  color: #ffffff;
}

.ter-btn.primary:hover {
  background: var(--makna-accent);
  opacity: 1;
}

.ter-btn.secondary {
  background: #ffffff;
  color: var(--makna-primary);
  border-color: rgba(45, 44, 105, 0.18);
}

.ter-btn.secondary:hover {
  background: #fff4f8;
  color: var(--makna-accent-dark);
}

.chatbot-footer {
  padding: 12px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  display: flex;
  gap: 8px;
  background: #ffffff;
}

.chatbot-footer input {
  flex: 1;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  outline: none;
  background: #f9fafb;
  color: var(--makna-text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.chatbot-footer input:focus {
  background: #ffffff;
  border-color: rgba(45, 44, 105, 0.36);
  box-shadow: 0 0 0 3px rgba(45, 44, 105, 0.10);
}

.send-icon {
  width: 18px;
  height: 18px;
  display: block;
  color: #ffffff;
}

.chatbot-footer button {
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--makna-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.chatbot-footer button:hover {
  background: var(--makna-accent);
}

.chatbot-footer button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.typing-indicator span {
  height: 6px;
  width: 6px;
  background: var(--makna-subtle);
  border-radius: 999px;
  display: inline-block;
  animation: blink 1.2s infinite both;
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

.typing-bubble {
  padding: 10px 12px;
  background: #ffffff;
}

.event-schedule {
  background: #ffffff;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
  color: var(--makna-text);
}

.event-schedule h4 {
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--makna-primary);
}

@media (max-width: 600px) {
  .chatbot-toggle {
    right: 12px;
    bottom: 12px;
  }

  .chatbot-notification {
    right: 12px;
    left: 12px;
    bottom: 88px;
    max-width: none;
    text-align: center;
  }

  .chatbot-box {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 84px;
    height: min(72vh, 520px);
  }

  .chatbot-box.expanded {
    width: auto;
    height: calc(100vh - 20px);
  }

}
