/* =============================================
   Relotax AI Chat - Stylesheet
   כל הסטיילים של הצ'אט עם prefix relotax
   כדי למנוע התנגשויות עם תוספים אחרים
   ============================================= */

/* ── גופנים ── */
@import url('https://fonts.googleapis.com/css2?family=David+Libre:wght@400;500;700&family=Assistant:wght@300;400;600;800&display=swap');

/* ── עטיפה ראשית ── */
#relotax-chat-container {
  font-family: 'David Libre', serif !important;
}

.relotax-chat-wrapper {
  display: flex;
  flex-direction: column;
  height: 580px;
  background-color: #131314;
  color: #ffffff;
  border: 1px solid #3c4043;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  margin-left: auto;
  margin-right: auto;
  max-width: 64rem;
  margin-bottom: 2.5rem;
  direction: rtl;
}

/* ── Header ── */
.relotax-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #3c4043;
  flex-shrink: 0;
}

.relotax-header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.relotax-header-title {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.025em;
}

/* ── אזור הודעות ── */
.relotax-messages {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── שורת הודעה ── */
.relotax-msg-row {
  display: flex;
  width: 100%;
}

.relotax-msg-inner {
  display: flex;
  max-width: 95%;
  gap: 1.5rem;
  flex-direction: row;
  width: 100%;
}

/* ── אווטר ── */
.relotax-avatar {
  flex-shrink: 0;
  margin-top: 0.25rem;
}

/* ── תוכן הודעה ── */
.relotax-msg-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

/* ── תווית מודל ── */
.relotax-model-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #60a5fa;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

/* ── בועות הודעה ── */
.relotax-bubble-user {
  font-size: 17.5px;
  white-space: pre-wrap;
  background-color: #2f2f2f;
  padding: 0.75rem 1.5rem;
  border-radius: 24px;
  align-self: flex-start;
  text-align: right;
  unicode-bidi: plaintext;
  line-height: 1.6;
}

.relotax-bubble-assistant {
  font-size: 17.5px;
  white-space: pre-wrap;
  background-color: transparent;
  text-align: right;
  unicode-bidi: plaintext;
  line-height: 1.6;
}

/* ── קישורים בתוך הודעות ── */
.relotax-link {
  color: #60a5fa;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.relotax-link:hover {
  color: #93c5fd;
}

/* ── תג ליד נשלח ── */
.relotax-lead-badge {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(20, 83, 45, 0.3);
  border: 1px solid rgba(21, 128, 61, 0.5);
  color: #4ade80;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  width: fit-content;
}

/* ── footer מודל ── */
.relotax-model-footer {
  margin-top: 1.5rem;
  font-size: 12px;
  color: #6b7280;
  border-top: 1px solid #3c4043;
  padding-top: 0.5rem;
  width: fit-content;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.relotax-source-docs {
  color: #4ade80;
}

.relotax-source-web {
  color: #60a5fa;
}

/* ── אנימציית טעינה ── */
.relotax-loading {
  display: flex;
  gap: 1.5rem;
  animation: relotax-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes relotax-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.relotax-loading-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.relotax-loading-bar {
  height: 1rem;
  width: 12rem;
  background-color: #2f2f2f;
  border-radius: 9999px;
}

.relotax-loading-text {
  font-size: 0.75rem;
  color: #60a5fa;
  font-weight: 700;
}

/* ── אנימציית כניסה ── */
.relotax-fadein {
  animation: relotax-fadein 0.2s ease-in;
}

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

/* ── אזור input ── */
.relotax-input-area {
  padding: 1.5rem;
  background-color: #131314;
  flex-shrink: 0;
}

.relotax-input-container {
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
}

.relotax-input-box {
  background-color: #1e1f20;
  border-radius: 32px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.relotax-input-box:focus-within {
  border-color: #3c4043;
}

/* ── Textarea ── */
.relotax-textarea {
  width: 100%;
  background: transparent;
  border: none;
  font-size: 16px;
  padding: 1rem;
  outline: none;
  resize: none;
  color: #ffffff;
  font-family: 'David Libre', serif;
}

.relotax-textarea::placeholder {
  color: #8e918f;
}

.relotax-textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── תצוגת קבצים מצורפים ── */
.relotax-files-preview {
  margin: 0 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.relotax-file-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: #2a2b2d;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #8e918f;
}

.relotax-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffffff;
}

.relotax-file-remove {
  color: #f87171;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.875rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.relotax-file-remove:hover {
  color: #fca5a5;
}

/* ── כפתורים ── */
.relotax-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
}

.relotax-btn-attach,
.relotax-btn-send {
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  transition: color 0.15s ease;
  color: #8e918f;
  display: flex;
  align-items: center;
  justify-content: center;
}

.relotax-btn-attach:hover {
  color: #ffffff;
}

.relotax-btn-send {
  color: #ffffff;
}

.relotax-btn-send:hover {
  color: #60a5fa;
}

.relotax-btn-disabled {
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: not-allowed;
  outline: none;
  color: #3c4043;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── אנימציית spinner ── */
.relotax-spin {
  animation: relotax-spin 1s linear infinite;
}

@keyframes relotax-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── כתב ויתור ── */
.relotax-disclaimer {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 11px;
  color: #8e918f;
}

/* ── Scrollbar מותאם ── */
.relotax-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.relotax-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.relotax-scrollbar::-webkit-scrollbar-thumb {
  background: #3c4043;
  border-radius: 10px;
}

.relotax-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #5f6368;
}

/* ── input נסתר ── */
.relotax-hidden {
  display: none;
}

/* ── Responsive: מסכים קטנים ── */
@media (max-width: 768px) {
  .relotax-chat-wrapper {
    height: 100dvh;
    border-radius: 0;
    margin-bottom: 0;
    max-width: 100%;
  }

  .relotax-messages {
    padding: 1rem;
  }

  .relotax-input-area {
    padding: 0.75rem;
  }

  .relotax-bubble-user,
  .relotax-bubble-assistant {
    font-size: 15px;
  }
}
