/* =========================================
   GLOBAL RESET & APP LOCK
========================================= */
html, body {
  height: 100%;
  margin: 0;
}

body.botkid-app-page {
  background: #f9fafb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden; /* prevent page scroll */
}

/* =========================================
   ROOT APP CONTAINER
========================================= */
#botkid-app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* WordPress admin bar offset */
/* body.admin-bar #botkid-app-root {
  padding-top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar #botkid-app-root {
    padding-top: 46px;
  }
} */


/* =========================================
   APP SHELL (HEADER + SIDEBAR)
========================================= */

#botkid-app-header {
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #ffee00;
  border-bottom: 1px solid #c9c9c9;
}

.botkid-app-logo {
  height: 36px;
  margin-left: auto;
}

.botkid-app-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

#botkid-app-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

#botkid-app-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fecb00;
  border-right: 1px solid #bfbf00;
  padding: 16px;
  box-sizing: border-box;
}

.botkid-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #111827;
  font-size: 14px;
  margin-bottom: 6px;
}

.botkid-sidebar-nav .icon {
  width: 20px;
  height: 20px;
  fill: currentColor; /* inherits text color */
  flex-shrink: 0;
}

.botkid-sidebar-nav a.active,
.botkid-sidebar-nav a:hover {
  background: #eef2ff;
  color: var(--botkid-primary);
}

#botkid-app-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;              /* vertical centering */
  padding: 32px 24px;               /* space from all edges */
  box-sizing: border-box;
  overflow: hidden;
}

#botkid-sidebar-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #111827;
}

@media (max-width: 768px) {
  #botkid-sidebar-toggle {
    display: block;
  }

  #botkid-app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: #fecb00;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 100000;
  }

  body.botkid-sidebar-open #botkid-app-sidebar {
    transform: translateX(0);
  }

  /* optional dim backdrop */
  body.botkid-sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 99999;
  }
}

/* ===============================
   Sidebar Profile (Demo Avatar)
================================ */

.botkid-sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid #bfbf00;
  margin-bottom: 5px;
}

.botkid-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--botkid-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.botkid-profile-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.botkid-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.botkid-sub {
  font-size: 12px;
  color: #6b7280;
}

/* =========================================
   PAGE WRAPPER
========================================= */
#botkid-page {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 24px;
  box-sizing: border-box;
}

/* =========================================
   HEADER (LOGO + TITLE)
========================================= */
#botkid-page-header {
  padding: 24px 0 16px;
}

.botkid-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
}

.botkid-header-logo {
  height: 72px;
  width: auto;
}

.botkid-header-text h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  color: #111827;
}

.botkid-header-text p {
  margin: 6px 0 0;
  font-size: 18px;
  color: #4b5563;
  max-width: 640px;
}

/* Header stacking on small screens */
@media (max-width: 640px) {
  .botkid-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .botkid-header-text h1 {
    font-size: 32px;
  }

  .botkid-header-text p {
    font-size: 15px;
  }
}

/* =========================================
   CHAT SHELL
========================================= */
#botkid-chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.08);
  overflow: hidden;

  /* soft ceiling so it never grows too tall */
  max-height: calc(100vh - 315px);
}

/* =========================================
   CHAT MESSAGES (SCROLL AREA)
========================================= */
#botkid-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  background: #f9fafb;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

/* Custom scrollbar */
#botkid-chat-messages::-webkit-scrollbar {
  width: 6px;
}
#botkid-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.25);
  border-radius: 4px;
}

/* Chat bubbles */
.botkid-user,
.botkid-bot {
  max-width: 70%;
  line-height: 1.5;
  font-size: 15px;
  margin-bottom: 12px;
}

.botkid-user {
  margin-left: auto;
  background: var(--botkid-primary);
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px 14px 4px 14px;
}

.botkid-bot {
  margin-right: auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #1f2937;
  padding: 12px 14px;
  border-radius: 14px 4px 14px 14px;
}

/* =========================================
   INPUT AREA
========================================= */
#botkid-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

#botkid-chat-input input {
  flex: 1;
  padding: 14px 16px;
  font-size: 15px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  outline: none;
}

