/* Sloop Koala — Image Search. Green & white, sleek. */

:root {
  --forest:      #103527;
  --green:       #1f7a3d;
  --green-dark:  #17652f;
  --green-bright:#2d8a3e;
  --ink:         #1f2933;
  --muted:       #6b7280;
  --line:        #e6ece7;
  --surface:     #ffffff;
  --shadow-sm:   0 1px 2px rgba(16, 53, 39, 0.06);
  --shadow:      0 1px 2px rgba(16, 53, 39, 0.06), 0 12px 30px rgba(16, 53, 39, 0.07);
  --radius:      14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: #f4f8f5;
  min-height: 100vh;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* Hero band */
.hero {
  position: relative;
  background: linear-gradient(135deg, #0d2d21 0%, #134232 100%);
  color: #fff;
  text-align: center;
  padding: 30px 40px 40px;
}
.hero-back {
  position: absolute;
  top: 16px;
  right: 24px;
  z-index: 3;
  font-size: 14px;
  font-weight: 600;
  color: #d8ecdb;
  padding: 7px 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.hero-back:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.hero-inner { position: relative; z-index: 1; }
.hero-title {
  font-size: 27px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

/* Main */
.im-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 40px 70px;
}
.im-sub {
  color: var(--muted);
  font-size: 15.5px;
  margin: 0 0 22px;
  max-width: 820px;
}

/* Panel card wrapping the strip */
.im-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px 22px;
}

/* Legend */
.im-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 16px;
}
.im-legend-lead { font-weight: 600; color: var(--ink); }
.im-legend span:not(.im-legend-lead) { display: inline-flex; align-items: center; gap: 6px; }
.im-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-n { background: #d1594a; }
.dot-m { background: #d0a63a; }
.dot-y { background: var(--green); }

/* Film strip: one row, all tiles fit the panel */
.film-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  width: 100%;
}
.thumbnail {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  cursor: pointer;
}
.thumbnail img {
  width: 100%;
  height: 165px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #eef3ef;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.thumbnail:hover img {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: var(--shadow-sm);
}
.thumbnail p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 8px 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Words are hidden on tiles; the legend explains the three positions */
.thumbnail label { display: none; }
.thumbnail input[type="radio"] {
  margin: 0 3px;
  width: 15px;
  height: 15px;
  cursor: pointer;
  vertical-align: middle;
}
.thumbnail input[type="radio"][value="no"]    { accent-color: #d1594a; }
.thumbnail input[type="radio"][value="maybe"] { accent-color: #d0a63a; }
.thumbnail input[type="radio"][value="yes"]   { accent-color: var(--green); }

/* Query tile (first) accent */
.film-strip .thumbnail:first-child img { border: 2px solid var(--green); }
.film-strip .thumbnail:first-child p {
  color: var(--green);
  font-weight: 700;
}

/* Submit */
.button-container {
  display: flex;
  justify-content: center;
  margin: 24px 0 32px;
}
.button {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 12px 42px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, transform 0.1s;
}
.button:hover { background: var(--green-dark); }
.button:active { transform: translateY(1px); }
.button:disabled { background: #9fb0a4; cursor: default; box-shadow: none; }

/* Compare panes as cards */
#query-container {
  width: 100%;
  display: flex;
  gap: 24px;
  align-items: stretch;
}
.im-pane {
  flex: 1 1 0;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.im-pane-cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--green);
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.zoom-ctrl { display: inline-flex; gap: 5px; }
.zoom-ctrl button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green);
  border-radius: 6px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.zoom-ctrl button:hover { background: #eef5ef; border-color: var(--green); }
.full-image {
  width: 100%;
  height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #fbfdfb;
  overflow: hidden;
}
.full-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
.im-empty { color: var(--muted); font-size: 14px; }

.im-hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
  text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
  .film-strip { flex-wrap: wrap; }
  .thumbnail { flex: 0 0 calc(25% - 14px); }
}
@media (max-width: 640px) {
  #query-container { flex-direction: column; }
  .im-main { padding: 28px 16px 56px; }
  .hero { padding-left: 18px; padding-right: 18px; }
  .full-image { height: 320px; }
  .thumbnail { flex: 0 0 calc(33.33% - 14px); }
}
