﻿/* =========================================
   FIXBOT BUTTON
   ========================================= */

.ai-chat-button {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 50%;
  background: #21a9d2;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  z-index: 999999;
  font-family: "IBM Plex Sans", sans-serif;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

  .ai-chat-button i {
    font-size: 23px;
  }

  .ai-chat-button span {
    font-size: 10px;
    font-weight: 700;
  }

  .ai-chat-button:hover {
    background: #1598c1;
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.30);
  }


/* =========================================
   FIXBOT WINDOW
   ========================================= */

.ai-chat-window {
  position: fixed;
  left: 20px;
  bottom: 100px;
  width: 420px;
  height: 560px;
  background: #ffffff;
  border: 1px solid #e4eaf2;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.20);
  z-index: 999998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: "IBM Plex Sans", sans-serif;
  transition: width 0.2s ease, height 0.2s ease, top 0.2s ease, left 0.2s ease, bottom 0.2s ease, transform 0.2s ease;
}


/* =========================================
   EXPANDED WINDOW
   ========================================= */

.ai-chat-window-expanded {
  width: 80vw !important;
  height: 82vh !important;
  max-width: 1400px;
  max-height: 950px;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%);
}


/* =========================================
   HEADER
   ========================================= */

.ai-chat-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #e4eaf2;
  background: #f4f7fb;
}

.ai-chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: #334155;
}

  .ai-chat-title i {
    color: #21a9d2;
    font-size: 20px;
  }

.ai-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-chat-expand,
.ai-chat-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

  .ai-chat-expand:hover,
  .ai-chat-close:hover {
    background: #e7edf5;
  }


/* =========================================
   CHAT BODY
   ========================================= */

.ai-chat-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.ai-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}


/* =========================================
   SIDEBAR
   ========================================= */

.ai-chat-sidebar {
  display: none;
  width: 280px;
  min-width: 280px;
  padding: 16px;
  border-right: 1px solid #e4eaf2;
  background: #f8fafc;
  overflow-y: auto;
}

.ai-chat-window-expanded .ai-chat-sidebar {
  display: block;
}

.ai-chat-sidebar-title {
  margin-bottom: 18px;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.ai-chat-question-group {
  margin-bottom: 22px;
}

.ai-chat-question-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

  .ai-chat-question-group-title i {
    width: 18px;
    color: #64748b;
  }

.ai-chat-question {
  width: 100%;
  margin-bottom: 6px;
  padding: 8px 10px;
  border: 1px solid #e4eaf2;
  border-radius: 7px;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

  .ai-chat-question:hover {
    background: #e7edf5;
    border-color: #cbd5e1;
  }


/* =========================================
   MESSAGES
   ========================================= */

.ai-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #ffffff;
}

.ai-message {
  display: flex;
  margin-bottom: 14px;
}

.ai-message-content {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}


/* ASSISTANT */

.ai-message-assistant {
  justify-content: flex-start;
}

  .ai-message-assistant .ai-message-content {
    background: #f1f5f9;
    color: #334155;
  }


/* USER */

.ai-message-user {
  justify-content: flex-end;
}

  .ai-message-user .ai-message-content {
    background: #21a9d2;
    color: #ffffff;
  }


/* =========================================
   MARKDOWN CONTENT
   ========================================= */

.ai-message-content p {
  margin: 0 0 8px 0;
}

  .ai-message-content p:last-child {
    margin-bottom: 0;
  }

.ai-message-content ul,
.ai-message-content ol {
  margin: 6px 0 10px 18px;
  padding: 0;
}

.ai-message-content li {
  margin-bottom: 4px;
}

.ai-message-content strong {
  font-weight: 700;
}

.ai-message-content em {
  font-style: italic;
}

.ai-message-content h1,
.ai-message-content h2,
.ai-message-content h3,
.ai-message-content h4 {
  margin: 8px 0 6px 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.ai-message-content code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #eaf1f7;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.ai-message-content pre {
  margin: 8px 0;
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  background: #eaf1f7;
  font-family: Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

  .ai-message-content pre code {
    padding: 0;
    background: transparent;
  }


/* =========================================
   INPUT
   ========================================= */

.ai-chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e4eaf2;
  background: #ffffff;
}

.ai-chat-input {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  padding: 10px 12px;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  outline: none;
  resize: none;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
}

  .ai-chat-input:focus {
    border-color: #21a9d2;
  }


/* =========================================
   SEND BUTTON
   ========================================= */

.ai-chat-send {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: #21a9d2;
  color: #ffffff;
  cursor: pointer;
}

  .ai-chat-send:hover {
    background: #1598c1;
  }
