:root {
  --kairon-purple: #4a148c;
  /* Deep Purple Brand */
  --kairon-accent: #7c4dff;
  --kairon-blue: #2962ff;
  /* Blue for Send Button */
  --kairon-purple: #4a148c;
  /* Deep Purple Brand */
  --kairon-accent: #7c4dff;
  --kairon-blue: #2962ff;
  /* Blue for Send Button */
  --white: #ffffff;
  --text-main: #ffffff;
  /* Changed to White */
}

* {
  box-sizing: border-box;
}

body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  margin: 0;
}

/* Main Panel - Fixed Layout */
#kairon-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 380px;
  height: 650px;
  max-height: 90vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
  font-family: sans-serif;
  border: 1px solid #e0e0e0;
}

/* HEADER - Fixed Top */
.panel-header {
  flex-shrink: 0;
  height: 60px;
  background: var(--kairon-purple);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.panel-header .left-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header .logo-placeholder {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-header .logo-placeholder img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.panel-header .title {
  font-weight: bold;
  font-size: 18px;
  letter-spacing: 0.5px;
}

.panel-header .close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* MESSAGES - Scrollable Middle */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  gap: 16px;
  background: #1e1e1e;
  /* Dark Bg */
  overscroll-behavior: contain;
}

/* Chat Bubbles */
.msg {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.4;
  position: relative;
  font-weight: 500;
}

/* Bot: Purple Outline */
.msg.bot {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: #2d2d2d;
  /* Dark Bot Msg */
  border: 1px solid var(--kairon-purple);
  color: #fff;
  /* White Text */
}

/* User: Light Purple Fill */
.msg.user {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--kairon-purple);
  /* Dark Purple Bg */
  border: none;
  color: #fff;
  /* White Text */
}

.msg.agent {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: #fff;
  border: 1px solid #10b981;
  color: #059669;
}

.msg.system {
  align-self: center;
  border: none;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* INTERACTIVE AREA - Fixed above Footer */
.interactive-area {
  flex-shrink: 0;
  flex-shrink: 0;
  background: #1e1e1e;
  /* Dark Bg */
  padding: 10px 16px;
  border-top: 1px solid #333;
  /* Thin black border */
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}

/* Horizontal Categories */
.kairon-controls {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--kairon-purple) #f0f0f0;
}

.kairon-controls::-webkit-scrollbar {
  height: 4px;
}

.kairon-controls::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 2px;
}

.kairon-controls::-webkit-scrollbar-thumb {
  background: var(--kairon-purple);
  border-radius: 2px;
}

.kairon-controls::-webkit-scrollbar-thumb:hover {
  background: #6a1b9a;
}

.kairon-categories {
  display: flex;
  gap: 8px;
}

.kairon-categories button,
.category-chip {
  white-space: nowrap;
  white-space: nowrap;
  padding: 8px 16px;
  background: #2d2d2d;
  /* Dark Bg */
  border: 1px solid #444;
  /* Thin black border */
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  /* White Text */
  cursor: pointer;
  transition: all 0.2s;
}

.kairon-categories button.active,
.kairon-categories button:hover,
.category-chip.active,
.category-chip:hover {
  background: var(--kairon-purple);
  color: #fff;
}

.kairon-browse-all {
  display: none;
}

/* Vertical Suggestions */
.kairon-faq-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 120px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.kairon-faq-pane button,
.suggestion-btn {
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  background: #2d2d2d;
  /* Dark Bg */
  border: 1px solid #444;
  /* Thin black border */
  border-radius: 20px;
  font-size: 14px;
  color: #fff;
  /* White Text */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.kairon-faq-pane button:hover,
.suggestion-btn:hover {
  background: #f3e5f5;
  border-color: var(--kairon-purple);
}

/* FOOTER - Fixed Bottom */
.composer {
  flex-shrink: 0;
  padding: 16px;
  flex-shrink: 0;
  padding: 16px;
  background: #1e1e1e;
  /* Dark Bg */
  border-top: 1px solid #333;
  /* Thin black border */
  display: flex;
  align-items: center;
  gap: 12px;
}

.composer input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  color: #fff;
  /* White Text */
  font-weight: 500;
  background: transparent;
  /* Transparent Bg */
}

.composer input::placeholder {
  color: var(--kairon-purple);
  opacity: 0.7;
}

.composer button {
  width: 48px;
  height: 36px;
  background: var(--kairon-blue);
  border: none;
  border-radius: 8px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.composer button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.composer button:hover {
  background: #1e40ff;
}

/* Launcher Button */
#kairon-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: #ffffff;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#kairon-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #kairon-panel {
        width: 90%;
        height: 40vh;
        max-height: 450px;
        bottom: 80px;
        right: 5%;
        left: auto;
        transform: none;
        border-radius: 12px;
    }
    
    #kairon-button {
        width: 56px;
        height: 56px;
        bottom: 15px;
        right: 5%;
    }
    
    .panel-header {
        height: 50px;
        padding: 0 12px;
    }
    
    .panel-header .title {
        font-size: 15px;
    }
    
    .panel-header .logo-placeholder {
        width: 28px;
        height: 28px;
    }
    
    .panel-header .logo-placeholder img {
        width: 20px;
        height: 20px;
    }
    
    .messages {
        padding: 10px;
        gap: 10px;
    }
    
    .msg {
        max-width: 85%;
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .interactive-area {
        padding: 6px 10px;
        gap: 6px;
    }
    
    .kairon-categories button,
    .category-chip {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .kairon-faq-pane {
        max-height: 80px;
        gap: 6px;
    }
    
    .kairon-faq-pane button,
    .suggestion-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .composer {
        padding: 10px;
        gap: 8px;
    }
    
    .composer input {
        font-size: 14px;
    }
    
    .composer button {
        width: 40px;
        height: 32px;
    }
    
    .composer button svg {
        width: 18px;
        height: 18px;
    }
}
