/* Modern Responsive Design System for Psarotaverna O Stefanos */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,400;1,600&display=swap');

:root {
  /* Default: Light Sand Mode - Harmonious Page & Header Color */
  --bg-primary: #FAF6EE;
  --bg-card: #FFFFFF;
  --bg-card-border: rgba(211, 47, 47, 0.15);
  --bg-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --text-main: #1C1917;
  --text-muted: #57534E;
  --text-greek-sub: #78716C;
  --accent-red: #D32F2F;
  --accent-red-hover: #B71C1C;
  --accent-gold: #D97706;
  --header-bg: #FAF6EE;
  --header-text: #1C1917;
  --header-subtitle: #57534E;
  --header-ctrl-bg: rgba(0, 0, 0, 0.06);
  --header-ctrl-border: rgba(0, 0, 0, 0.12);
  --header-ctrl-text: #1C1917;
  --wave-fill: #FAF6EE;
  --nav-bg: #FAF6EE;
  --nav-item-bg: #FFFFFF;
  --nav-item-active-bg: #D32F2F;
  --nav-item-active-text: #FFFFFF;
  --input-bg: #FFFFFF;
  --input-border: rgba(0, 0, 0, 0.15);
  --badge-bg: rgba(211, 47, 47, 0.1);
  --badge-text: #D32F2F;
  --meta-theme-color: #FAF6EE;
}

[data-theme="sunset"] {
  --bg-primary: #F4EAD4;
  --bg-card: #FFF8EE;
  --bg-card-border: rgba(192, 86, 33, 0.2);
  --bg-card-shadow: 0 2px 8px rgba(183, 65, 14, 0.06);
  --text-main: #2C1810;
  --text-muted: #6B4E3D;
  --text-greek-sub: #8C6A56;
  --accent-red: #C05621;
  --accent-red-hover: #9C4215;
  --accent-gold: #D97706;
  --header-bg: #F4EAD4;
  --header-text: #2C1810;
  --header-subtitle: #6B4E3D;
  --header-ctrl-bg: rgba(0, 0, 0, 0.06);
  --header-ctrl-border: rgba(192, 86, 33, 0.2);
  --header-ctrl-text: #2C1810;
  --wave-fill: #F4EAD4;
  --nav-bg: #F4EAD4;
  --nav-item-bg: #FFF8EE;
  --nav-item-active-bg: #C05621;
  --nav-item-active-text: #FFFFFF;
  --input-bg: #FFF8EE;
  --input-border: rgba(192, 86, 33, 0.2);
  --badge-bg: rgba(192, 86, 33, 0.12);
  --badge-text: #C05621;
  --meta-theme-color: #F4EAD4;
}

[data-theme="night"] {
  --bg-primary: #0A0A0C;
  --bg-card: #16161D;
  --bg-card-border: rgba(229, 57, 53, 0.25);
  --bg-card-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-greek-sub: #D1D5DB;
  --accent-red: #E53935;
  --accent-red-hover: #EF5350;
  --accent-gold: #F59E0B;
  --header-bg: #0A0A0C;
  --header-text: #FFFFFF;
  --header-subtitle: rgba(255, 255, 255, 0.8);
  --header-ctrl-bg: rgba(255, 255, 255, 0.1);
  --header-ctrl-border: rgba(255, 255, 255, 0.15);
  --header-ctrl-text: #FFFFFF;
  --wave-fill: #0A0A0C;
  --nav-bg: #0A0A0C;
  --nav-item-bg: rgba(255, 255, 255, 0.1);
  --nav-item-active-bg: #E53935;
  --nav-item-active-text: #FFFFFF;
  --input-bg: rgba(255, 255, 255, 0.1);
  --input-border: rgba(255, 255, 255, 0.15);
  --badge-bg: rgba(229, 57, 53, 0.2);
  --badge-text: #FF6B6B;
  --meta-theme-color: #0A0A0C;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 90px;
}

/* Isolated GPU Canvas Layer for Zero Mobile Stutter */
#fishCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
  transform: translateZ(0);
  will-change: transform;
  contain: strict;
}

/* App Wrapper */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

/* Theme-matching Header */
.app-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 24px 16px 16px 16px;
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
}

.header-top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.theme-switcher-group {
  display: flex;
  align-items: center;
  background: var(--header-ctrl-bg);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--header-ctrl-border);
}

.theme-btn {
  background: transparent;
  border: none;
  color: var(--header-ctrl-text);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.75;
}

.theme-btn.active {
  background: var(--accent-red);
  color: #FFFFFF;
  opacity: 1;
}

.lang-selector-container {
  position: relative;
}

.lang-select {
  appearance: none;
  background: var(--header-ctrl-bg);
  border: 1px solid var(--header-ctrl-border);
  color: var(--header-ctrl-text);
  padding: 8px 36px 8px 14px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.lang-select:focus, .lang-select:hover {
  border-color: var(--accent-red);
}

.lang-selector-container::after {
  content: '▼';
  font-size: 0.65rem;
  color: var(--header-ctrl-text);
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.7;
}

.brand-section {
  text-align: center;
  padding: 10px 0 15px 0;
}

/* PROMINENT BIG LOGO */
.brand-logo {
  width: 260px;
  max-width: 90%;
  height: auto;
  margin: 0 auto 14px auto;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.12));
}

