/* ===== RESET & ROOT ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #D4AF37;
  --gold-light: #F9F1D8;
  --gold-dark: #997A00;
  --cream: #0A0A0A;
  --cream-dark: #2A2A2A;
  --navy: #000000;
  --navy-mid: #111111;
  --text-dark: #F5F5F5;
  --text-mid: #B0B0B0;
  --text-light: #888888;
  --white: #141414;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.6);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.8);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-height: 72px;
}

html, body {
  height: 100%;
  background: var(--cream);
  color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ===== APP SHELL ===== */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--cream);
  position: relative;
  overflow: hidden;
}

/* ===== HEADER ===== */
.app-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 28px 24px 20px;
  text-align: center;
  position: relative;
  flex-shrink: 0;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.header-ornament {
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--gold-light);
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.8;
}

.header-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}

.header-subtitle {
  font-size: 12px;
  color: var(--gold-light);
  margin-top: 4px;
  opacity: 0.7;
  letter-spacing: 1px;
}

/* ===== TAB CONTENT ===== */
.tab-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-height) + 8px);
  scroll-behavior: smooth;
}

.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

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

/* ===== TAB 1: FIND YOUR SEAT ===== */
.seat-panel { padding: 24px 20px; }

.seat-intro {
  text-align: center;
  margin-bottom: 28px;
}

.seat-intro p {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
}

.search-box {
  position: relative;
  margin-bottom: 8px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
}

#nameInput {
  width: 100%;
  padding: 16px 16px 16px 44px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--text-dark);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#nameInput:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

#nameInput::placeholder { color: var(--text-light); }

.search-hint {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 20px;
}

/* Results */
#results { margin-top: 4px; }

.result-count {
  font-size: 12px;
  color: var(--gold-dark);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.result-card {
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: slideUp 0.25s ease both;
  cursor: pointer;
}

.result-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

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

.seat-badge {
  background: #000000;
  color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
  min-width: 60px;
  flex-shrink: 0;
}

.seat-badge .badge-label {
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.7;
  display: block;
}

.seat-badge .badge-num {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 20px; /* Slightly smaller base */
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
  word-break: keep-all; /* Changed to avoid breaking numbers */
  display: block;
  max-width: 100px;
}

.result-info { flex: 1; min-width: 0; }

.result-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-tag {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 3px;
}

.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-light);
}

.no-results .emoji { font-size: 36px; margin-bottom: 12px; }
.no-results p { font-size: 14px; line-height: 1.6; }

.empty-state {
  text-align: center;
  padding: 40px 24px;
}

.empty-state .empty-state-icon {
  height: 64px;
  width: auto;
  margin-bottom: 16px;
  display: inline-block;
  object-fit: contain;
}

.empty-state .big-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-family: 'Playfair Display', serif; font-size: 20px; color: var(--gold); margin-bottom: 8px; }
.empty-state p { font-size: 14px; color: var(--text-mid); line-height: 1.6; }

/* ===== TAB 2: FLOOR PLAN ===== */
.floorplan-panel { padding: 20px; }

.floorplan-panel h2 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: var(--gold);
  text-align: center;
  margin-bottom: 4px;
}

.floorplan-panel .sub {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.floorplan-image-wrap {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--cream-dark);
}

.floorplan-image-wrap img {
  width: 100%;
  display: block;
}

.floorplan-legend {
  margin-top: 16px;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.legend-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

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

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dark);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== TAB 3: MENU ===== */
.menu-panel { padding: 20px; }

.menu-header {
  text-align: center;
  margin-bottom: 24px;
}

.menu-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--gold);
}

.menu-header .divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 6px;
}

.menu-header .divider::before,
.menu-header .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.menu-header .divider-icon { color: var(--gold); font-size: 14px; }
.menu-header .sub { font-size: 12px; color: var(--text-light); }

.menu-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--cream-dark);
}

.menu-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-section-title span.icon { font-size: 18px; }

.menu-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--cream-dark);
}

.menu-item:last-child { border-bottom: none; padding-bottom: 0; }

.menu-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
}

.menu-item-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
  line-height: 1.5;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-height);
  background: var(--white);
  border-top: 1px solid var(--cream-dark);
  display: flex;
  align-items: stretch;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  z-index: 100;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 10px 4px;
  position: relative;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none; /* Added for <a> tags */
  color: inherit; /* Added for <a> tags */
}

.nav-btn:active { background: var(--cream); }

.nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 0 0 4px 4px;
}

.nav-icon {
  font-size: 22px;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon img {
  height: 22px;
  width: auto;
  display: block;
  object-fit: contain;
}

.nav-btn.active .nav-icon { transform: scale(1.1); }

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-light);
  transition: color 0.15s;
  text-align: center;
}

.nav-btn.active .nav-label { color: var(--gold-dark); }

/* ===== SCROLLBAR ===== */
.tab-content::-webkit-scrollbar { width: 4px; }
.tab-content::-webkit-scrollbar-track { background: transparent; }
.tab-content::-webkit-scrollbar-thumb { background: var(--cream-dark); border-radius: 2px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 24px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: #151515 url('background.png') no-repeat center center;
  background-size: 100% 100%;
  width: 100%;
  max-width: 400px;
  border-radius: 12px;
  position: relative;
  padding: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: none;
  color: var(--gold-light);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  opacity: 0.5;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.modal-close:hover { opacity: 1; }

.modal-frame {
  border: none;
  padding: 60px 32px;
  position: relative;
  text-align: center;
}
/* Corner accents (Hidden since bg.jpg provides the frame) */
.modal-frame::before, .modal-frame::after { display: none; }
.modal-container::before, .modal-container::after { display: none; }


.modal-logo {
  margin-bottom: 24px;
}
.modal-logo .logo-icon {
  font-size: 32px;
  color: var(--gold);
  margin-bottom: 4px;
}
.modal-logo .logo-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 1px;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 24px;
  color: var(--gold);
  margin-bottom: 28px;
  letter-spacing: 2px;
}

.modal-guest-name {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 14px;
  line-height: 1.2;
  padding: 0 20px;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

.modal-seat-info {
  font-size: 13px;
  color: #a0a0a0;
  margin-bottom: 32px;
  letter-spacing: 0.5px;
}
.modal-seat-info strong {
  font-family: 'Playfair Display', serif !important;
  font-style: italic !important;
  color: var(--gold) !important;
  font-size: clamp(18px, 6vw, 28px) !important;
  margin: 12px auto 0 !important;
  display: block !important;
  font-weight: 700 !important;
  transform: translateY(-16px) !important; /* Optimal value found via live tuning */
  max-width: 220px !important;
  padding: 5px 10px !important;
  line-height: 1 !important;
  word-wrap: break-word !important;
  text-align: center !important;
}

.modal-message {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
  color: #c8c8c8;
  margin-bottom: 32px;
  text-align: center;
  padding: 0 45px; /* Increased padding to stay clear of frame */
  max-width: 330px;
  margin-left: auto;
  margin-right: auto;
}

.modal-bottom-icon {
  font-size: 36px;
  color: var(--gold);
  opacity: 0.9;
}
