/* === Global Styles === */
body {
  font-family: sans-serif;
  margin: 0;
  padding: 1rem;
  background: #faf8f4;
  color: #333;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

.disclaimer {
  font-size: 0.9rem;
  color: #666;
}

.intro {
  max-width: 600px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
  font-size: 1rem;
  color: #444;
  text-align: center;
}

/* === Section Layout === */
.info-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

/* === Utility Links === */
.jump-link, .subtle-link {
  font-size: 0.95rem;
  color: #0066cc;
  text-decoration: none;
}

.jump-link:hover, .subtle-link:hover {
  text-decoration: underline;
  color: #555;
}

/* navigation style */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.top-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: #333;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.top-nav a:hover {
  background: #eee;
}


/* === Poop Cards === */
.poop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  /* grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); */
  /* grid-template-columns: repeat(4, 1fr); */
  gap: 1.5rem;
}

.poop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.poop-title {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  text-align: center;
  color: #333;
}

.poop-label {
  font-size: 0.85rem;
  font-weight: bold;
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  text-align: center;
}

.poop-label.good {
  background: #d4edda;
  color: #155724;
}
.poop-label.caution {
  background: #fff3cd;
  color: #856404;
}
.poop-label.danger {
  background: #f8d7da;
  color: #721c24;
}

.poop-card img {
  width: 80%;
  max-width: 240px;
  height: auto;
  margin: 0.5rem 0;
}

.poop-card p {
  font-size: 0.9rem;
  color: #555;
  text-align: center;
}

/* === Suggestions === */
.poop-suggestion {
  font-size: 0.85rem;
  color: #444;
  margin-top: 0.75rem;
  background: #f4f4f4;
  padding: 0.5rem;
  border-radius: 6px;
}

.suggestion-label {
  display: block;
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 0.25rem;
}

.suggestion-toggle {
  background: none;
  border: none;
  font-size: 1rem;
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.suggestion-toggle:hover { opacity: 1; }

.suggestion-text {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  color: #444;
  background: #f8f8f8;
  padding: 0.5rem;
  border-radius: 6px;
}

.hidden { display: none; }

/* === Color Section Specific === */
#color-section .poop-card img {
  max-width: 160px;
  width: 60%;
}

/* === Picker Icons === */
.icon-picker {
  margin: 1rem 0;
  text-align: center;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  justify-items: center;
}

.picker-icon {
  width: 55px;
  height: auto;
  max-width: 100%;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
}

.picker-icon:hover,
.picker-icon.selected {
  opacity: 1;
  transform: scale(1.05);
  outline: 2px solid #0066cc;
  border-radius: 4px;
}


/* === Poop Log Form === */
#poop-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
  margin: 1rem auto;
}
#poop-form label {
  display: flex;
  flex-direction: column;
  font-weight: bold;
}
#poop-form textarea,
#poop-form select {
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid #ccc;
}
#poop-form button {
  align-self: flex-start;
  padding: 0.5rem 1rem;
  background: #e0e0e0;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

/* === Poop History === */
#poop-history {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 6px;
}

#poop-entries {
  list-style: none;
  padding: 0;
}

#poop-entries li {
  margin-bottom: 1rem;
  background: #fff;
  padding: 0.75rem;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* === Quiz Section === */
.quiz-question p {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.quiz-options {
  list-style: none;
  padding: 0;
}

.quiz-options li {
  margin-bottom: 0.5rem;
}

.quiz-option {
  width: 100%;
  padding: 0.5rem;
  border: none;
  background: #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}
.quiz-option:hover { background: #d0d0d0; }

.quiz-feedback {
  margin-top: 1rem;
  font-weight: bold;
  color: #444;
}

.quiz-result {
  text-align: center;
  font-size: 1.1rem;
}

#restart-quiz {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #dcdcdc;
  border: none;
  cursor: pointer;
}

#quiz-container {
  max-width: 600px;
  margin-top: 1rem;
}
.quiz-inner {
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

.quiz-intro {
  text-align: center;
  font-size: 1rem;
  margin: 0 auto 1rem;
  color: #555;
  max-width: 600px;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #666;
}

.quit-button {
  margin-top: 1rem;
  background: #f5f5f5;
  border: 1px solid #ccc;
  font-size: 0.9rem;
  padding: 0.4rem 1rem;
  cursor: pointer;
  border-radius: 4px;
}
.quit-button:hover { background: #eee; }

/* === Facts Section === */
#facts-container {
  margin: 1rem auto;
  padding: 1rem;
  background: #fff7d9;
  border-radius: 10px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.1);
  max-width: 600px;
  text-align: center;
}

#fact-text {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: #444;
  line-height: 1.4;
}

#new-fact {
  margin-top: 1rem;
  padding: 0.5rem 1.2rem;
  font-size: 1rem;
  background: #f8d44c;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s;
}
#new-fact:hover { background: #f1c40f; }

/* === Footer === */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  color: #666;
  background: #f0f0f0;
  margin-top: 3rem;
}
.site-footer p {
  margin: 0.5rem 0;
}
.footer-note {
  font-style: italic;
  max-width: 600px;
  margin: 0.5rem auto 0;
  color: #777;
}

/* === Share Buttons === */
.share-buttons {
  text-align: center;
  margin: 1rem 0;
}
.share-btn {
  margin: 0 0.5rem;
  padding: 0.2rem 0.4rem;
  background: #e0e0e0;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
}
.share-btn:hover { background: #d0d0d0; }

/* === Mobile-Specific Fixes === */
@media (max-width: 768px) {
  .poop-card {
    padding: 0.75rem;
  }

  .poop-title {
    font-size: 1rem;
  }

  .poop-card img {
    width: 100%;
  }

  .poop-card p {
    font-size: 0.85rem;
  }

  .poop-label {
    font-size: 0.8rem;
  }
}

/* poop heatmap */
#poop-heatmap {
  max-width: 600px;
  margin: 2rem auto;
  text-align: center;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  justify-items: center;
}

.heatmap-day {
  width: 24px;
  height: 24px;
  background: #e0e0e0;
  border-radius: 4px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  position: relative;
  cursor: pointer;
}

.heatmap-day[data-score="3"] { background: #c6f6d5; } /* green */
.heatmap-day[data-score="2"] { background: #fefcbf; } /* yellow */
.heatmap-day[data-score="1"] { background: #fed7d7; } /* red */

.heatmap-day:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: -1.5rem;
  background: #333;
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  z-index: 1;
}
