/* Taylor G Sale Post (sale_webapp/). Base rules COPIED from webapp/static/style.css so the two apps
   never share a stylesheet — editing one can't restyle the other. */

:root {
  --bg: #ffffff;
  --chat-bg: #f7f7f8;
  --user-bubble: #2563eb;
  --user-bubble-text: #ffffff;
  --assistant-bubble: #ffffff;
  --assistant-bubble-text: #111827;
  --border: #e5e7eb;
  --muted: #6b7280;
  --error: #b91c1c;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--assistant-bubble-text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.topbar h1 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logout-btn {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.login-body {
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.login-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 280px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.login-card h1 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
  text-align: center;
}

.login-card input[type="password"] {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
}

.login-card input[type="password"]:focus {
  border-color: var(--user-bubble);
}

.login-card button {
  border: none;
  border-radius: 10px;
  padding: 10px;
  background: var(--user-bubble);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.login-error {
  color: var(--error);
  font-size: 13px;
  text-align: center;
}

.new-item-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  color: var(--assistant-bubble-text);
}

.new-item-btn:hover {
  background: var(--chat-bg);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 8px;
}

.lightbox button {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.lightbox button:hover {
  background: rgba(255, 255, 255, 0.3);
}

a.new-item-btn {
  text-decoration: none;
}

.sale {
  flex: 1;
  overflow-y: auto;
  background: var(--chat-bg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sale-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.tag-btn {
  display: block;
  text-align: center;
  padding: 18px;
  border-radius: 12px;
  background: var(--user-bubble);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}

.sale-row {
  display: flex;
  gap: 8px;
}

.sale-row input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px; /* 16px stops iOS zooming into the field */
}

.small-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--assistant-bubble-text);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.primary-btn {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 12px;
  background: var(--user-bubble);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.primary-btn:disabled {
  opacity: 0.5;
}

.sale-status {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.sale-status.error {
  color: var(--error);
}

.sale-reason {
  font-weight: 600;
}

.choose-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 8px;
  text-align: left;
  cursor: pointer;
  color: var(--assistant-bubble-text);
}

.choice img,
.choice .noimg {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--chat-bg);
  flex-shrink: 0;
}

.choice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice-text small {
  color: var(--muted);
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-head h2 {
  font-size: 17px;
  margin: 0;
}

.listed-price {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--user-bubble);
}

.sale-warnings {
  background: #fef3c7;
  color: #92400e;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

#post-text {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  resize: vertical;
}

.char-count {
  margin-top: -6px;
  font-size: 13px;
  color: var(--muted);
}

.char-count.over {
  color: #b45309;
}

.sale-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.photo {
  position: relative;
}

.photo-dl {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 15px;
  line-height: 30px;
  text-align: center;
  text-decoration: none;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}

.stock summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
}

.stock ul {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 14px;
}

.stock li.out {
  color: var(--muted);
  text-decoration: line-through;
}

.next-btn {
  align-self: center;
}

/* display:flex above would otherwise beat the [hidden] attribute */
.sale-card[hidden],
.sale-status[hidden],
.sale-warnings[hidden] {
  display: none;
}
