html {
    box-sizing: border-box;
}
*, *::before, *::after {
    box-sizing: inherit;
}

body {
    font-family: 'Libertinus Math', serif;
    margin: 0;
    padding: 0;

    display: flex;
    justify-content: center;
    flex-direction: column;

    color: #fff;
}

/* this is a hack because background-attachment: fixed; doesn't work well on mobile */
#bg {
    background-image: radial-gradient(circle, transparent, #111), url("/static/wood.jpg");
    height: 100dvh;
    width: 100dvw;
    transform: scale(1.1);
    position: fixed;
    left: 0;
    top: 0;
    z-index: -1;
}

header {
    font-family: 'MonteCarlo', serif;

    display: flex;
    align-items: center;
    flex-direction: column;
}

header * {
    margin: 0;
}

header hr {
    width: 100%;
    margin-bottom: 1rem;
}

nav {
    margin-top: auto;

    display: flex;
    flex-wrap: wrap;

    width: 100%;
    z-index: 1;
}

nav a {
    text-decoration: none;
    color: inherit;
    flex: 1 1 100px;

    display: flex;
    justify-content: center;
    padding: 1rem;

    background-image: linear-gradient(to right, #00ffff, #00ffff);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 0.3s ease-out, color 0.7s linear, background-color 0.7s linear;
}

nav a:hover {
    color: #00ffff;
    background-size: 100% 2px;
    background-color: #00cccc11;
}

main {
    display: flex;
    flex-direction: column;
    align-self: center;
    width: 70%;
}

main a {
    color: #39c4c4;
}

main a:visited {
    color: #c476b4;
}

.search-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 8px;
    width: 100%;
    position: relative;
}

.search-input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 14px;
    background: transparent;
}

.reset-btn {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    border-radius: 4px;
    -webkit-tap-highlight-color: transparent; /* removes Android/iOS tap highlight */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none; /* iOS: prevents callout on long press */
    outline: none; /* remove default focus ring */
}

/* Keep an accessible focus ring for keyboard users */
.reset-btn:focus-visible {
  outline: 2px solid #4d90fe;
  outline-offset: 2px;
}

.reset-btn:hover { background: rgba(0,0,0,0.05); color: #222; }

/* Hide reset button visually when input is empty using :placeholder-shown */
.search-input:placeholder-shown + .reset-btn {
    visibility: hidden;
}

/* Accessible focus style */
.reset-btn:focus { outline: 2px solid #4d90fe; outline-offset: 2px; }

/* Hide Chrome/Safari built-in clear (and cancel) buttons */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

#loading {
    position: absolute;
    transform:translateX(-100%) translateX(-16px);
}


/* Seating-chart tables: card-style layout */
#results {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
  justify-content: center;
  padding: 18px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: #0f172a;
}

/* Individual table card */
#results table {
  width: 220px;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg,#ffffffbf 0%, #fbfdffbf 100%);
  box-shadow: 0 8px 28px rgba(2,6,23,0.06);
  cursor: default;
}

/* Table header — table name card */
#results table thead td {
  background: linear-gradient(180deg,#f1f5f9 0%, #eef2f7 100%);
  color: #0b1220;
  font-weight: 700;
  text-align: center;
  padding: 12px 14px;
  font-size: 15px;
  border-bottom: 1px solid rgba(2,6,23,0.06);
}

/* Body rows — guest names */
#results table tbody tr td {
  padding: 10px 14px;
  font-size: 14px;
  color: #082532;
  border-bottom: 1px solid rgba(2,6,23,0.04);
  background: transparent;
}

/* Alternating subtle row tint for readability */
#results table tbody tr:nth-child(odd) td {
  background: rgba(6,78,59,0.1);
}

/* Responsive: stack tables on small screens */
@media (max-width: 640px) {
  #results {
    gap: 12px;
    padding: 12px 0;
  }
  #results table {
    width: 100%;
    max-width: 420px;
  }
}
