/* Local Insider — styles for JS-generated content + structural layout */

:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #111827;
  --accent-hover: #374151;
  --border: #e5e7eb;
  --shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
  --radius: 18px;
  --radius-sm: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  height: 100%;
  overflow: hidden;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── App shell ──────────────────────────────────────────────── */

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
}

@media (min-width: 481px) {
  body { padding: 1rem 0; overflow: auto; }
  .app { height: calc(100dvh - 2rem); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
}

/* ── Chat scroll area ───────────────────────────────────────── */

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1rem 0.5rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.chat::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  background-image: url("/seoul-skyline.png");
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: 100% auto;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

/* welcome container — just spacing; visual styles live in Tailwind (index.html) */
.welcome { padding: 0.25rem 0 1rem; animation: fadeIn 0.4s ease; }

/* ── Chat bubbles ───────────────────────────────────────────── */

.message { display: flex; margin-bottom: 0.75rem; animation: slideUp 0.3s ease; }
.message--user { justify-content: flex-end; }
.message--bot  { justify-content: flex-start; }

.message__bubble {
  max-width: 88%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  word-wrap: break-word;
}

.message--user .message__bubble {
  background: var(--text);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message--bot .message__bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.message__image  { display: block; max-width: 200px; border-radius: var(--radius-sm); margin-bottom: 0.5rem; }
.message__label  { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.375rem; }
.message__dish   { margin-top: 0.5rem; padding: 0.5rem 0.75rem; background: var(--bg); border-radius: var(--radius-sm); font-size: 0.875rem; }

/* ── Typing indicator ───────────────────────────────────────── */

.typing {
  display: flex;
  gap: 4px;
  padding: 0.875rem 1.125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-bottom-left-radius: 4px;
}

.typing span {
  width: 7px; height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.30s; }

/* ── Composer ───────────────────────────────────────────────── */

.composer {
  flex-shrink: 0;
  padding: 0.75rem 1rem calc(0.75rem + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.hidden { display: none !important; }

.attach-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
  padding: 0.5rem 0.625rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.attach-preview__thumb {
  width: 48px; height: 48px;
  object-fit: cover; border-radius: 8px; flex-shrink: 0;
}

.attach-preview__info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 0.125rem;
}

.attach-preview__label { font-size: 0.8125rem; font-weight: 600; }
.attach-preview__hint  { font-size: 0.75rem; color: var(--text-muted); }

.attach-preview__remove {
  flex-shrink: 0; width: 32px; height: 32px;
  border: none; border-radius: 50%; background: transparent;
  color: var(--text-muted); font-size: 1.375rem; line-height: 1; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.attach-preview__remove:hover,
.attach-preview__remove:focus-visible {
  background: #fee2e2; color: #ef4444; outline: none;
}

.composer__form {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 0.375rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.composer__form:focus-within {
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.2);
}

.composer__attach,
.composer__send {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: none; border-radius: 50%; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.composer__attach {
  background: transparent; color: var(--text-muted);
}
.composer__attach:hover,
.composer__attach:focus-visible {
  background: #f3f4f6; color: var(--text); outline: none;
}

.composer__send {
  background: var(--text); color: #fff;
}
.composer__send:hover:not(:disabled),
.composer__send:focus-visible:not(:disabled) {
  background: var(--accent-hover); outline: none;
}
.composer__send:disabled { opacity: 0.3; cursor: not-allowed; }

.composer__input {
  flex: 1;
  min-height: 40px; max-height: 120px;
  padding: 0.5rem 0.25rem;
  font-family: var(--font);
  font-size: 1rem; line-height: 1.4;
  color: var(--text); background: transparent;
  border: none; resize: none; outline: none;
}
.composer__input::placeholder { color: #9ca3af; }

/* ── Photo sheet ────────────────────────────────────────────── */

.photo-sheet {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.photo-sheet[hidden] { display: none; }

.photo-sheet__backdrop {
  position: absolute; inset: 0;
  border: none; background: rgba(0, 0, 0, 0.4); cursor: pointer;
}

.photo-sheet__panel {
  position: relative;
  width: 100%; max-width: 480px;
  padding: 1rem 1rem calc(1rem + var(--safe-bottom));
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
  animation: sheetUp 0.25s ease;
}

.photo-sheet__option {
  display: flex; align-items: center; gap: 0.75rem;
  width: 100%; padding: 0.875rem 1rem; margin-bottom: 0.5rem;
  font-family: var(--font); font-size: 1rem; font-weight: 500;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.photo-sheet__option:hover,
.photo-sheet__option:focus-visible {
  border-color: #9ca3af; background: #f9fafb; outline: none;
}
.photo-sheet__icon { font-size: 1.25rem; }

.photo-sheet__cancel {
  display: block; width: 100%; padding: 0.75rem;
  font-family: var(--font); font-size: 0.9375rem; font-weight: 500;
  color: var(--text-muted); background: transparent; border: none; cursor: pointer;
  transition: color 0.15s;
}
.photo-sheet__cancel:hover,
.photo-sheet__cancel:focus-visible { color: var(--text); outline: none; }

/* ── Animations ─────────────────────────────────────────────── */

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce  { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-5px); opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── Chat intro line ────────────────────────────────────────── */

.chat-intro {
  font-size: 0.9375rem;
  line-height: 1.55;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

/* ── Place cards (JS-generated) ─────────────────────────────── */

.place-card {
  margin-top: 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.place-card__photo {
  width: 100%;
  height: 200px;
  background: #f3f4f6;
  overflow: hidden;
  position: relative;
}
.place-card__photo img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.place-card__photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  background: #f3f4f6;
}

.place-card__body { padding: 1rem 1rem 1.125rem; }

.place-card__name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
  line-height: 1.4;
}
.place-card__name-ko { color: var(--text); }
.place-card__name-sep { color: var(--text-muted); font-weight: 400; margin: 0 0.15em; }
.place-card__name-en { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }

.place-card__address-row {
  display: flex; align-items: center;
  gap: 0.375rem; margin-bottom: 0.625rem;
}
.place-card__area {
  flex: 1; font-size: 0.8125rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.place-card__copy-btn {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  font-size: 0.8125rem; line-height: 1;
  background: transparent; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; color: var(--text-muted);
  transition: background 0.15s, border-color 0.15s;
}
.place-card__copy-btn:hover,
.place-card__copy-btn:focus-visible {
  background: var(--bg); border-color: #9ca3af; outline: none;
}

.place-card__note {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 0.875rem;
}

.place-card__orders {
  display: flex; flex-wrap: wrap; gap: 0.375rem;
  margin-bottom: 0.875rem;
}
.place-card__orders span {
  font-size: 0.75rem; font-weight: 500;
  padding: 0.25rem 0.625rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text);
}

.place-card__map-row {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.place-card__map-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
  flex: 1;
  font-size: 0.8125rem; font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  color: var(--text);
  background: var(--bg);
  transition: background 0.15s, border-color 0.15s;
}
.place-card__map-btn:hover,
.place-card__map-btn:focus-visible {
  background: #f3f4f6; border-color: #9ca3af; outline: none;
}
.place-card__map-btn--kakao {
  border-color: #FAE100;
  background: #FAE100;
  color: #1a1a1a;
}
.place-card__map-btn--kakao:hover,
.place-card__map-btn--kakao:focus-visible {
  background: #f0d800; border-color: #f0d800; color: #1a1a1a;
}

/* ── Copy toast ─────────────────────────────────────────────── */

.copy-toast {
  position: fixed;
  bottom: calc(5rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  padding: 0.5rem 1.125rem;
  background: var(--text);
  color: #fff;
  font-size: 0.875rem; font-weight: 500;
  border-radius: 99px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}
.copy-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Menu translation cards ─────────────────────────────────── */

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.menu-item {
  padding: 14px 16px;
  background: #f7f7f5;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.menu-item-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.menu-name-en {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.3px;
}

.menu-name-ko {
  font-size: 13px;
  color: #888;
  font-weight: 400;
}

.menu-desc {
  font-size: 13.5px;
  color: #444;
  line-height: 1.6;
  letter-spacing: -0.1px;
}

.menu-price {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  margin-top: 2px;
}

.menu-portion {
  font-size: 13px;
  color: #555;
  background: #eee;
  border-radius: 8px;
  padding: 4px 10px;
  display: inline-block;
  margin-top: 2px;
}

.menu-refill {
  margin-top: 12px;
  padding: 12px 16px;
  background: #e8f5e9;
  border-radius: 12px;
  font-size: 13.5px;
  color: #2e7d32;
  font-weight: 500;
}

.menu-tip {
  margin-top: 8px;
  padding: 12px 16px;
  background: #fff8e1;
  border-radius: 12px;
  font-size: 13.5px;
  color: #795548;
  font-weight: 500;
}
