/* Wedding seating chart — elegant, warm, mobile-first */

:root {
  --bg: #f7f3ee;
  --bg-card: #ffffff;
  --ink: #2c2620;
  --ink-soft: #6b5d50;
  --accent: #8a6f5c;
  --accent-dark: #5e4a3d;
  --border: #e8dfd3;
  --shadow: 0 8px 24px rgba(60, 40, 20, 0.08);
  --shadow-lg: 0 20px 60px rgba(60, 40, 20, 0.12);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---------- Rotate-to-portrait overlay (phones in landscape) ---------- */

.rotate-notice {
  display: none;
}

/* Only phones in landscape (short viewport) — never tablets or desktop */
@media (orientation: landscape) and (max-height: 500px) {
  .rotate-notice {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
  }
  .rotate-notice-inner {
    max-width: 320px;
  }
  .rotate-icon {
    display: block;
    font-size: 40px;
    color: var(--accent);
    margin-bottom: 10px;
  }
  .rotate-notice-inner p {
    margin: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    color: var(--ink);
    line-height: 1.3;
  }
}

/* ---------- Guest-facing page ---------- */

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(12px, 3vw, 28px) 24px 20px;
  min-height: 100vh;
  /* svh = stable small-viewport height (modern browsers). Then var(--app-height)
     overrides with a JS-locked pixel value that NEVER changes during scroll, so
     iOS Safari's collapsing toolbar can't resize the layout — no jitter, no
     growing whitespace. --app-height recalculates only on rotation. */
  min-height: 100svh;
  min-height: var(--app-height, 100svh);
  display: flex;
  flex-direction: column;
}

.demo-notice {
  align-self: center;
  margin: 0 0 8px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.hero {
  text-align: center;
  margin-bottom: clamp(10px, 2.5vw, 20px);
  transition: margin-bottom 0.35s ease;
}

.logo {
  height: clamp(120px, 22vh, 200px);
  width: auto;
  max-width: 100%;
  margin: 0 auto clamp(0px, 0.5vw, 6px);
  display: block;
  transition: height 0.35s ease, margin-bottom 0.35s ease;
}

.couple {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-weight: 500;
  font-size: clamp(32px, 7.5vw, 52px);
  margin: 0 0 2px;
  letter-spacing: 0.5px;
  color: var(--ink);
  line-height: 1.05;
  transition: font-size 0.35s ease;
}

.date {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.35s ease, margin 0.35s ease;
  max-height: 2em;
}

.search-section {
  margin-top: clamp(20px, 3.5vw, 38px);
  transition: margin-top 0.35s ease;
}

/* ----- Collapsed header once a result/picker is showing (makes room so the
   "Evening Ahead" prompt stays on-screen even with a tall card) ----- */
body.result-active .logo {
  height: clamp(52px, 10vh, 78px);
  margin-bottom: 2px;
}
body.result-active .couple {
  font-size: clamp(24px, 6vw, 34px);
}
body.result-active .date {
  opacity: 0;
  max-height: 0;
  margin: 0;
}
body.result-active .hero {
  margin-bottom: 8px;
}
body.result-active .search-section {
  margin-top: clamp(10px, 2vw, 18px);
}

.search-label {
  display: block;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: clamp(8px, 2vw, 14px);
}

.search-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 22px;
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--ink);
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.search-input::placeholder {
  color: #b0a496;
  font-weight: 400;
  font-style: italic;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px rgba(138, 111, 92, 0.10),
    inset 0 1px 2px rgba(60, 40, 20, 0.07),
    var(--shadow);
}

@keyframes search-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(138, 111, 92, 0), var(--shadow); }
  50%      { box-shadow: 0 0 0 6px rgba(138, 111, 92, 0.18), var(--shadow); }
}

.search-input.pulsing {
  animation: search-pulse 2.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .search-input.pulsing { animation: none; }
}

.results {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 24px 18px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: fadeUp 0.3s ease;
  position: relative;
}

.result-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 169, 97, 0.22);
  border-radius: 8px;
  pointer-events: none;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.matched-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}

