/* === Wrapper for Icon and Bubble === */
.fast-facts-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  padding: 20px 10px;
  width: 100%;
  box-sizing: border-box;
}

/* === Column for Image + Button === */
.fact-icon-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 22px; /* aligns nicely under the bubble tip */
}

/* === Idea Image === */
.fact-icon-column img {
  height: 60px; /* controls size of idea.gif */
  width: auto;
  transform: scaleX(1); /* point right by default */
}

.fact-icon-column img.animate {
  animation: wiggle 0.6s ease-in-out;
}

/* === Reload Button Below Image === */
.fast-fact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 0.9rem;
  background-color: transparent;
  color: #1e90ff;
  border: 1px solid #1e90ff;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: none;
  padding: 0;
}

.fast-fact-button:hover,
.fast-fact-button:focus {
  background-color: #1e90ff;
  color: #fff;
  outline: none;
}

/* === Spinning Icon Animation === */
.fast-fact-button.spin i {
  animation: spinIcon 0.8s linear;
}

@keyframes wiggle {
  0%   { transform: scaleX(1); }
  40%  { transform: scaleX(-1); }
  60%  { transform: scaleX(-1); }
  100% { transform: scaleX(1); }
}

/* === Speech Bubble === */
#fast-fact.speech-bubble {
  position: relative;
  background: #f5f5f5;
  border: 2px solid #ccc;
  border-radius: 12px;
  padding: 16px 16px 16px 42px; /* space for icon on the left */
  font-family: 'Georgia', serif;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.5;
  color: #333;
  max-width: 600px;
  text-align: left;
  flex: 1;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
  word-wrap: break-word;
}

/* Reload button inside bubble */
#fast-fact .fast-fact-button {
  position: absolute;
  top: 10px;
  left: -13px;
  width: 26px;
  height: 26px;
  font-size: 0.9rem;
  background-color: #f5f5f5;
  color: #1e90ff;
  border: 1px solid #1e90ff;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

#fast-fact .fast-fact-button:hover {
  background-color: #1e90ff;
  color: white;
}

/* Bubble arrow (unchanged) */
#fast-fact.speech-bubble::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 15px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-right: 20px solid #f5f5f5;
  border-bottom: 10px solid transparent;
}

#fast-fact.speech-bubble::after {
  content: '';
  position: absolute;
  left: -22px;
  top: 14px;
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-right: 22px solid #ccc;
  border-bottom: 11px solid transparent;
  z-index: -1;
}

/* === Fact Text Fade-in Animation === */
.fade-in-fact {
  opacity: 0;
  animation: fadeIn 1s ease-in-out forwards;
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* === Spacing for fact text === */
#fact-text {
  margin-bottom: 0;
}

/* === Mobile Responsive Layout === */
@media (max-width: 600px) {
  .fast-facts-wrapper {
    flex-direction: row;
    align-items: flex-start;
    padding: 10px;
  }

  .fact-icon-column img {
    height: 28px;
  }

  #fast-fact.speech-bubble {
    max-width: calc(100% - 50px);
    font-size: 1rem;
  }

  #fast-fact.speech-bubble::before {
    left: -20px;
    top: 15px;
    border-right: 20px solid #f5f5f5;
    transform: none;
  }

  #fast-fact.speech-bubble::after {
    left: -22px;
    top: 14px;
    border-right: 22px solid #ccc;
    transform: none;
  }

  .fast-fact-button {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }
}