#botkid-chat-input input:focus {
  border-color: var(--botkid-primary);
  box-shadow: 0 0 0 3px rgba(249,168,38,0.15);
}

#botkid-chat-input button {
  background: var(--botkid-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  cursor: pointer;
}

/* Disabled state */
.botkid-input-disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* =========================================
   UTILITY BAR (EXPERT + RESET)
========================================= */
#botkid-utility-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

/* =========================================
   EXPERT DROPDOWN
========================================= */
#botkid-expert-menu {
  position: absolute;
  bottom: 56px;
  left: 12px;
  width: calc(100% - 5px);
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 24px 50px rgba(0,0,0,0.18);
  display: none;
  z-index: 1000002;
  overflow: hidden;
  animation: botkidMenuFadeUp 0.18s ease;
}

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

#botkid-expert-menu::before {
  content: "Talk to an Expert";
  display: block;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.botkid-expert-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  text-decoration: none;
  border-bottom: 1px solid #f3f4f6;
}

.botkid-expert-option:last-child {
  border-bottom: none;
}

.botkid-expert-option:hover {
  background: #f5f7ff;
  color: var(--botkid-primary);
}

/* ===============================
   Typing Indicator
================================ */
.botkid-typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px 4px 14px 14px;
  margin-bottom: 12px;
  width: fit-content;
}

.botkid-typing .dot {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: botkidTyping 1.4s infinite ease-in-out;
}

.botkid-typing .dot:nth-child(1) { animation-delay: 0s; }
.botkid-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.botkid-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes botkidTyping {
  0%   { opacity: 0.3; transform: translateY(0); }
  20%  { opacity: 1; transform: translateY(-3px); }
  40%  { opacity: 0.3; transform: translateY(0); }
}

/* ===============================
   Bot Response Typography
================================ */

/* Headings inside bot replies */
.botkid-bot h1,
.botkid-bot h2,
.botkid-bot h3 {
  margin: 12px 0 6px;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
}

/* Map markdown levels visually */
.botkid-bot h1 {
  font-size: 18px;
}

.botkid-bot h2 {
  font-size: 16px;
}

.botkid-bot h3 {
  font-size: 15px;
}

.botkid-bot p {
  margin: 0 0 8px;
}

.botkid-bot p:last-child {
  margin-bottom: 0;
}

.botkid-bot ul.botkid-list,
.botkid-bot ul {
  margin: 8px 0 8px 18px;
  padding: 0;
}

.botkid-bot ul.botkid-list li,
.botkid-bot li {
  margin-bottom: 6px;
  list-style: disc;
}

.botkid-bot strong {
  font-weight: 600;
}

.botkid-bot em {
  font-style: italic;
}


/* ===============================
   Suggestion
================================ */

#botkid-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 20px;
}

.botkid-suggestion {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  color: #111827;
  transition: all 0.15s ease;
  line-height: normal;
}

.botkid-suggestion:hover {
  background: #eef2ff;
  border-color: var(--botkid-primary);
  color: var(--botkid-primary);
}


/* =========================================
   LARGE DESKTOP ENHANCEMENTS
========================================= */
@media (min-width: 1200px) {

  #botkid-page {
    max-width: 1300px;
  }

  .botkid-header-logo {
    height: 105px;
  }

  .botkid-header-text h1 {
    font-size: 52px;
  }

  .botkid-header-text p {
    font-size: 20px;
  }

  #botkid-chat-messages {
    padding: 32px 48px;
  }

  .botkid-user,
  .botkid-bot {
    font-size: 16px;
  }
}

/* Laptops */
@media (max-height: 900px) {
  #botkid-chat-container {
    max-height: calc(100vh - 330px);
  }
}

/* Large desktops */
@media (min-height: 1100px) {
  #botkid-chat-container {
    max-height: calc(100vh - 820px);
  }
}


/* =========================================
   SHORT SCREEN FIX (LAPTOPS)
========================================= */
@media (max-height: 800px) {
  #botkid-chat-messages {
    padding: 16px;
  }

  #botkid-chat-input {
    padding: 12px;
  }
}
