/* Solarni Asistent — Chatbot Styles */
#chat-bubble {
  position: fixed; bottom: 24px; right: 24px; z-index: 99998;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff; font-size: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(34,197,94,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
}
#chat-bubble:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(34,197,94,0.5); }

#chat-panel {
  position: fixed; bottom: 96px; right: 24px; z-index: 99999;
  width: 380px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 120px);
  background: var(--bg-card, #1a1a2e); border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--border-color, #333);
}

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff; font-weight: 700; font-size: 15px;
}
.chat-header button {
  background: none; border: none; color: #fff; font-size: 18px;
  cursor: pointer; opacity: 0.8; padding: 0 4px;
}
.chat-header button:hover { opacity: 1; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}

.chat-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.5; word-wrap: break-word;
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--bg-secondary, #252540);
  color: var(--text-primary, #e0e0e0);
  border-bottom-left-radius: 4px;
}
.chat-msg.user {
  align-self: flex-end;
  background: #22c55e; color: #fff;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.chat-msg.typing { display: flex; gap: 4px; padding: 12px 18px; }
.chat-msg.typing .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted, #888);
  animation: bounce 1.2s infinite;
}
.chat-msg.typing .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-msg.typing .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Quick action buttons */
.chat-quick {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px;
}
.chat-quick-btn {
  background: var(--bg-secondary, #252540); border: 1px solid var(--border-color, #333);
  color: var(--text-primary, #e0e0e0); border-radius: 20px;
  padding: 6px 12px; font-size: 12px; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.chat-quick-btn:hover {
  background: #22c55e; color: #fff; border-color: #22c55e;
}

.chat-input-wrap {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--border-color, #333);
}
.chat-input-wrap input {
  flex: 1; padding: 10px 14px; border-radius: 24px;
  border: 1px solid var(--border-color, #333);
  background: var(--bg-secondary, #252540);
  color: var(--text-primary, #e0e0e0);
  font-size: 13.5px; outline: none;
}
.chat-input-wrap input:focus { border-color: #22c55e; }
.chat-input-wrap input:disabled { opacity: 0.5; }
.chat-input-wrap button {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: #22c55e; color: #fff; font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.chat-input-wrap button:hover { background: #16a34a; }

/* Mobile */
@media (max-width: 480px) {
  #chat-panel { width: calc(100vw - 16px); right: 8px; bottom: 88px; height: calc(100vh - 100px); }
  #chat-bubble { bottom: 16px; right: 16px; }
}

/* Light theme support */
[data-theme="light"] .chat-msg.bot { background: #f3f4f6; color: #1f2937; }
[data-theme="light"] #chat-panel { background: #fff; border-color: #e5e7eb; }
[data-theme="light"] .chat-input-wrap { border-color: #e5e7eb; }
[data-theme="light"] .chat-input-wrap input { background: #f9fafb; color: #1f2937; border-color: #d1d5db; }
[data-theme="light"] .chat-quick-btn { background: #f3f4f6; border-color: #d1d5db; color: #374151; }