.party-name {
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.table-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.3px;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

.table-row {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  line-height: 1;
}

.table-prefix {
  font-family: 'Great Vibes', 'Cormorant Garamond', cursive;
  font-size: 56px;
  font-weight: 400;
  line-height: 0.9;
  color: var(--ink);
}

.table-number {
  font-family: 'Great Vibes', 'Cormorant Garamond', cursive;
  font-size: 72px;
  font-weight: 400;
  line-height: 0.9;
  color: var(--ink);
}

.party-divider {
  height: 1px;
  width: min(220px, 75%);
  margin: 17px auto 16px;
  background: linear-gradient(to right, transparent, rgba(138, 111, 92, 0.6), transparent);
}

.party-list {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.party-list-label {
  display: block;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.party-name-chip {
  white-space: nowrap;
}

.picker {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.3s ease;
}

.picker-label {
  margin: 0 0 14px;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
}

.picker-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.picker-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}

.picker-columns > .picker-item {
  min-width: 0;
}

.picker-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  background: #faf6ef;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  -webkit-tap-highlight-color: transparent;
}

/* Single-column layout shows name and table side-by-side for a roomier feel */
.picker-stack .picker-item {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-size: 16px;
}

.picker-item:hover {
  background: #f3ede4;
  border-color: var(--accent);
}

.picker-item:active {
  transform: scale(0.99);
}

.picker-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.picker-table {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-dark);
  white-space: nowrap;
}

.picker-stack .picker-table {
  font-size: 18px;
}

.picker-hint {
  margin: 14px 0 4px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.no-results, .error {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
  box-shadow: var(--shadow);
}

.no-results p, .error {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Scroll prompt ("The Evening Ahead" peekaboo) ---------- */

.scroll-prompt {
  margin-top: auto;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 18px calc(8px + env(safe-area-inset-bottom));
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent-dark);
  -webkit-tap-highlight-color: transparent;
}

.scroll-prompt-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 19px;
  letter-spacing: 0.3px;
}

.scroll-chevron {
  font-family: 'Inter', sans-serif;
  font-size: 26px;
  line-height: 0.6;
  color: var(--accent);
  animation: chevron-bounce 1.6s ease-in-out infinite;
}

/* A stronger one-time "peekaboo" wiggle, toggled via JS after a table is found */
.scroll-prompt.peek {
  animation: prompt-peek 0.9s ease-in-out;
}

@keyframes chevron-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(7px); opacity: 1; }
}

@keyframes prompt-peek {
  0%, 100% { transform: translateY(0); }
  30%      { transform: translateY(10px); }
  60%      { transform: translateY(-2px); }
}

/* ---------- Evening schedule (revealed on scroll) ---------- */

.schedule {
  background: linear-gradient(to bottom, var(--bg), #f2ece2);
  border-top: 1px solid var(--border);
  padding: clamp(40px, 8vw, 72px) 24px calc(48px + env(safe-area-inset-bottom));
}

.schedule-inner {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.schedule-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(22px, 5.5vw, 28px);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 8px;
}

.schedule-date {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 32px;
}

.timeline {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  text-align: left;
}

.tl-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--border);
  /* fade-in-on-reveal: start hidden, JS adds .in to animate */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.tl-item.in {
  opacity: 1;
  transform: translateY(0);
}

.tl-item:last-child {
  border-bottom: 1px solid var(--border);
}