.brand-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  text-transform: uppercase;
  color: var(--header-text);
}

.brand-subtitle {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--header-subtitle);
  letter-spacing: 1px;
}

/* SVG Wave Divider */
.wave-divider {
  width: 100%;
  height: auto;
  display: block;
  margin-top: -1px;
  fill: var(--wave-fill);
  transition: fill 0.3s ease;
}

/* Search Bar Section */
.search-section {
  padding: 16px 16px 8px 16px;
}

.search-bar-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

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

.search-input {
  width: 100%;
  padding: 14px 44px 14px 46px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 30px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-red);
}

.search-clear-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.1);
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

/* Sticky Category Navigation Bar */
.sticky-nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.categories-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.categories-nav::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--nav-item-bg);
  border: 1px solid var(--bg-card-border);
  border-radius: 25px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
}

.cat-btn.active {
  background: var(--nav-item-active-bg);
  color: var(--nav-item-active-text);
  border-color: var(--nav-item-active-bg);
}

.cat-icon {
  font-size: 1.1rem;
}

/* Main Content Area */
.menu-content {
  padding: 20px 16px;
}

.category-block {
  margin-bottom: 40px;
  scroll-margin-top: 70px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-red);
}

.category-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.dishes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* High Performance Dish Card (No Heavy Blurs) */
.dish-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--bg-card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.dish-top {
  margin-bottom: 14px;
}

.dish-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}

.dish-title-main {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.dish-price-badge {
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-red);
  background: var(--badge-bg);
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Sticky Greek Translation Subtitle */
.dish-greek-sub {
  font-size: 0.86rem;
  font-style: italic;
  color: var(--text-greek-sub);
  margin-top: 4px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dish-greek-sub::before {
  content: '🇬🇷';
  font-style: normal;
  font-size: 0.8rem;
}

.dish-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 6px;
}

/* Bottom Action Row */
.dish-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.variant-select {
  flex: 1;
  padding: 9px 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.add-cart-btn {
  flex: 0 0 auto;
  background: var(--accent-red);
  color: #FFFFFF;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.add-cart-btn.added-anim {
  background: #2E7D32 !important;
}

/* Floating Cart Bar (Bottom Presenter) */
.floating-cart-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  width: calc(100% - 32px);
  max-width: 600px;
  background: #121212;
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 99;
  transition: transform 0.25s ease;
}

.floating-cart-bar.visible {
  transform: translateX(-50%) translateY(0);
}

.cart-info-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cart-count-badge {
  background: var(--accent-red);
  color: #FFFFFF;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
}

.cart-total-text {
  display: flex;
  flex-direction: column;
}

.cart-items-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cart-price-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFFFFF;
}

.show-waiter-btn {
  background: #D32F2F;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 18px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Fullscreen Waiter Presenter Modal */
.waiter-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0A0A0C;
  color: #FFFFFF;
  z-index: 999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.waiter-header {
  background: #121216;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #D32F2F;
}

.waiter-title-area h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #FF5252;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.waiter-title-area p {
  font-size: 0.85rem;
  color: #9CA3AF;
  margin-top: 4px;
}

.close-waiter-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.waiter-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.waiter-item-card {
  background: #16161D;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 6px solid #D32F2F;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.waiter-item-names {
  flex: 1;
}

.waiter-bilingual-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.3;
}

.waiter-variant-tag {
  display: inline-block;
  font-size: 0.85rem;
  color: #FFB74D;
  background: rgba(255, 183, 77, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 6px;
}

.waiter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.waiter-qty-badge {
  background: #D32F2F;
  color: #FFFFFF;
  font-size: 1.4rem;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 10px;
  min-width: 50px;
  text-align: center;
}

.qty-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #FFFFFF;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.waiter-item-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: #FFD54F;
  min-width: 80px;
  text-align: right;
}

.waiter-footer {
  background: #121216;
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.waiter-total-box {
  font-size: 1.5rem;
  font-weight: 900;
  color: #FFFFFF;
}

.waiter-total-val {
  color: #FFD54F;
  margin-left: 8px;
}

.clear-order-btn {
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid rgba(244, 67, 54, 0.4);
  color: #FF5252;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* Footer Section */
.app-footer {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: 40px;
}

/* Media Queries for Mobile Responsiveness */
@media (max-width: 600px) {
  .brand-title {
    font-size: 1.7rem;
  }

  /* PROMINENT BIG LOGO ON MOBILE */
  .brand-logo {
    width: 220px;
    max-width: 88%;
  }

  .header-top-controls {
    justify-content: center;
  }

  .dishes-grid {
    grid-template-columns: 1fr;
  }

  .waiter-item-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .waiter-controls {
    width: 100%;
    justify-content: space-between;
    margin-top: 10px;
  }

  .waiter-bilingual-title {
    font-size: 1.15rem;
  }

  .floating-cart-bar {
    width: calc(100% - 20px);
    bottom: 10px;
    padding: 10px 14px;
  }
}
