/* Portfolio chat widget — complements Miniport theme */
/* Ensure chat widget styles override main theme */

.portfolio-chat,
.portfolio-chat *,
.portfolio-chat *::before,
.portfolio-chat *::after {
  box-sizing: border-box;
}

.portfolio-chat {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 99999;
  font-family: 'Open Sans', sans-serif;
  color: #e0e0e0 !important;
}

.portfolio-chat-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  background: #252122;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 0.95rem;
  font-weight: 600;
}

.portfolio-chat-toggle:hover {
  background: #3a3334;
}

.portfolio-chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(22rem, calc(100vw - 2rem));
  height: 28rem;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.portfolio-chat-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  background: #252122;
  color: #fff;
}

.portfolio-chat-header p {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  opacity: 0.85;
  line-height: 1.4;
}

.portfolio-chat-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portfolio-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #2d2d2d;
}

.portfolio-chat-message {
  max-width: 90%;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.85rem;
  line-height: 1.45;
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e0e0e0 !important;
}

.portfolio-chat-message-user {
  margin-left: auto;
  background: #3a3334;
  color: #fff !important;
}

.portfolio-chat-message-assistant {
  background: #3d3d3d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e0e0e0 !important;
}

.portfolio-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.75rem;
  background: #2d2d2d;
  justify-content: flex-start;
}

.portfolio-chat-suggestion {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #3d3d3d;
  color: #e0e0e0 !important;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: normal;
  cursor: pointer;
}

.portfolio-chat-suggestion:hover {
  background: #4d4d4d;
}

.portfolio-chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  background: #1a1a1a;
}

.portfolio-chat-input {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: #000000;
  background: #2d2d2d;
}

.portfolio-chat-send {
  border: 0;
  border-radius: 0.65rem;
  padding: 0.65rem 0.9rem;
  background: #3a3334;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  width: auto;
  min-width: fit-content;
  max-width: 4rem;
}

.portfolio-chat-send:disabled,
.portfolio-chat-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .portfolio-chat-toggle-label {
    display: none;
  }

  .portfolio-chat-panel {
    width: calc(100vw - 2rem);
    height: 70vh;
  }

  .portfolio-chat-send {
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    max-width: 3.5rem;
  }

  .portfolio-chat-close {
    font-size: 1.3rem;
    width: 1.8rem;
    height: 1.8rem;
  }
}
