/* כפתור הבועה הצף */
#chatFab {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: linear-gradient(135deg, #5d4037, #8d6e63);
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  font-size: 24px;
}

/* הפאנל הראשי של הצ'אט */
#chatPanel {
  position: fixed;
  bottom: 85px;
  right: 16px;
  width: 340px;
  height: 500px;
  background: #fffaf0; /* רקע קרם עדין */
  border-radius: 15px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  border: 1px solid #d7ccc8;
}

.chat-hidden {
  display: none !important;
}


/* ===== Avatar Container (Above Chat Header) ===== */


#avatarContainer {
  position: fixed;
  bottom: 585px;
  right: 16px;
  width: 340px;
  height: 220px;
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  z-index: 10001;
  pointer-events: none;
}




#avatarFace {
  width: 200px;
  height: 200px;
  object-fit: contain;
  pointer-events: none; /* שלא יפריע ללחיצות */
}


/* כותרת הצ'אט */
.chat-header {
  padding: 15px;
  background: linear-gradient(135deg, #3e2723, #5d4037);
  color: #efebe9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.chat-header button {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 18px;
}

/* כפתורי שליטה בחלון הצ'אט (הגדל/מסך מלא/סגור) */
.chat-window-controls{
  display:flex;
  gap:8px;
  align-items:center;
}

.chat-window-controls button{
  width:32px;
  height:32px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.10);
  color:#fff;
  cursor:pointer;
  font-size:16px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.chat-window-controls button:hover{
  background: rgba(255,255,255,0.22);
}


/* כפתורי ניהול (שיחה חדשה ושמירה) */
.chat-management {
  display: flex;
  gap: 5px;
  padding: 10px;
  background: #efebe9;
}

.chat-management button {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: opacity 0.2s;
}

#newChatBtn { background: #8d6e63; color: white; }
#exportHistoryBtn { background: #a1887f; color: white; }

/* שורת כפתורי הפעולה (קצר, מיקרופון, הקראה, עצור) */
.chat-actions {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: #d7ccc8;
  justify-content: space-between;
}

.chat-actions button {
  flex: 1;
  padding: 7px 2px;
  background: #f5f5f5;
  color: #3e2723;
  border: 1px solid #bcaaa4;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

#stopBtn { background: #d32f2f !important; color: white !important; border: none; }
#voiceBtn { background: #efebe9; }

/* אזור ההודעות */
#chatMessages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  font-size: 16px;
  background: linear-gradient(to bottom, #fffaf0, #efebe9);
}

/* הגדלת טקסט כשהצ'אט במצב גדול */
#chatPanel.chat-large #chatMessages {
  font-size: 18px;
}

/* הגדלת טקסט כשהצ'אט במסך מלא */
#chatPanel.chat-fullscreen #chatMessages {
  font-size: 20px;
}


/* עיצוב הודעת AI */
#chatMessages div[style*="background:#f0f0f0"], 
#chatMessages div[style*="background: rgb(240, 240, 240)"] {
  background: white !important;
  border: 1px solid #d7ccc8;
  border-right: 4px solid #8d6e63;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
}

/* כפתורי פעולה מהירה */
.chat-quick-actions {
  display: flex;
  gap: 5px;
  padding: 10px;
  background: #fff;
  border-top: 1px solid #d7ccc8;
  flex-wrap: wrap;
}

.chat-quick-actions button {
  padding: 6px 12px;
  background: #efebe9;
  color: #5d4037;
  border: 1px solid #d7ccc8;
  border-radius: 15px;
  cursor: pointer;
  font-size: 11px;
}

/* אזור קלט (שדה הכתיבה) */
.chat-input {
  display: flex;
  padding: 10px;
  background: white;
  border-top: 1px solid #d7ccc8;
}

.chat-input input {
  flex: 1;
  padding: 10px;
  border: 1px solid #d7ccc8;
  border-radius: 20px;
  outline: none;
  margin-left: 8px;
}

.chat-input button {
  background: #5d4037;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
}

.chat-input button:hover {
  background: #3e2723;
}
/* עיצוב משודרג לכפתור הרמקול */
.chat-messages div button {
    position: absolute;
    bottom: 8px;
    left: 8px; /* מצמיד לשמאל בהודעות AI */
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.3); /* רקע לבן שקוף */
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%; /* הופך לעיגול מושלם */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    opacity: 0.8;
    z-index: 10;
}

/* אפקט במעבר עכבר */
.chat-messages div button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.1); /* הגדלה קלה */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* כשהכפתור במצב "השתקה" (🔇) הוא יקבל גוון אדמדם */
.chat-messages div button:active {
    background: #ffeaea;
}


/* מצב עבודה – חלון גדול */
#chatPanel.chat-large {
  width: 520px;
  height: 75vh;
  bottom: 16px;
  right: 16px;
}

/* מצב מסך מלא */
#chatPanel.chat-fullscreen {
  width: 100vw;
  height: 100vh;
  bottom: 0;
  right: 0;
  border-radius: 0;
  z-index: 10000;
}

/* בחירת מודל AI */
#modelSelect {
  margin-right: auto;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #bcaaa4;
  background: #fffaf0;
  color: #3e2723;
  font-size: 12px;
  cursor: pointer;
}

/* כותרות ספקים (Claude / GPT / Gemini) */
#modelSelect optgroup {
  font-weight: bold;
  color: #3e2723;
}

/* אופציות מודלים */
#modelSelect option {
  font-weight: normal;
  color: #5d4037;
}
/* בחירת מודל – מצב רגיל */
#modelSelect {
  max-width: 180px;
  font-size: 13px;
  padding: 4px 6px;
}

/* כשצ'אט מוגדל */
.chat-large #modelSelect {
  max-width: 220px;
  font-size: 14px;
}

/* מסך מלא */
.chat-fullscreen #modelSelect {
  max-width: 260px;
  font-size: 15px;
}

/* ===== עיצוב Markdown ===== */
.markdown-content {
  line-height: 1.6;
  color: #333;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  margin-top: 16px;
  margin-bottom: 8px;
  font-weight: bold;
}

.markdown-content h1 { font-size: 1.5em; }
.markdown-content h2 { font-size: 1.3em; }
.markdown-content h3 { font-size: 1.1em; }

.markdown-content p {
  margin: 8px 0;
}

.markdown-content ul,
.markdown-content ol {
  margin: 8px 0;
  padding-right: 20px;
}

.markdown-content li {
  margin: 4px 0;
}

.markdown-content code {
  background: #f4f4f4;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #c7254e;
}

.markdown-content pre {
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 12px;
  overflow-x: auto;
  margin: 12px 0;
  direction: ltr;
  text-align: left;
}

.markdown-content pre code {
  background: none;
  padding: 0;
  color: #333;
}

.markdown-content blockquote {
  border-right: 4px solid #ddd;
  padding-right: 12px;
  margin: 12px 0;
  color: #666;
  font-style: italic;
}

.markdown-content a {
  color: #0066cc;
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
}

.markdown-content hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 16px 0;
}

