/* ==========================================================
   OPERIS AI ASSISTANT — STYLES
   ========================================================== */

:root {
  --bot-accent: #38b27d;
  --bot-accent-hover: #4ade9f;
  --bot-dark: #10110e;
  --bot-surface: #181915;
  --bot-card: #20211c;
  --bot-border: #2c2e27;
  --bot-text: #f0f0ea;
  --bot-muted: #96968f;
  --bot-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
}

/* Floating Launcher Button */
.operis-bot-launcher {
  position: fixed;
  bottom: 96px;
  right: 28px;
  left: auto;
  z-index: 9980;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bot-dark);
  color: var(--bot-text);
  border: 1px solid var(--bot-border);
  padding: 8px 16px 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  user-select: none;
}

.operis-bot-launcher:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--bot-accent);
  box-shadow: 0 14px 34px rgba(56, 178, 125, 0.22);
}

.operis-bot-launcher .launcher-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1c1d18;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border: 1px solid rgba(56, 178, 125, 0.4);
}

.operis-bot-launcher .launcher-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.operis-bot-launcher .launcher-online {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: var(--bot-accent);
  border: 2px solid var(--bot-dark);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--bot-accent);
}

.operis-bot-launcher .launcher-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.operis-bot-launcher .launcher-title {
  font-weight: 600;
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.operis-bot-launcher .launcher-sub {
  font-size: 10px;
  color: var(--bot-accent);
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 600;
}

.operis-bot-launcher .sparkle-icon {
  width: 13px;
  height: 13px;
  fill: var(--bot-accent);
  animation: sparkPulse 2.4s infinite ease-in-out;
}

@keyframes sparkPulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.2) rotate(15deg); opacity: .7; }
}

/* Chat Container Modal */
.operis-bot-panel {
  position: fixed;
  bottom: 96px;
  right: 28px;
  left: auto;
  width: 390px;
  max-width: calc(100vw - 36px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: var(--bot-surface);
  border: 1px solid var(--bot-border);
  border-radius: 20px;
  box-shadow: var(--bot-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9990;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity .25s ease, transform .25s cubic-bezier(.2,.8,.2,1), visibility .25s;
  font-family: inherit;
}

.operis-bot-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.operis-bot-header {
  padding: 16px 18px;
  background: var(--bot-dark);
  border-bottom: 1px solid var(--bot-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.operis-bot-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-header-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(56, 178, 125, 0.4);
}

.bot-header-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.bot-header-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.bot-header-status {
  font-size: 11px;
  color: var(--bot-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.bot-header-status .live-pip {
  width: 7px;
  height: 7px;
  background: var(--bot-accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--bot-accent);
}

.operis-bot-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-icon-btn {
  background: transparent;
  border: 0;
  color: var(--bot-muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s;
  font-size: 16px;
}

.bot-icon-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

/* Chat Messages View */
.operis-bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.operis-bot-messages::-webkit-scrollbar {
  width: 5px;
}
.operis-bot-messages::-webkit-scrollbar-thumb {
  background: #2f3128;
  border-radius: 4px;
}

/* Chat Message Bubbles */
.bot-msg {
  display: flex;
  gap: 10px;
  max-width: 90%;
  animation: botFadeIn .25s ease-out;
}

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

.bot-msg.bot {
  align-self: flex-start;
}

.bot-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.bot-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.bot-msg-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.bot-bubble {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--bot-text);
  word-break: break-word;
}

.bot-msg.bot .bot-bubble {
  background: var(--bot-card);
  border: 1px solid var(--bot-border);
  border-top-left-radius: 4px;
}

.bot-msg.user .bot-bubble {
  background: var(--bot-accent);
  color: #0b0c0a;
  font-weight: 500;
  border-top-right-radius: 4px;
}

.bot-bubble strong {
  color: #fff;
  font-weight: 600;
}
.bot-msg.user .bot-bubble strong {
  color: #000;
}

.bot-bubble p {
  margin: 0 0 8px 0;
}
.bot-bubble p:last-child {
  margin-bottom: 0;
}

.bot-bubble ul {
  margin: 6px 0 6px 18px;
  padding: 0;
}
.bot-bubble li {
  margin-bottom: 4px;
}

.bot-bubble a {
  color: var(--bot-accent);
  text-decoration: underline;
  font-weight: 500;
}

.bot-bubble a:hover {
  color: var(--bot-accent-hover);
}

.bot-msg.user .bot-bubble a {
  color: #000;
}

/* Jump Section Buttons in Chat */
.bot-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.bot-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(56, 178, 125, 0.12);
  color: var(--bot-accent);
  border: 1px solid rgba(56, 178, 125, 0.3);
  text-decoration: none!important;
  cursor: pointer;
  transition: all .2s;
}

.bot-action-pill:hover {
  background: var(--bot-accent);
  color: #10110e!important;
  border-color: var(--bot-accent);
}

/* Prompt Chips Suggestions */
.bot-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.bot-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #2f302a;
  color: #d1d0c8;
  padding: 6px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all .2s;
  text-align: left;
}

.bot-chip:hover {
  border-color: var(--bot-accent);
  color: #fff;
  background: rgba(56, 178, 125, 0.1);
  transform: translateY(-1px);
}

/* Typing Indicator Animation */
.bot-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
}

.bot-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--bot-muted);
  border-radius: 50%;
  animation: botBounce 1.4s infinite ease-in-out;
}
.bot-typing-dot:nth-child(2) { animation-delay: .2s; }
.bot-typing-dot:nth-child(3) { animation-delay: .4s; }

@keyframes botBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Input Area */
.operis-bot-input-area {
  padding: 12px 14px;
  background: var(--bot-dark);
  border-top: 1px solid var(--bot-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.operis-bot-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--bot-border);
  border-radius: 24px;
  padding: 10px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}

.operis-bot-input:focus {
  border-color: var(--bot-accent);
}

.operis-bot-input::placeholder {
  color: #6d6e66;
}

.operis-bot-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bot-accent);
  border: 0;
  color: #10110e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s, transform .2s;
}

.operis-bot-send:hover {
  background: var(--bot-accent-hover);
  transform: scale(1.05);
}

.operis-bot-send svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  margin-left: 2px;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .operis-bot-launcher {
    bottom: 80px;
    right: 20px;
    left: auto;
    padding: 6px 12px 6px 8px;
  }
  .operis-bot-launcher .launcher-text {
    display: none; /* Icon-only on mobile so it stays compact above WhatsApp */
  }
  .operis-bot-panel {
    bottom: 76px;
    left: 14px;
    right: 14px;
    width: auto;
    height: calc(100vh - 100px);
    transform-origin: bottom right;
  }
}
