.message-text {
  /* Prevent layout shifts */
  min-height: 20px;

  /* Ensure proper text wrapping */
  white-space: pre-wrap;
  word-break: break-word;

  /* Consistent line height */
  line-height: 1.6;
}

/* Compact markdown styling for AI messages */
.markdown-text {
  line-height: 1.4;
}

/* Reset all paragraph margins - this is key for tight lists */
.markdown-text p {
  margin: 0 0 6px 0 !important;
}

.markdown-text p:last-child {
  margin-bottom: 0 !important;
}

/* All lists - ZERO spacing */
.markdown-text ul,
.markdown-text ol {
  margin: 0 !important;
  margin-block: 0 !important;
  padding-left: 20px !important;
  list-style-position: outside !important;
}

/* List items - ZERO spacing */
.markdown-text li {
  margin: 0 !important;
  margin-block: 0 !important;
  padding: 0 !important;
  display: list-item !important;
  line-height: 1.3 !important;
}

.markdown-text li:last-child {
  margin-bottom: 0 !important;
}

/* CRITICAL: Remove gap between ol (numbered heading) and ul (bullet points) */
.markdown-text ol + ul {
  margin-top: -2em !important;
  padding-top: 0 !important;
}

/* Numbered list that follows a bullet list - pull up to reduce gap after commentary text */
.markdown-text ul + ol {
  margin-top: -1.5em !important;
}

/* List items that contain nested lists - reduce spacing after the nested list */
.markdown-text li:has(> ul),
.markdown-text li:has(> ol) {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* List items that follow a list item with nested content - pull up to reduce gap */
.markdown-text li:has(> ul) + li,
.markdown-text li:has(> ol) + li {
  margin-top: -16px !important;
}

/* CRITICAL: Paragraphs inside list items must be inline with no margins */
.markdown-text li > p,
.markdown-text li p {
  margin: 0 !important;
  padding: 0 !important;
  display: inline !important;
}

/* When a paragraph follows a list item paragraph, add minimal space */
.markdown-text li > p + p {
  display: block !important;
  margin-top: 2px !important;
}

/* Nested lists - no bottom margin to prevent space before next sibling li */
.markdown-text ul ul,
.markdown-text ol ol,
.markdown-text ul ol,
.markdown-text ol ul {
  margin: 0 !important;
}

/* Consecutive lists at the same level - remove spacing between them */
.markdown-text ul + ul,
.markdown-text ol + ol,
.markdown-text ul + ol,
.markdown-text ol + ul {
  margin-top: 0 !important;
}

/* List items after nested lists should not have extra top spacing */
.markdown-text li > ul + li,
.markdown-text li > ol + li {
  margin-top: 0 !important;
}

/* Bold text styling */
.markdown-text strong {
  font-weight: 600;
}

/* Headers in markdown */
.markdown-text h1,
.markdown-text h2,
.markdown-text h3 {
  margin-top: 16px !important;
  margin-bottom: 8px !important;
}

.markdown-text h1:first-child,
.markdown-text h2:first-child,
.markdown-text h3:first-child {
  margin-top: 0 !important;
}

/* Define the fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Styling for clickable questions */
.clickable-question {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  padding: 8px 12px;
  margin: 2px 0;
  border-radius: 4px;
  position: relative;
  background-color: rgba(0, 103, 255, 0.25);
  border: 1px solid rgba(0, 103, 255, 0.35);
  transition: all 0.15s ease;
  font-weight: normal;
  font-size: 0.95em;
  width: 100%;
  line-height: 1.4;
  white-space: normal;
  word-break: normal;
  box-sizing: border-box;
  text-align: left;
  opacity: 1;
}

/* Removed animation delays for clickable questions */

.clickable-question:hover {
  background-color: rgba(0, 103, 255, 0.3);
  border-color: rgba(0, 103, 255, 0.5);
  color: #FFFFFF;
}

.clickable-question:active {
  background-color: rgba(0, 103, 255, 0.4);
}

.clickable-question:not(.numbered-item)::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FFFFFF'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
  opacity: 0.8;
}

/* Add a container for multiple buttons to display them in a column */
.clickable-questions-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 6px 0;
  max-width: 100%;
  width: 100%;
  opacity: 1;
}

/* Styling for the links loading container */
.links-loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 16px 0;
  width: 100%;
  animation: fadeIn 0.3s ease-out forwards;
}

/* Styling for the loading indicator */
.links-loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 300px;
}

.loading-spinner-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background-color: rgba(0, 103, 255, 0.15);
  border-radius: 8px;
  border: 1px solid rgba(0, 103, 255, 0.25);
  width: 100%;
}

/* Styling for the loading text */
.loading-text {
  margin-left: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  white-space: nowrap;
}

/* Styling for the loading spinner */
.loading-spinner {
  animation: rotate 2s linear infinite;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.loading-spinner .path {
  stroke: rgba(0, 103, 255, 0.8);
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }

  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }

  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

/* Special styling for numbered list items */
.numbered-item::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FFFFFF'%3E%3Cpath d='M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zM15 5h-2v4h-4v2h4v4h2v-4h4V9h-4z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
  opacity: 0.8;
}

/* Placeholder for list items to maintain spacing */
.list-item-placeholder {
  height: 4px;
  width: 100%;
}

/* Hide the questions-after-graph element initially */
.questions-after-graph {
  display: none;
}

/* When questions are shown after a graph, apply the same styling */
.graph-questions-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 6px 0;
  max-width: 100%;
  width: 100%;
  opacity: 1;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Satoshi Variable', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  background-color: var(--neutral-graphite);
  color: var(--white);
}

#root {
  height: 100vh;
  background-color: var(--neutral-graphite);
}

/* Typography styles based on the style guide */
h1 {
  font-family: 'Satoshi Variable', sans-serif;
  font-weight: 700;
  font-size: 40px;
  line-height: 48px;
  letter-spacing: 0%;
}

h2 {
  font-family: 'Satoshi Variable', sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: 0%;
}

h3 {
  font-family: 'Satoshi Variable', sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: 0%;
}

h4 {
  font-family: 'Satoshi Variable', sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: 0%;
}

h5 {
  font-family: 'Satoshi Variable', sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 26px;
  letter-spacing: 0%;
}

h6 {
  font-family: 'Satoshi Variable', sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0%;
}

/* Body text styles */
.body-large {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0%;
}

.body-medium {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 22px;
  letter-spacing: 0%;
}

.caption {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0%;
}

/* Button styles */
.button-large {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: 2%;
  text-transform: uppercase;
}

.button-small {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 18px;
  letter-spacing: 4%;
  text-transform: uppercase;
}

/* Custom scrollbar styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #00D2FF #070707;
}

/* For Chrome, Edge, and Safari */
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: #070707;
}

*::-webkit-scrollbar-thumb {
  background-color: #00D2FF;
  border-radius: 4px;
  border: 2px solid #070707;
}

/* Ensure message container scrolls properly */
.message-container {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: 100% !important;
  max-height: calc(100vh - 130px) !important;
}

/* Color variables for use in CSS */
:root {
  /* Primary colors */
  --primary-electric: #00D2FF;
  --primary-deep: #0A1929;
  --primary-bright: #2C75FF;
  --primary-glow: #00D2FF;

  /* Secondary colors */
  --secondary-green: #24F8DC;
  --secondary-orange: #FF4324;
  --secondary-light: #1E2A38;

  /* Neutral colors */
  --neutral-graphite: #070707;
  --neutral-light: #8B9CAF;

  /* White and Black */
  --white: #FFFFFF;
  --black: #000000;
}
