/* Cinema guest – uses theme.css for variables */
@import url('theme.css');

body {
  margin: 0;
  font-family: inherit;
  background: var(--bg);
  background-image: var(--gradient-glow);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

.guest-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.invalid-card {
  max-width: 420px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
}
.invalid-qr-card {
  max-width: 420px;
  width: 100%;
  background: rgba(22, 22, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: var(--radius-xl);
  padding: 32px;
  text-align: center;
  box-shadow: var(--glow-card), 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.btn-invalid-primary {
  background: var(--gradient-accent) !important;
  color: #0a0a0a !important;
  transition: box-shadow 0.2s;
}
.btn-invalid-primary:hover {
  box-shadow: var(--glow-btn);
}

.invalid-icon {
  font-size: 48px;
  color: var(--amber);
  margin-bottom: 12px;
}

.invalid-card h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.invalid-card p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
}

/* Layout: header + main + nav */
.guest-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 80px;
}

.guest-header {
  background: rgba(22, 22, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(34, 211, 238, 0.08);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.guest-header .seat-info {
  font-size: 13px;
  color: var(--muted);
}

.guest-header h1 {
  color: var(--text);
}
.guest-header .seat-info strong {
  color: var(--accent);
}

.guest-main {
  flex: 1;
  padding: 16px;
}

/* Cards – glassmorphism, hover glow */
.card {
  background: rgba(26, 26, 26, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-card);
  border-color: rgba(34, 211, 238, 0.25);
}
.card h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}
.card-cta-primary {
  background: var(--gradient-accent);
  color: #0a0a0a;
  border: none;
  box-shadow: 0 4px 14px rgba(34, 211, 238, 0.35);
}
.card-cta-primary:hover {
  box-shadow: var(--glow-btn);
  opacity: 1;
}
.card-cta-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
}
.card-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  min-height: 44px;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.btn-primary {
  background: var(--gradient-accent);
  color: #0a0a0a;
  box-shadow: 0 4px 14px rgba(34, 211, 238, 0.3);
}
.btn-primary:hover {
  box-shadow: var(--glow-btn);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: rgba(34, 211, 238, 0.1);
}

/* Food menu */
.menu-section {
  margin-bottom: 24px;
}

.menu-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.food-grid {
  display: grid;
  gap: 12px;
}

/* Food menu items – glassmorphism, hover */
.menu-item {
  background: rgba(26, 26, 26, 0.7) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: var(--radius-lg);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.menu-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--glow-card);
  border-color: rgba(34, 211, 238, 0.2) !important;
}
.guest-food-header {
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(34, 211, 238, 0.15);
}
.guest-food-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.food-card {
  background: rgba(26, 26, 26, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 90px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.food-card:focus-within {
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.food-thumb {
  width: 100px;
  height: 90px;
  background: var(--surface2);
  object-fit: cover;
}

.food-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: middle;
}

.food-info {
  padding: 8px 0;
  min-width: 0;
}

.food-info .name {
  font-weight: 600;
  margin-bottom: 4px;
}

.food-info .desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.food-info .price {
  color: var(--accent);
  font-weight: 700;
}

.food-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 8px currentColor;
}
.food-dot.veg { background: var(--success); }
.food-dot.non_veg { background: var(--danger); }

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
}

.qty-control button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  min-width: 44px;
  min-height: 44px;
}

.qty-control button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.qty-control button:hover {
  background: var(--border);
}
.qty-control button[style*="accent"],
.qty-control .qty-btn-add {
  background: var(--gradient-accent) !important;
  box-shadow: 0 2px 10px rgba(34, 211, 238, 0.35);
}
.qty-control .qty-btn-add:hover,
.qty-btn-add:hover {
  box-shadow: var(--glow-btn);
}

.qty-control .qty-num {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
}

/* Sticky cart bar – glassmorphism */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(22, 22, 22, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 20;
  min-height: 60px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
}

