/* ===================== Reset ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg, #fff);
  color: var(--text, #000);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: filter 0.3s ease;
  justify-content: center;
  align-items: center;
}

/* ===================== Header & Footer ===================== */
header, footer {
  background: #ddd;
  text-align: center;
  padding: 10px;
}

.header-content {
  display: flex;
  align-items: center;
  padding: 10px;
}

.site-title {
  font-size: 1.5rem;
  font-weight: bold;
}

.spacer {
  flex: 1;
}

/* Top Header */
.top-header {
  margin: 0 auto 20px auto;
  border-radius: 15px;
  background: linear-gradient(to right, #5afc03, #3fad03);
  text-align: center;
  width: 90%;
  padding: 15px;
}

.sub-header {
  opacity: 0;
  font-size: 14px;
  margin-top: 5px;
  transition: opacity 0.4s ease;
}

.top-header:hover .sub-header {
  opacity: 1;
}

/* Bottom Header */
.bottom-header {
  width: 100%;
  background: #000;
  color: aliceblue;
  text-align: center;
  padding: 2rem 1rem;
}

/* Sticky Header */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ddd;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ===================== Layout ===================== */
#content-wrapper {
  min-height: 100vh;
}

#content {
  padding: 20px;
  background-color: white;
}

/* MAIN FACTS BLOCK */
.main {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;

  /* Fill full screen width but keep smooth corners */
  width: calc(100% - 40px);
  margin: 0 auto;

  /* Rainbow border setup */
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.main::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 24px;
  background: linear-gradient(90deg, red, orange, yellow, green, blue, indigo, violet, red);
  background-size: 400% 400%;
  z-index: -1;
  filter: blur(8px);
  animation: rainbow-move 5s linear infinite;
}

.main::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: #f9f9f9;
  z-index: -1;
}

@keyframes rainbow-move {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===================== Buttons ===================== */
.fancy-button, .facts-selector, .like-button {
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Main Action Button */
.fancy-button {
  background-color: #4caf50;
  color: white;
  padding: 8px 16px;  /* smaller */
  font-size: 14px;    /* smaller */
  border-radius: 6px;
  box-shadow: 0 3px 5px rgba(0,0,0,0.1);
  min-width: auto;    /* allow smaller width */
}

.fancy-button:hover {
  background-color: #45a049;
  transform: translateY(-2px);
}

/* Facts Buttons */
.facts-selector {
  background: #e5e2e2;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.facts-selector:hover {
  background: #d1cccc;
  transform: scale(1.05);
}

/* Like Button */
.like-button {
  background: #e5e2e2;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.like-button:hover {
  background: #d1cccc;
  transform: scale(1.05);
}

/* ===================== Facts ===================== */
.facts-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: flex-start;
  text-align: center;
}

.fact {
  font-size: 1.4rem;
  max-width: 700px;
  margin: 0 auto;
}

.fact-explanation-container {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 10px;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#fact-explanation {
  font-size: 1.1em;
  line-height: 1.5;
  color: #333;
}

/* ===================== Saved Facts ===================== */
.saved-facts {
  background: #ffffff;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  max-width: 700px;
  margin: 30px auto;
  text-align: left;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.saved-facts h2 {
  text-align: center;
  font-size: 2em;
  color: #1a1a1a;
  margin-bottom: 20px;
  font-weight: 600;
}

.saved-facts ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.saved-facts li {
  background: #f0f8ff;
  padding: 20px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}

.saved-facts li:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.saved-facts li span {
  font-size: 1.1rem;
  font-weight: 500;
  color: #333;
}

.saved-facts li .buttons-container {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.saved-facts li button {
  background: #4caf50;
  border: none;
  color: white;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.saved-facts li button:hover {
  background: #45a049;
  transform: translateY(-2px);
}

/* Remove button style */
.saved-facts li button.remove-btn {
  background: #ff4b5c;
}

.saved-facts li button.remove-btn:hover {
  background: #f0182d;
}

/* ===================== Responsive ===================== */
@media (max-width: 768px) {
  .main {
    width: 100%;
    margin: 10px auto;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.4rem;
  }
  .facts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .fancy-button {
    width: 100%;
  }
  .fact {
    font-size: 1.1rem;
    padding: 0 10px;
  }
}

