/* =========================
   Google Fonts
========================= */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Playfair+Display:wght@700&display=swap");

/* =========================
   Theme 
========================= */
:root {
  --primary: #8b6f4e;
  --primary-600: #7a6144;
  --info: #3a6ea5;
  --accent: #2fbf71;
  --paper: #fffdf8;
  --ink: #1a1b1e;
  --muted: #5f6c7b;
  --ring: rgba(58, 110, 165, 0.35);
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  --radius: 14px;

  --bg-url: url("https://images.unsplash.com/photo-1515003197210-e0cd71810b5f?q=60&fm=webp&w=1600&fit=crop");
  --bg-tint: rgba(255, 243, 224, 0.78);
}

/* =========================
    Background (full-page)
========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  background-image: linear-gradient(0deg, var(--bg-tint), var(--bg-tint)),
    var(--bg-url);
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  background-attachment: scroll, fixed;
}

/* =========================
   Base + Sticky Footer Layout
========================= */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font: 16px/1.6 "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  color: var(--ink);
  background: transparent;
}

main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

section + section {
  margin-top: 2rem;
}

/* Focus & selection */
::selection {
  background: rgba(47, 191, 113, 0.22);
}
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 10px;
}

/* =========================
   Sticky Header (Flex)
========================= */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(139, 111, 78, 0.92);
  color: var(--paper);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  padding: 0.85rem 1.25rem;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

#restaurant-name,
#menu-title {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
}

nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  background: var(--info);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  transition: transform 0.12s ease, filter 0.2s ease;
}
nav a:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

/* =========================
   Card Utility
========================= */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

/* =========================
   HOME — Order Form
========================= */
form#order-form {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;

  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

form#order-form > div {
  flex: 1 1 260px;
  min-width: 220px;
}
form#order-form label {
  font-weight: 600;
  color: var(--muted);
}

form#order-form input[type="text"],
form#order-form input[type="number"],
form#order-form input[type="url"],
form#order-form input[type="file"] {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid #e6e0d6;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    background-color 0.2s ease;
}
form#order-form input:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 6px var(--ring);
}

/* Buttons */
#add-order-btn,
#clear-orders {
  appearance: none;
  background: var(--primary);
  color: #fff;
  border: 0;
  font-weight: 800;
  letter-spacing: 0.2px;
  cursor: pointer;
  border-radius: 999px;
  transition: transform 0.08s ease, background 0.2s ease, filter 0.2s ease,
    box-shadow 0.2s ease;
}

#add-order-btn {
  padding: 0.55rem 0.95rem;
  font-size: 0.95rem;
  line-height: 1;
  height: 42px;
  align-self: flex-end;
  margin-left: auto;
  box-shadow: 0 6px 14px rgba(139, 111, 78, 0.18);
}
#add-order-btn:hover {
  background: var(--primary-600);
}
#add-order-btn:active {
  transform: translateY(1px);
}

#clear-orders {
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  margin-top: 0.9rem;
  box-shadow: 0 6px 14px rgba(139, 111, 78, 0.18);
}
#clear-orders:hover {
  background: var(--primary-600);
}
#clear-orders:active {
  transform: translateY(1px);
}

/* =========================
   HOME — Orders Table
========================= */
#orders-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#orders-table thead {
  background: linear-gradient(
    90deg,
    rgba(139, 111, 78, 0.98),
    rgba(58, 110, 165, 0.98)
  );
  color: #fff;
}
#orders-table th,
#orders-table td {
  padding: 0.9rem 1rem;
  text-align: left;
}
#orders-table tbody tr {
  transition: background 0.2s ease;
}
#orders-table tbody tr:hover {
  background: #f8f3e9;
}
#orders-table img {
  display: block;
  max-width: 96px;
  height: auto;
  border-radius: 10px;
}

/* =========================
   MENU — Cards
========================= */
#menu-section .section-heading {
  text-align: left;
  font-size: 1.85rem;
  margin-bottom: 1rem;
  color: var(--ink);
  font-family: "Playfair Display", serif;
}

#menu-list.menu-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: stretch;
  justify-content: flex-start;
}

/* Card */
.menu-item {
  position: relative;
  background: var(--paper);
  border: 1.5px solid rgba(26, 27, 30, 0.06);
  border-radius: 16px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.1);
  padding: 1rem 1rem 1.15rem;
  text-align: center;

  flex: 1 1 240px;
  max-width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.menu-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  background: linear-gradient(90deg, var(--info), var(--primary));
}

.menu-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.14);
  border-color: rgba(26, 27, 30, 0.12);
}

.menu-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 0.6rem;
  margin-bottom: 0.75rem;
  display: block;
}

.menu-name {
  font-weight: 800;
  font-size: 1.08rem;
  color: var(--ink);
  margin: 0.22rem 0 0.4rem;
}

.menu-price {
  display: inline-block;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 10px rgba(47, 191, 113, 0.28);
}

/* =========================
   Footer
========================= */
footer {
  background: var(--primary);
  color: var(--paper);
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
}

/* =========================
   Subtle Animations
========================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#menu-section,
form#order-form,
#orders-table {
  animation: fadeIn 0.45s ease both;
}

/* =========================
   Large Screens: make photo fixed more strongly
========================= */
@media (min-width: 900px) {
  html {
    background-attachment: scroll, fixed;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
