/* Bright, playful styling. No external files needed. */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  background: linear-gradient(160deg, #fdf2f8 0%, #eef6ff 60%, #fef9e7 100%);
  background-attachment: fixed;
  color: #222;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 40px 16px 24px;
  background: linear-gradient(120deg, #ff6b6b, #ffa94d, #ffd43b, #51cf66, #339af0, #cc5de8);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
header h1 {
  margin: 0;
  font-size: 2.8rem;
  letter-spacing: 1px;
  text-shadow: 2px 3px 0 rgba(0, 0, 0, 0.18);
}
header p { margin: 8px 0 0; font-size: 1.1rem; }
header a {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 18px;
  background: #fff;
  color: #c2255c;
  border-radius: 999px;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}
header a:hover { transform: scale(1.05); }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }

/* Cards flow into as many columns as fit the screen */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}

.card {
  background: #fff;
  border: none;
  border-top: 6px solid #ff6b6b;
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:nth-child(4n+2) { border-top-color: #ffa94d; }
.card:nth-child(4n+3) { border-top-color: #51cf66; }
.card:nth-child(4n+4) { border-top-color: #339af0; }
.card:hover, .card:focus {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  transform: translateY(-4px) rotate(-0.5deg);
}
.card h3 { margin: 10px 0 4px; font-size: 1.15rem; color: #862e9c; }
.card p { margin: 3px 0; font-size: 0.95rem; }
.brand { color: #e8590c; font-weight: bold; }
.price {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #d3f9d8;
  color: #2b8a3e;
  font-weight: bold;
  font-size: 1.1rem;
}

/* Photo box (placeholder text shows when there is no image) */
.photo {
  height: 170px;
  background: linear-gradient(135deg, #ffe3e3, #d0ebff);
  color: #868e96;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: bold;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.big { height: 260px; }

/* Detail panel */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 20, 90, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.overlay[hidden] { display: none; }

.panel {
  position: relative;
  background: #fff;
  border-radius: 20px;
  border-top: 8px solid #cc5de8;
  padding: 22px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.panel h2 { margin: 14px 0 4px; color: #862e9c; }
.close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  border: none;
  background: #ff6b6b;
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0; }
dt { font-weight: bold; color: #e8590c; }
dd { margin: 0; }

/* Add-a-shoe form page */
.add-form {
  display: grid;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  padding: 22px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.add-form label { display: grid; gap: 4px; font-weight: bold; color: #862e9c; }
.add-form input, .add-form select, .add-form textarea {
  font: inherit;
  padding: 8px;
  border: 2px solid #d0bfff;
  border-radius: 8px;
}
.add-form button, #copy {
  font: inherit;
  font-weight: bold;
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, #ff6b6b, #cc5de8);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}
#result { max-width: 480px; margin: 20px auto; }
#output { width: 100%; font-family: Consolas, monospace; padding: 8px; border-radius: 8px; border: 2px solid #d0bfff; }
