/* ═══════════════════════════════════════════════════════════
   Trakya City Hotel — QR Menu Styles
   Design System: Hotel brand colors + premium dark/light modes
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties (Design Tokens) ─────────────── */
:root {
  /* Brand */
  --brand: #B40303;
  --brand-light: #D42828;
  --brand-dark: #8C0202;
  --brand-glow: rgba(180, 3, 3, 0.3);

  /* Typography */
  --font-display: 'Gilda Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Sizing */
  --header-h: 70px;
  --nav-h: 52px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.3s;
}

/* ─── Dark Theme (default) ──────────────────────────────── */
[data-theme="dark"] {
  --brand: #B40303;
  --brand-light: #D42828;
  --brand-price: #E2C799;
  --price-color: #E2C799;
  --bg-primary: #0A0A0F;
  --bg-secondary: #12121A;
  --bg-card: #181922;
  --bg-card-hover: #222330;
  --bg-glass: rgba(18, 18, 26, 0.85);
  --bg-nav: rgba(10, 10, 15, 0.92);
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);
  --text-primary: #FFFFFF;
  --text-secondary: #C5C5D8;
  --text-tertiary: #9595AB;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-header: 0 1px 0 rgba(255, 255, 255, 0.08);
  --img-placeholder: #1E1E2A;
}

/* ─── Light Theme ───────────────────────────────────────── */
[data-theme="light"] {
  --bg-primary: #FBF8F4;
  --bg-secondary: #F3EDE5;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F9F6F2;
  --bg-glass: rgba(251, 248, 244, 0.88);
  --bg-nav: rgba(251, 248, 244, 0.95);
  --border: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.12);
  --text-primary: #161921;
  --text-secondary: #5F6068;
  --text-tertiary: #9A9BA3;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-header: 0 1px 0 rgba(0, 0, 0, 0.05);
  --img-placeholder: #EFEBE5;
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

.hidden { display: none !important; }
.screen { min-height: 100dvh; }

/* ═══════════════════════════════════════════════════════════
   LANGUAGE SELECTOR SCREEN
   ═══════════════════════════════════════════════════════════ */

.lang-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0A0A0F;
  overflow: hidden;
}

.lang-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(180, 3, 4, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(180, 3, 4, 0.08) 0%, transparent 50%);
  animation: langPulse 8s ease-in-out infinite alternate;
}

@keyframes langPulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.lang-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  animation: langFadeIn 0.8s var(--ease) both;
}

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

.lang-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  width: 100%;
}

.lang-logo img {
  display: block;
  max-width: 200px;
  height: auto;
  margin: 0 auto;
}

.lang-subtitle {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lang-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 1.25rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  transition: all var(--dur) var(--ease);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lang-btn:hover,
.lang-btn:focus-visible {
  background: rgba(180, 3, 4, 0.15);
  border-color: rgba(180, 3, 4, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(180, 3, 4, 0.15);
}

.lang-btn:active {
  transform: translateY(0) scale(0.97);
}

.lang-flag {
  font-size: 2rem;
  line-height: 1;
}

.lang-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.02em;
}

.lang-footer {
  margin-top: 2.5rem;
}

.lang-tagline {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.2);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   MENU SCREEN
   ═══════════════════════════════════════════════════════════ */

.menu-screen {
  display: flex;
  flex-direction: column;
  animation: menuSlideIn 0.6s var(--ease) both;
}

@keyframes menuSlideIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── Header ────────────────────────────────────────────── */
.menu-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background var(--dur) var(--ease);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.header-logo {
  height: 48px;
  max-height: 50px;
  width: auto;
  object-fit: contain;
  transition: transform var(--dur) var(--ease);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: all var(--dur) var(--ease);
}

.icon-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Theme toggle icons */
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ─── Category Navigation ───────────────────────────────── */
.category-nav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  transition: background var(--dur) var(--ease);
}

.category-tabs {
  display: flex;
  align-items: center;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 1rem;
  gap: 6px;
  max-width: 600px;
  margin: 0 auto;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  border-radius: var(--radius-full);
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  border: 1px solid transparent;
}

.cat-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-card);
}

.cat-tab.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 2px 12px var(--brand-glow);
}

/* ─── Menu Content ──────────────────────────────────────── */
.menu-content {
  flex: 1;
  padding: calc(var(--header-h) + var(--nav-h) + 1rem) 1rem 5rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.menu-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Menu Item Card ────────────────────────────────────── */
.menu-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--dur) var(--ease);
  animation: itemFadeIn 0.4s var(--ease) both;
}

.menu-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

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

.item-image {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--img-placeholder);
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.menu-item:hover .item-image img {
  transform: scale(1.05);
}

.item-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 1.8rem;
}

.item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.item-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
}

.item-orig-name {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  font-style: italic;
  display: inline-block;
}

.item-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.item-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-price, var(--brand));
  letter-spacing: -0.01em;
}

/* Item without image — wider layout */
.menu-item.no-image {
  flex-direction: column;
  gap: 4px;
}

.menu-item.no-image .item-info {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.menu-item.no-image .item-text {
  flex: 1;
  min-width: 0;
}

.menu-item.no-image .item-price {
  flex-shrink: 0;
  align-self: flex-start;
  padding-top: 2px;
}

/* ─── Category Header in items ──────────────────────────── */
.category-header-inline {
  padding: 1.5rem 0 0.75rem;
}

.category-header-inline:first-child {
  padding-top: 0;
}

.category-header-inline h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text-primary);
  position: relative;
  padding-bottom: 8px;
}

.category-header-inline h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 2px;
  background: var(--brand);
  border-radius: 1px;
}

/* ─── Empty State ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-tertiary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 0.9rem;
}

/* ─── Footer ────────────────────────────────────────────── */
.menu-footer {
  text-align: center;
  padding: 1.75rem 1rem 2.5rem;
}

.kirei-link {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-decoration: none;
  display: inline-block;
  color: #71717A;
  transition: color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

[data-theme="dark"] .kirei-link {
  color: #8E95A5;
  opacity: 0.8;
}

[data-theme="dark"] .kirei-link:hover {
  color: #D1D5DB;
  opacity: 1;
}

[data-theme="light"] .kirei-link {
  color: #71717A;
  opacity: 0.85;
}

[data-theme="light"] .kirei-link:hover {
  color: #27272A;
  opacity: 1;
}

/* ─── Loading Skeleton ──────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.skeleton-img {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.skeleton-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.skeleton-line {
  height: 14px;
}

.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w40 { width: 40%; }

/* ─── Scroll-to-top (accessible) ────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--brand-glow);
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--dur) var(--ease);
  z-index: 50;
  pointer-events: none;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top:hover {
  background: var(--brand-dark);
  transform: translateY(-2px);
}

/* ─── Media Queries ─────────────────────────────────────── */
@media (min-width: 480px) {
  .lang-grid {
    gap: 16px;
  }

  .lang-btn {
    padding: 1.5rem;
  }

  .lang-flag {
    font-size: 2.5rem;
  }

  .item-image {
    width: 100px;
    height: 100px;
  }
}

@media (min-width: 768px) {
  .lang-content {
    max-width: 480px;
  }

  .lang-logo img {
    max-width: 240px;
  }
}

/* ─── Reduced Motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Safe Area for notch devices ───────────────────────── */
@supports (padding-top: env(safe-area-inset-top)) {
  .menu-header {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--header-h) + env(safe-area-inset-top));
  }
}
