/* Стили кросс-проектного портфельного AI-чата инвестора (Dark Glassmorphism) */
.portfolio-ai-section {
  background: rgba(16, 22, 36, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.portfolio-ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.portfolio-ai-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.portfolio-ai-badge-icon {
  font-size: 26px;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  padding: 6px 10px;
}
.portfolio-ai-heading { font-size: 18px; font-weight: 700; color: #fff; margin: 0 0 2px 0; }
.portfolio-ai-subheading { font-size: 13px; color: #94a3b8; margin: 0; }
.portfolio-ai-actions { display: flex; align-items: center; gap: 10px; }
.portfolio-projects-badge {
  font-size: 12px; color: #cbd5e1; background: rgba(255, 255, 255, 0.06);
  padding: 5px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-clear-chat {
  background: transparent; border: 1px solid rgba(239, 68, 68, 0.3); color: #f87171;
  font-size: 12px; padding: 5px 12px; border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.btn-clear-chat:hover { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }

.quick-prompts-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.quick-prompt-btn {
  background: rgba(99, 102, 241, 0.12); border: 1px solid rgba(99, 102, 241, 0.28);
  color: #cbd5e1; font-size: 12px; padding: 6px 12px; border-radius: 16px; cursor: pointer; transition: all 0.2s;
}
.quick-prompt-btn:hover { background: rgba(99, 102, 241, 0.26); color: #fff; border-color: rgba(99, 102, 241, 0.6); }

.portfolio-chat-messages {
  max-height: 420px; overflow-y: auto; padding: 14px 16px; background: rgba(10, 14, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 12px; margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.portfolio-chat-empty-state { text-align: center; padding: 32px 16px; }

.portfolio-msg { display: flex; gap: 10px; animation: pfadeIn 0.25s ease-out; }
@keyframes pfadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.portfolio-msg-user { justify-content: flex-end; }
.portfolio-msg-user .msg-bubble {
  background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff;
  border-radius: 14px 14px 2px 14px; max-width: 82%; padding: 10px 14px; font-size: 13.5px;
}

.portfolio-msg-assistant { justify-content: flex-start; }
.portfolio-msg-assistant .msg-bubble {
  background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.09);
  color: #e2e8f0; border-radius: 14px 14px 14px 2px; max-width: 92%; padding: 14px 16px;
  font-size: 13.5px; line-height: 1.6;
}
.msg-bubble h3 { margin: 0 0 10px 0; font-size: 15px; color: #60a5fa; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 4px; }
.msg-bubble table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12.5px; }
.msg-bubble th, .msg-bubble td { padding: 6px 10px; border: 1px solid rgba(255, 255, 255, 0.1); text-align: left; }
.msg-bubble th { background: rgba(99, 102, 241, 0.18); color: #cbd5e1; }
.msg-bubble tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }
.msg-bubble ul, .msg-bubble ol { margin: 6px 0 8px 18px; padding: 0; }
.msg-bubble li { margin-bottom: 4px; }
.msg-bubble strong { color: #f1f5f9; }

.msg-meta-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px; color: #64748b;
}
.covered-tags-wrapper { display: flex; gap: 4px; flex-wrap: wrap; }
.covered-tag {
  display: inline-block; font-size: 10.5px; background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc; padding: 2px 7px; border-radius: 6px; border: 1px solid rgba(99, 102, 241, 0.25);
}

.portfolio-chat-input-bar { display: flex; gap: 10px; }
.portfolio-chat-input {
  flex: 1; background: rgba(15, 23, 42, 0.7); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px; padding: 10px 14px; color: #fff; font-size: 13.5px; outline: none; transition: border-color 0.2s;
}
.portfolio-chat-input:focus { border-color: #6366f1; }
.portfolio-chat-submit-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6); border: none; border-radius: 10px;
  color: #fff; font-weight: 600; font-size: 13px; padding: 10px 18px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: opacity 0.2s;
}
.portfolio-chat-submit-btn:hover:not(:disabled) { opacity: 0.92; }
.portfolio-chat-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.typing-indicator { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; }
.typing-dot {
  width: 6px; height: 6px; background: #a5b4fc; border-radius: 50%; animation: pulseDot 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulseDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Мобильная адаптивность */
@media (max-width: 640px) {
  .portfolio-ai-section {
    padding: 16px 14px;
    border-radius: 12px;
  }
  .portfolio-ai-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .portfolio-ai-actions {
    width: 100%;
    justify-content: space-between;
  }
  .portfolio-msg-user .msg-bubble,
  .portfolio-msg-assistant .msg-bubble {
    max-width: 96%;
    font-size: 13px;
  }
  .msg-bubble table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .portfolio-chat-input-bar {
    flex-direction: column;
  }
  .portfolio-chat-submit-btn {
    width: 100%;
    justify-content: center;
  }
}