.tl-time {
  flex: 0 0 72px;
  text-align: right;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.tl-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tl-event {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.1;
}

.tl-note {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
}

.schedule-signature {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 16px;
  margin: 8px 0 0;
}

.demo-links, .admin-nav {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.demo-links a, .admin-nav a {
  color: var(--accent-dark);
  text-underline-offset: 3px;
}

.admin-demo-banner {
  margin: 0 0 18px;
  padding: 12px 15px;
  border: 1px solid #d8c89f;
  border-radius: 8px;
  background: #fff9e9;
  color: #66521f;
  font-size: 13px;
  line-height: 1.45;
}

.footer-ornament {
  color: var(--accent);
  font-size: 1.05em;
  opacity: 0.75;
  margin: 0 4px;
}

/* Easter-egg hint: the word "love" pulses bold once every ~5 seconds so
   curious eyes notice there's something interactive to discover. */
.love-pulse {
  display: inline-block;
  animation: love-pulse 5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes love-pulse {
  0%, 80%, 100% {
    transform: scale(1);
    font-weight: 400;
  }
  86%, 88% {
    transform: scale(1.22);
    font-weight: 700;
  }
  94% {
    transform: scale(1);
    font-weight: 400;
  }
}

@media (prefers-reduced-motion: reduce) {
  .love-pulse { animation: none; }
  .scroll-chevron { animation: none; }
  .scroll-prompt.peek { animation: none; }
  .tl-item { opacity: 1; transform: none; transition: none; }
}

/* ---------- Admin lock screen ---------- */

.lock-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.lock-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 28px 28px;
  box-shadow: 0 12px 40px rgba(60, 40, 20, 0.12);
  text-align: center;
  max-width: 360px;
  width: 100%;
}

.lock-card.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.lock-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 28px;
  margin: 0 0 6px;
  color: var(--ink);
}

.lock-subtitle {
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 24px;
}

.lock-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.lock-digit {
  width: 54px;
  height: 64px;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #faf6ef;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.lock-digit:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(138, 111, 92, 0.15);
}

.lock-error {
  font-size: 13px;
  color: #a04040;
  margin: 6px 0 0;
  min-height: 18px;
}

/* ---------- Admin page ---------- */

.admin-body {
  background: #fafafa;
}

.admin-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.admin-header {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.admin-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 32px;
  margin: 0 0 4px;
  color: var(--ink);
}

.admin-subtitle {
  margin: 0;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  background: #fff;
}

.btn-primary {
  background: var(--accent-dark);
  color: #fff;
}
.btn-primary:hover { background: #4a3b30; }

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--border);
}
.btn-secondary:hover { background: #f3ede4; }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}
.btn-ghost:hover { background: #f3ede4; color: var(--ink); }

.btn-danger {
  background: transparent;
  color: #a04040;
  border-color: transparent;
}
.btn-danger:hover { background: #fbeaea; }

.admin-note {
  background: #fdf6e9;
  border: 1px solid #e8dab4;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #6b5418;
  line-height: 1.5;
  margin: 0 0 20px;
}

.admin-note code {
  background: rgba(0,0,0,0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.admin-table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  padding: 12px 14px;
  background: #f7f3ee;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--border);
}

.admin-table th.th-count { width: 48px; text-align: right; padding-right: 12px; }
.admin-table th:nth-child(3) { width: 60px; }
.admin-table th:last-child { width: 44px; }

.admin-table td.row-count {
  width: 48px;
  text-align: right;
  padding-right: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.admin-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f0e8db;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 10px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  border-radius: 6px;
  color: var(--ink);
}

.admin-table input:hover {
  background: #faf6ef;
}

.admin-table input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(138, 111, 92, 0.12);
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-icon:hover {
  background: #fbeaea;
  color: #a04040;
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0;
}

.admin-status {
  margin-top: 16px;
  padding: 0 4px;
  font-size: 13px;
  min-height: 18px;
}

.admin-status.success { color: #2f7a3a; }
.admin-status.error { color: #a04040; }
.admin-status.info { color: var(--ink-soft); }

/* (Party / Family column removed — no longer need to hide it on small screens) */

/* Tight vertical screens — small phones in portrait, anything in landscape */
@media (max-height: 700px) {
  .container {
    padding-top: 8px;
  }
  .hero {
    margin-bottom: 6px;
  }
  .logo {
    height: clamp(90px, 18vh, 150px);
    margin-bottom: 0;
  }
  .couple {
    font-size: clamp(28px, 7vw, 40px);
  }
  .search-label {
    margin-bottom: 6px;
    font-size: clamp(20px, 5vw, 24px);
  }
  .search-input {
    padding: 14px 18px;
    font-size: 17px;
  }
  .scroll-prompt {
    padding-top: 10px;
  }
}

@media (max-height: 560px) {
  .logo {
    height: clamp(70px, 14vh, 110px);
  }
  .couple {
    font-size: 24px;
  }
  .date {
    font-size: 11px;
    letter-spacing: 2px;
  }
}
