/* ================================================
   Babeh.com — Dark Minimalist Chatbot Landing Page
   ================================================ */

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

/* --- Custom Properties --- */
:root {
  --bg-primary: #0d0d0d;
  --bg-surface: #1a1a1a;
  --bg-surface-high: #242424;
  --accent: #BB86FC;
  --accent-dim: rgba(187, 134, 252, 0.08);
  --accent-glow: rgba(187, 134, 252, 0.15);
  --text-high: rgba(255, 255, 255, 0.87);
  --text-medium: rgba(255, 255, 255, 0.60);
  --text-low: rgba(255, 255, 255, 0.38);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --shadow-dark: rgba(0, 0, 0, 0.5);
  --radius-lg: 20px;
  --radius-md: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-high);
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pageLoad 0.8s ease-out;
}

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

/* --- Subtle Background Pattern --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, var(--accent-dim), transparent),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(187, 134, 252, 0.03), transparent);
  pointer-events: none;
  z-index: 0;
}

/* --- Top Nav --- */
.top-nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: rgba(13, 13, 13, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.top-nav-brand {
  font-family: 'Boogaloo', cursive;
  font-size: 1.1rem;
  font-weight: 400;
  background: linear-gradient(135deg, #BB86FC, #9b59f5, #e040fb, #BB86FC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: 0.5px;
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.top-nav-link {
  font-size: 0.8125rem;
  color: var(--text-low);
  text-decoration: none;
  transition: color var(--transition);
  letter-spacing: 0.02em;
}

.top-nav-link:hover,
.top-nav-link.active {
  color: var(--accent);
}

@media (max-width: 600px) {
  .top-nav {
    padding: 0.625rem 1rem;
  }
  .top-nav-links {
    gap: 1rem;
  }
}

/* --- Header / Brand --- */
.brand-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem 1.5rem 0.5rem;
  flex-shrink: 0;
}

.brand-logo {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-high);
  margin-bottom: 0.25rem;
}

.brand-logo .dot {
  color: var(--accent);
}

.kbaas-widget-title {
  display: block;
  font-family: 'Boogaloo', cursive;
  font-size: 3.7em;
  font-weight: 400;
  margin: 0 0 6px 0;
  padding: 0 0 0 8px;
  background: linear-gradient(135deg, #BB86FC, #9b59f5, #e040fb, #BB86FC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

/* --- Hero / Chat Section --- */
.chat-hero {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem 1rem;
}

.chat-helper-text {
  font-size: 0.875rem;
  color: var(--text-low);
  margin-bottom: 0.75rem;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

/* --- Chat Container / Card --- */
.chat-container {
  position: relative;
  width: 100%;
  max-width: 520px;
  flex: 1;
  min-height: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow:
    0 4px 24px var(--shadow-dark),
    0 0 80px var(--accent-dim);
  transition: box-shadow var(--transition);
}

.chat-container:hover {
  box-shadow:
    0 8px 40px var(--shadow-dark),
    0 0 100px var(--accent-glow);
}

/* Glow ring behind the container */
.chat-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: calc(var(--radius-lg) + 2px);
  background: linear-gradient(
    135deg,
    rgba(187, 134, 252, 0.1),
    rgba(187, 134, 252, 0.02),
    rgba(187, 134, 252, 0.08)
  );
  z-index: -1;
  pointer-events: none;
}

#kbaas-widget {
  width: 100%;
  height: 100%;
}

/* --- Trust Badges --- */
.trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-low);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.trust-badges .separator {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-low);
  display: inline-block;
}

.trust-link {
  color: var(--text-low);
  text-decoration: none;
  transition: color var(--transition);
}

.trust-link:hover {
  color: var(--accent);
}

/* --- Footer --- */
.site-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  padding: 1rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.8125rem;
  color: var(--text-low);
  text-decoration: none;
  transition: color var(--transition);
  cursor: pointer;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-low);
  opacity: 0.7;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .brand-header {
    padding: 2rem 1rem 0.75rem;
  }

  .brand-logo {
    font-size: 1.625rem;
  }

  .brand-tagline {
    font-size: 1rem;
  }

  .chat-hero {
    padding: 1rem 1rem 1.5rem;
  }

  .chat-container {
    border-radius: var(--radius-md);
  }

  .chat-container::before {
    border-radius: calc(var(--radius-md) + 2px);
  }

  .footer-links {
    gap: 1rem;
  }
}



/* ================================================
   Widget Internals (.kbaas-*)
   ================================================ */

.kbaas-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-surface);
  border-radius: inherit;
}

/* Messages area */
.kbaas-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.kbaas-messages::-webkit-scrollbar {
  width: 4px;
}
.kbaas-messages::-webkit-scrollbar-track {
  background: transparent;
}
.kbaas-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Message rows */
.kbaas-msg {
  display: flex;
  max-width: 85%;
}
.kbaas-msg.user {
  align-self: flex-end;
}
.kbaas-msg.bot {
  align-self: flex-start;
}

/* Bubbles */
.kbaas-bubble {
  padding: 0.625rem 0.9375rem;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}
.kbaas-msg.user .kbaas-bubble {
  background: var(--accent);
  color: #0d0d0d;
  border-bottom-right-radius: 4px;
}
.kbaas-msg.bot .kbaas-bubble {
  background: var(--bg-surface-high);
  color: var(--text-high);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.kbaas-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 0.25rem 0.125rem;
}
.kbaas-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-low);
  animation: kbaasTyping 1.2s infinite ease-in-out;
}
.kbaas-typing span:nth-child(2) { animation-delay: 0.2s; }
.kbaas-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes kbaasTyping {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30%           { opacity: 1;   transform: scale(1.1); }
}

/* Input row */
.kbaas-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.kbaas-input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-high);
  color: var(--text-high);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}
.kbaas-input::placeholder {
  color: var(--text-low);
}
.kbaas-input:focus {
  border-color: rgba(187, 134, 252, 0.45);
}
.kbaas-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.kbaas-send-btn {
  padding: 0.625rem 1.125rem;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #0d0d0d;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: opacity var(--transition), transform 0.1s ease;
}
.kbaas-send-btn:hover:not(:disabled) {
  opacity: 0.85;
}
.kbaas-send-btn:active:not(:disabled) {
  transform: scale(0.96);
}
.kbaas-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
