@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

:root {
  --background-color: #111111;
  --text-color: #EAEAEA;
  --muted-text-color: #B3B3B3;
  --input-bg-color: #1C1C1C;
  --input-border-color: #333333;
  --button-bg-color: #2A2A2A;
  --button-hover-bg-color: #3A3A3A;
  --accent: #0055FF;
  --success: #22c55e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Chatbot Container */
.chatbot-widget {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 768px; /* Desktop view max width */
  padding: 1rem;
  border-radius: 16px; /* Slightly larger radius */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, rgba(20,20,20,1) 0%, rgba(17,17,17,1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Header */
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: #0f172a; /* slate-900 */
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px;
}

.brand-meta h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-tagline {
  font-size: 0.9rem;
  color: var(--muted-text-color);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  font-size: 0.85rem;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

/* Messages */
.chatbot-messages {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 10px; /* for scrollbar */
}

/* Custom Scrollbar */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}
.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chatbot-messages::-webkit-scrollbar-thumb {
  background-color: var(--button-bg-color);
  border-radius: 6px;
}

.message-bubble {
  max-width: 80%;
  padding: 10px 15px;
  border-radius: 18px;
  line-height: 1.5;
  animation: fadeIn 0.3s ease-in-out;
}
.message-bubble.user {
  background: linear-gradient(180deg, #0a5cff 0%, #0047d4 100%);
  color: var(--text-color);
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 12px rgba(10, 92, 255, 0.3);
}
.message-bubble.bot {
  background-color: var(--button-bg-color);
  color: var(--text-color);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Input */
.chatbot-input-container {
  display: flex;
  align-items: center;
  background-color: var(--input-bg-color);
  border: 1px solid var(--input-border-color);
  border-radius: 16px;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
}
#chatbot-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-color);
  font-size: 1rem;
}
#chatbot-input::placeholder {
  color: #888;
}
#chatbot-send {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: var(--text-color);
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.12s ease, filter 0.2s ease;
}
#chatbot-send:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}
#chatbot-send svg {
  width: 20px;
  height: 20px;
}

/* Quick Replies */
.chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem; /* Added margin for spacing */
  transition: all 0.3s ease-in-out;
  padding: 0 1rem; /* Added horizontal padding */
}
.quick-reply-button {
  background-color: var(--button-bg-color);
  color: var(--text-color);
  border: 1px solid var(--input-border-color);
  border-radius: 999px;
  padding: 0.6rem 1.2rem; /* Adjusted padding */
  cursor: pointer;
  font-size: 0.9rem; /* Adjusted font size */
  transition: background-color 0.2s, transform 0.2s; /* Added transform for hover effect */
}
.quick-reply-button:hover {
  background-color: var(--button-hover-bg-color);
  transform: translateY(-2px); /* Subtle lift on hover */
}

/* Animasi */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
  body {
    align-items: flex-start;
    padding: 0; /* Remove body padding on mobile */
  }
  .chatbot-widget {
    height: 100vh; /* Full height on mobile */
    height: -webkit-fill-available; /* iOS Safari fix */
    padding: 0.5rem; /* Reduced padding on mobile */
    border-radius: 0; /* Remove border-radius on mobile for full-screen look */
    box-shadow: none; /* Remove shadow on mobile */
  }

  .chatbot-header {
    padding: 0.75rem 0; /* Reducing padding on mobile */
  }

  .brand-logo { width: 36px; height: 36px; }
  .brand-meta h1 { font-size: 1.4rem; }
  .brand-tagline { font-size: 0.8rem; }

  .message-bubble { font-size: 0.85rem; padding: 7px 10px; }

  .chatbot-input-container { padding: 0.4rem 0.4rem 0.4rem 0.8rem; }

  #chatbot-input { font-size: 0.9rem; }

  #chatbot-send { width: 40px; height: 40px; border-radius: 10px; }

  .chatbot-quick-replies { gap: 0.5rem; margin-bottom: 0.5rem; padding: 0 0.5rem; }

  .quick-reply-button { padding: 0.5rem 1rem; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .brand-meta h1 { font-size: 1.25rem; }
  .quick-reply-button { font-size: 0.75rem; padding: 0.4rem 0.8rem; }
}

.message-bubble.bot a {
  color: #8ab4f8; /* A slightly muted blue for links */
  text-decoration: none;
  font-weight: 500;
}

.message-bubble.bot a:hover {
  text-decoration: underline;
}
