/* LRN AI Chatbot Widget */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500&family=Jost:wght@300;400;500&display=swap');

:root {
  --bot-ink: #1a1814;
  --bot-gold: #b8963e;
  --bot-gold-lt: #d4af6a;
  --bot-gold-pale: #f5edda;
  --bot-cream: #faf8f4;
  --bot-white: #ffffff;
  --bot-border: rgba(184,150,62,0.22);
  --bot-shadow: rgba(26,24,20,0.18);
}

/* ── TOGGLE BUTTON ── */
#lrnbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: 'Jost', sans-serif;
}

#lrnbot-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bot-ink);
  border: 1.5px solid var(--bot-gold);
  border-radius: 50px;
  padding: 8px 18px 8px 8px;
  cursor: pointer;
  box-shadow: 0 4px 24px var(--bot-shadow);
  transition: all 0.25s ease;
  position: relative;
}
#lrnbot-toggle:hover {
  background: #2d2820;
  border-color: var(--bot-gold-lt);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--bot-shadow);
}
.lrnbot-btn-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 1.5px solid var(--bot-gold);
  flex-shrink: 0;
}
.lrnbot-btn-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--bot-white);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.lrnbot-notification {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--bot-gold);
  color: var(--bot-white);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lrnbot-pulse 2s infinite;
}
@keyframes lrnbot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.2); opacity: 0.8; }
}

/* ── CHAT WINDOW ── */
#lrnbot-window {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: var(--bot-cream);
  border-radius: 16px;
  border: 1px solid var(--bot-border);
  box-shadow: 0 16px 64px rgba(26,24,20,0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
}
#lrnbot-window.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* ── HEADER ── */
.lrnbot-header {
  background: var(--bot-ink);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(184,150,62,0.2);
  flex-shrink: 0;
}
.lrnbot-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--bot-gold);
  flex-shrink: 0;
}
.lrnbot-header-info { flex: 1; min-width: 0; }
.lrnbot-header-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--bot-white);
  line-height: 1.2;
}
.lrnbot-header-status {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.lrnbot-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
  animation: lrnbot-pulse 2s infinite;
}
.lrnbot-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  flex-shrink: 0;
}
.lrnbot-close:hover { color: var(--bot-gold); }

/* ── MESSAGES ── */
.lrnbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.lrnbot-messages::-webkit-scrollbar { width: 4px; }
.lrnbot-messages::-webkit-scrollbar-track { background: transparent; }
.lrnbot-messages::-webkit-scrollbar-thumb { background: var(--bot-border); border-radius: 2px; }

/* Message bubbles */
.lrnbot-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 100%;
}
.lrnbot-msg.user {
  flex-direction: row-reverse;
}
.lrnbot-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  border: 1px solid var(--bot-border);
}
.lrnbot-msg-avatar.user-avatar {
  background: var(--bot-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--bot-white);
}
.lrnbot-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}
.lrnbot-msg.bot .lrnbot-bubble {
  background: var(--bot-white);
  border: 0.5px solid var(--bot-border);
  border-bottom-left-radius: 4px;
  color: var(--bot-ink);
}
.lrnbot-msg.user .lrnbot-bubble {
  background: var(--bot-ink);
  color: var(--bot-white);
  border-bottom-right-radius: 4px;
}
/* Markdown in bot bubbles */
.lrnbot-bubble strong { font-weight: 500; color: var(--bot-ink); }
.lrnbot-msg.user .lrnbot-bubble strong { color: var(--bot-gold-lt); }
.lrnbot-bubble ul { margin: 6px 0 6px 16px; }
.lrnbot-bubble li { margin-bottom: 3px; }
.lrnbot-bubble a { color: var(--bot-gold); text-decoration: none; }
.lrnbot-bubble a:hover { text-decoration: underline; }
.lrnbot-bubble p { margin: 0 0 6px; }
.lrnbot-bubble p:last-child { margin-bottom: 0; }

/* Typing indicator */
.lrnbot-typing {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.lrnbot-typing-dots {
  background: var(--bot-white);
  border: 0.5px solid var(--bot-border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.lrnbot-typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--bot-gold);
  border-radius: 50%;
  animation: lrnbot-bounce 1.2s infinite;
}
.lrnbot-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.lrnbot-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes lrnbot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-6px); }
}

/* Booking confirmation card */
.lrnbot-booking-card {
  background: var(--bot-gold-pale);
  border: 1px solid var(--bot-gold);
  border-radius: 8px;
  padding: 14px;
  margin-top: 8px;
  font-size: 12px;
}
.lrnbot-booking-card h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--bot-ink);
  margin: 0 0 8px;
}
.lrnbot-booking-card .lrnbot-booking-row {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
  align-items: baseline;
}
.lrnbot-booking-card .lrnbot-booking-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bot-gold);
  min-width: 56px;
  flex-shrink: 0;
  font-weight: 500;
}
.lrnbot-booking-card .lrnbot-booking-val {
  color: var(--bot-ink);
  font-weight: 400;
}
.lrnbot-booking-confirmed {
  font-size: 11px;
  color: #16a34a;
  margin-top: 8px;
  font-weight: 500;
}

/* ── QUICK ACTIONS ── */
.lrnbot-quick {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 0.5px solid var(--bot-border);
  background: var(--bot-white);
  flex-shrink: 0;
}
.lrnbot-quick-btn {
  background: var(--bot-cream);
  border: 0.5px solid var(--bot-border);
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--bot-ink);
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
}
.lrnbot-quick-btn:hover {
  background: var(--bot-gold-pale);
  border-color: var(--bot-gold);
  color: var(--bot-ink);
}

/* ── INPUT ── */
.lrnbot-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 0.5px solid var(--bot-border);
  background: var(--bot-white);
  flex-shrink: 0;
}
.lrnbot-input {
  flex: 1;
  resize: none;
  border: 0.5px solid #d0cbc0;
  background: var(--bot-cream);
  border-radius: 20px;
  padding: 9px 14px;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  color: var(--bot-ink);
  outline: none;
  line-height: 1.5;
  max-height: 100px;
  overflow-y: auto;
  transition: border-color 0.2s;
}
.lrnbot-input:focus { border-color: var(--bot-gold); }
.lrnbot-input::placeholder { color: #aaa; }
.lrnbot-send {
  width: 36px;
  height: 36px;
  background: var(--bot-gold);
  border: none;
  border-radius: 50%;
  color: var(--bot-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}
.lrnbot-send:hover { background: var(--bot-gold-lt); transform: scale(1.08); }
.lrnbot-send:disabled { background: #ccc; transform: none; cursor: not-allowed; }
.lrnbot-footer-note {
  text-align: center;
  font-size: 10px;
  color: #aaa;
  padding: 4px 12px 8px;
  background: var(--bot-white);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ── MOBILE ── */
@media (max-width: 480px) {
  #lrnbot-window {
    right: 8px;
    bottom: 80px;
    width: calc(100vw - 16px);
    height: calc(100vh - 100px);
    border-radius: 12px;
  }
  #lrnbot-toggle {
    right: 8px;
    bottom: 8px;
  }
  .lrnbot-btn-label { display: none; }
  #lrnbot-toggle { padding: 6px; border-radius: 50%; }
}
