/* BASIC RESET & LAYOUT */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: #fafaef; /* Eggshell background - subtle off-white */
  /* Use Roboto font from Google Fonts */
  font-family: 'Roboto', sans-serif;
  color: #333; /* Darker text for better contrast on light background */
  /* Egg emoji wallpaper */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='50' height='50'><text x='50%' y='50%' text-anchor='middle' dominant-baseline='middle' font-size='40'>🥚</text></svg>");
  background-repeat: repeat;
  background-size: 50px 50px;
}

header, footer {
  background-color: #fff; /* Keep header/footer white, or could be off-white too */
  text-align: center;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Subtler header/footer shadow */
}

main {
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;

  /* Enable flexbox layout on main container */
  display: flex;
  flex-direction: column; /* Stack dashboard boxes vertically */
  gap: 1.5rem; /* Uniform spacing between dashboard boxes */
}

/* Each .dashboard-box is a vertical card */
.dashboard-box {
  background-color: #fff; /* Keep cards white, or try off-white #fefefe for a softer look */
  border: 1px solid #e0e0e0; /* Softer, lighter gray border */
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.06); /* Subtler card shadow */
  padding: 0.75rem;
  /* margin-bottom: 2rem;  REMOVED - spacing now controlled by main's gap */
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

/* Optional hover effect if you like */
.dashboard-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.dashboard-box h2 {
  margin-bottom: 0.5rem;
}

/* Filter Buttons (FRED) */
.filter-buttons {
  margin-top: 0.8rem;
  text-align: center;
}
.filter-buttons button {
  background-color: #444; /* Slightly lighter gray for filter buttons */
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  margin: 0 0.3rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.filter-buttons button:hover {
  background-color: #666; /* Lighter hover color */
}

/* Chart */
#dataChart {
  height: 350px;
  max-width: 100%;
}

/* Retailer Buttons */
.retailer-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.8rem;
}
.retailer-button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: bold;
  text-decoration: none;
  color: #fff;
  border-radius: 4px;
  transition: background 0.2s ease;
  cursor: pointer;
}
.retailer-button.walmart {
  background: linear-gradient(45deg, #0071ce, #ffc72c);
}
.retailer-button.walmart:hover {
  background: linear-gradient(45deg, #005fa3, #e6b800);
}
.retailer-button.kroger {
  background-color: #0052cc;
}
.retailer-button.kroger:hover {
  background-color: #003399;
}
.retailer-button.target {
  background-color: #cc0000;
}
.retailer-button.target:hover {
  background-color: #a30000;
}

/* Interactive Cart */
.cart-container {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.cart-icon {
  position: relative;
  display: inline-block;
}
#cart-icon-image {
  width: 80px;
  height: auto;
}
#egg-count {
  position: absolute;
  top: -10px;
  right: -10px;
  background-color: #cc0000;
  color: #fff;
  font-weight: bold;
  border-radius: 50%;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  transform: scale(1);
  transition: transform 0.2s ease;
}
/* Add Egg + Ticker side by side */
.cart-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}
#add-egg-btn {
  background-color: #333;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
#add-egg-btn:hover {
  background-color: #555;
}
#remove-egg-btn {
  background-color: #ff6b6b;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 10px;
}
#remove-egg-btn:hover {
  background-color: #ff5252;
}
#money-ticker {
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  transition: transform 0.2s ease;
}

/* Flying Egg Emoji */
#flying-egg {
  position: absolute;
  font-size: 1.8rem;
  display: none;
  pointer-events: none;
  z-index: 9999;
}

/* Animations */
@keyframes bounceEgg {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.egg-bounce {
  animation: bounceEgg 0.4s ease;
}
@keyframes explodeEgg {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}
@keyframes bounceMoney {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.money-bounce {
  animation: bounceMoney 0.4s ease;
}
@keyframes disappearEgg {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}
.egg-disappear {
  animation: disappearEgg 0.4s ease;
}

/* Mobile Tweaks */
@media (max-width: 600px) {
  main {
    padding: 0.5rem;
  }
  #dataChart {
    height: 300px;
  }
}

.fred-citation {
  font-size: 0.85rem; /* slightly smaller text */
  color: #777;        /* subdued color - lighter than before */
  margin-top: 1rem;   /* space above the citation */
  text-align: left;   /* or center if you prefer */
}

.fred-citation a {
  color: #0071ce;     /* or any color you like */
  text-decoration: underline;
}

footer p {
    color: #777; /* Lighter footer text */
}

header h1 {
    font-weight: 700; /* Make header title bolder */
}

/* CSS for store prices (added in previous steps) */
.retailer-button-container {
  display: flex; /* Use flexbox to arrange button and price vertically */
  flex-direction: column;
  align-items: center; /* Center items horizontally within the container */
}

.store-price {
  font-size: 0.9rem; /* Slightly smaller font size for price */
  color: #555;      /* Muted color for price */
  margin-top: 0.3rem; /* Space between button and price */
}


.egg-fact-container {
  display: inline-block;
  position: relative;
  cursor: pointer;    /* Show a pointer when hovering */
  text-align: center; /* Center the emojis and text if you like */
  margin: 1rem 0;     /* Spacing above/below */
}

.egg-emoji,
.cracked-egg-emoji {
  font-size: 2rem;    /* Make the emoji larger */
  transition: transform 0.4s ease;
  display: inline-block;
}

/* Hidden elements won't be displayed at first */
.hidden {
  display: none;
}

/* A simple “crack” animation: slightly rotate and enlarge */
.egg-crack-animation {
  transform: scale(1.2) rotate(-20deg);
}

/* Style the fact text */
.egg-fact {
  margin-top: 0.5rem;
  font-size: 1rem;
  line-height: 1.4;
  color: #333;
  max-width: 300px;     /* Limit line length for readability */
  margin-left: auto;    /* Center the text if container is block-level */
  margin-right: auto;
}

/* Shake animation for the egg emoji on hover */
.egg-fact-container .egg-emoji {
  animation: occasionalShake 3s ease-in-out infinite;
}


@keyframes occasionalShake {
  0% { transform: translateX(0); }
  5% { transform: translateX(-10px); }  /* increased from -3px */
  10% { transform: translateX(10px); }   /* increased from 3px */
  15% { transform: translateX(0); }
  100% { transform: translateX(0); }
}

.hen-buttons {
  text-align: center;
  margin-bottom: 1rem;
}

.hen-visualization {
  display: flex;
  flex-wrap: wrap;   /* let emojis wrap to multiple rows */
  gap: 0.25rem;
  max-width: 300px;  /* or adjust as you like */
  margin: 0 auto;    /* center the grid */
}

.hen-visualization span {
  font-size: 1.5rem; /* size of the emojis */
  transition: transform 0.3s ease;
}

/* Hover effect: slight scale-up */
.hen-visualization span:hover {
  transform: scale(1.2);
}

/* Colors for each category */
.top10 {
  color: gold;
}
.top20 {
  color: cornflowerblue;
}
.other {
  color: #ccc;
}

/* Legend styling */
.hen-legend {
  text-align: center;
  margin-bottom: 1rem;
}
.hen-legend-item {
  margin: 0 1rem;
  font-weight: bold;
  font-size: 1rem;
}
.top10-color {
  color: gold;
}
.top20-color {
  color: cornflowerblue;
}
.other-color {
  color: #ccc;
}

.other {
  filter: grayscale(100%);
}
.top10, .top20 {
  filter: none; /* Remove grayscale for colored categories */
}

