/* moon-phase.css v1.1 */

/* Container & Form */
.moon-container {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1rem;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.moon-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.moon-form label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
}

.moon-form input,
.moon-form select {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
}

.btn-generate {
  align-self: center;
  padding: 0.5rem 1rem;
  background: #445f2c;
  color: #fff;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
}
.btn-generate:hover {
  background: #333c4e;
}

/* Loading state */
#loading-msg {
  margin-top: 1rem;
  font-style: italic;
  color: #666;
}
.hidden {
  display: none;
}

/* Image Container */
.image-container {
  width: 80vw;
  max-width: 80vw;
  margin: 1.5rem auto;
  padding: 1rem;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  text-align: center;
}

/* Image */
.moon-img {
  width: 100%;
  height: auto;
}

/* Legend container: full width */
.legend {
  width: 100%;
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

/* Responsive “columns” via CSS Grid */
.legend-list {
  display: grid;
  /* fit as many 150px-wide columns as will fit */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.legend-list li {
  align-items: center;
}

.legend .swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  border: 1px solid #333;
  box-sizing: border-box;
  vertical-align: middle;
  border-radius: 0.2rem;
  background: transparent;
}

.swatch.blue     { background: #0000FF; }
.swatch.cyan     { background: #00FFFF; }
.swatch.green    { background: #00FF00; }
.swatch.yellow   { background: #FFFF00; }
.swatch.orange   { background: #FFA500; }
.swatch.new-moon { background: #AD0D6A; }
.swatch.purple   { background: #800080; }
.swatch.gray     { background: #808080; }

.swatch.diamond {
  background: red;
  clip-path: polygon(
    50% 0%,   /* top point */
    100% 50%, /* right point */
    50% 100%, /* bottom point */
    0% 50%    /* left point */
  );
}