.cart-bar .total {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

.cart-bar .cart-badge {
  background: linear-gradient(135deg, var(--magenta) 0%, var(--rose) 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  animation: pulse-soft 2s ease-in-out infinite;
}

.cart-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  z-index: 30;
  background: rgba(10, 10, 10, 0.92) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(34, 211, 238, 0.12) !important;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
/* When bottom nav is present, sit cart bar above it so Place Order is visible */
body.has-bottom-nav .cart-bottom-bar {
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
.cart-bottom-bar,
.cart-bottom-bar * {
  color: var(--text);
}
.cart-bottom-bar #cartSummary {
  color: var(--muted);
}
.btn-place-order {
  background: var(--gradient-accent) !important;
  color: #0a0a0a !important;
  transition: box-shadow 0.2s, transform 0.2s;
}
.btn-place-order:hover:not(:disabled) {
  box-shadow: var(--glow-btn);
}
.btn-place-order:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.cart-item-row {
  background: rgba(26, 26, 26, 0.7) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: var(--radius-lg);
  color: var(--text);
}
.cart-item-row p {
  color: var(--text);
}
.cart-item-row .text-sm {
  color: var(--muted);
}
.order-success-overlay {
  background: rgba(10, 10, 10, 0.96) !important;
  color: var(--text);
}
.order-success-overlay .success-ring {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(34, 197, 94, 0.15) 100%);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.4), 0 0 24px rgba(34, 197, 94, 0.25);
  color: var(--success);
}
.order-success-overlay p {
  color: var(--text);
}
.order-success-overlay #orderSuccessEta {
  color: var(--muted);
}

/* Bottom nav – glassmorphism, active gradient */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(22, 22, 22, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 25;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  border-radius: var(--radius-md);
  min-width: 64px;
  min-height: 44px;
  justify-content: center;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.bottom-nav a:hover {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.08);
}

.bottom-nav a.active {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.12);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.18) 0%, rgba(34, 211, 238, 0.08) 100%);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
}

.bottom-nav a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-ring);
}

/* Orders list */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-card {
  background: rgba(26, 26, 26, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.order-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--glow-card);
  border-color: rgba(34, 211, 238, 0.15);
}

.order-card .order-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.order-card .order-items {
  margin-bottom: 8px;
  font-size: 14px;
}

.order-card .order-total {
  font-weight: 700;
  color: var(--accent);
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
}

.status-pill.pending { background: linear-gradient(135deg, rgba(251, 191, 36, 0.35) 0%, rgba(245, 158, 11, 0.25) 100%); color: var(--amber); }
.status-pill.preparing { background: linear-gradient(135deg, rgba(34, 211, 238, 0.35) 0%, rgba(6, 182, 212, 0.25) 100%); color: var(--accent); }
.status-pill.ready { background: linear-gradient(135deg, rgba(251, 191, 36, 0.4) 0%, rgba(245, 158, 11, 0.3) 100%); color: var(--amber); }
.status-pill.delivered { background: linear-gradient(135deg, rgba(34, 197, 94, 0.35) 0%, rgba(22, 163, 74, 0.25) 100%); color: var(--success); }
.status-pill.cancelled { background: linear-gradient(135deg, rgba(251, 113, 133, 0.35) 0%, rgba(244, 63, 94, 0.25) 100%); color: var(--rose); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.empty-state a {
  color: var(--accent);
  font-weight: 600;
}

/* Toast */
.toast {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

.toast.success { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.toast.error { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* Tap animation for nav/buttons */
.tap {
  animation: guest-tap 160ms ease-out;
}
@keyframes guest-tap {
  0% { transform: scale(1); }
  50% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

/* Staggered reveal for home cards */
.guest-reveal {
  opacity: 0;
  animation: fade-in-up 0.4s ease-out forwards;
  animation-delay: calc(0.05s + (var(--reveal-order, 0) * 0.1s));
}
.cart-badge-pulse {
  animation: pulse-soft 2s ease-in-out infinite;
}

/* Padding when bottom nav is present (with safe area) */
body.has-bottom-nav {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* Guest scope: prevent Tailwind from forcing black text on dark background */
body.has-bottom-nav .guest-header h1,
body.has-bottom-nav .guest-header h2,
body.has-bottom-nav .guest-main h1,
body.has-bottom-nav .guest-main h2,
body.has-bottom-nav .guest-main p {
  color: var(--text);
}
body.has-bottom-nav .card-cta-secondary h2 {
  color: var(--text);
}

/* Focus visible */
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .qty-control button { transition: none; }
  .tap { animation: none; }
}
