/* ==========================================================================
   PIZZA KEBAB CAMPANELLA - DIGITAL TV SIGNAGE MENU BOARD
   100% Pixel-Accurate Replica of Original Design
   Target: 16:9 Displays (1080p, 4K, Smart TVs, Kiosks)
   ========================================================================== */

/* Import Google Fonts with system fallbacks */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,600;0,700;0,800;0,900;1,400;1,500;1,600&family=Oswald:wght@600;700&family=Satisfy&display=swap');

:root {
  /* Exact Color Palette matching original image */
  --color-gold: #f5cb3c;
  --color-gold-num: #f5cb3c;
  --color-green-mini: #4ee04e;
  --color-white-normale: #ffffff;
  --color-red-maxi: #f04343;
  --color-ingredients: #bcc2cd;
  --color-border-box: rgba(194, 189, 160, 0.72);
  --color-divider-dotted: rgba(255, 255, 255, 0.22);
  --color-divider-vert: rgba(255, 255, 255, 0.25);
  
  /* Reference 1080p Canvas */
  --canvas-width: 1920px;
  --canvas-height: 1080px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #050606;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

/* ==========================================================================
   SCREEN WRAPPER - Scales 1920x1080 canvas to fit ANY TV / Display
   ========================================================================== */
#screen-wrapper {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000;
  overflow: hidden;
  position: relative;
}

/* Fixed 1920x1080 reference canvas board */
#menu-board {
  width: var(--canvas-width);
  height: var(--canvas-height);
  position: absolute;
  transform-origin: center center;
  background-color: #060807;
  background-image: url('assets/bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.95);
}

/* 4K High-DPI support */
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi), (min-width: 2500px) {
  #menu-board {
    background-image: url('assets/bg_4k.jpg');
  }
}

/* ==========================================================================
   MAIN MENU COLUMNS
   ========================================================================== */
.menu-columns-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   COLUMN 1 (Items 01 - 13)
   -------------------------------------------------------------------------- */
#col-1 {
  position: absolute;
  left: 38px;
  top: 265px;
  width: 574px;
  height: 700px;
}

#col-1 .pizza-info,
#col-1 .col-header-spacer {
  width: 294px;
  flex: 0 0 294px;
}

#col-1 .pizza-prices,
#col-1 .col-header-prices {
  width: 280px;
  flex: 0 0 280px;
}

#col-1 .mini {
  width: 92px;
  flex: 0 0 92px;
}

#col-1 .normale {
  width: 95px;
  flex: 0 0 95px;
}

#col-1 .maxi {
  width: 93px;
  flex: 0 0 93px;
}

/* --------------------------------------------------------------------------
   COLUMN 2 (Items 14 - 26, Center Framed Box)
   -------------------------------------------------------------------------- */
#col-2 {
  position: absolute;
  left: 641px;
  top: 248px;
  width: 602px;
  height: 684px;
  border: 1.5px solid var(--color-border-box);
  padding: 10px 16px 8px 18px;
  background: rgba(6, 8, 7, 0.15);
}

#col-2 .pizza-info,
#col-2 .col-header-spacer {
  width: 298px;
  flex: 0 0 298px;
}

#col-2 .pizza-prices,
#col-2 .col-header-prices {
  width: 270px;
  flex: 0 0 270px;
}

#col-2 .mini {
  width: 88px;
  flex: 0 0 88px;
}

#col-2 .normale {
  width: 90px;
  flex: 0 0 90px;
}

#col-2 .maxi {
  width: 92px;
  flex: 0 0 92px;
}

#col-2 .pizza-row {
  height: 48px;
  padding: 2px 0 1px 0;
}

/* --------------------------------------------------------------------------
   COLUMN 3 (Items 27 - 39)
   -------------------------------------------------------------------------- */
#col-3 {
  position: absolute;
  left: 1269px;
  top: 265px;
  width: 591px;
  height: 700px;
}

#col-3 .pizza-info,
#col-3 .col-header-spacer {
  width: 306px;
  flex: 0 0 306px;
}

#col-3 .pizza-prices,
#col-3 .col-header-prices {
  width: 285px;
  flex: 0 0 285px;
}

#col-3 .mini {
  width: 92px;
  flex: 0 0 92px;
}

#col-3 .normale {
  width: 95px;
  flex: 0 0 95px;
}

#col-3 .maxi {
  width: 98px;
  flex: 0 0 98px;
}

/* ==========================================================================
   COLUMN HEADERS (MINI, NORMALE, MAXI)
   ========================================================================== */
.col-header-row {
  display: flex;
  align-items: flex-end;
  height: 32px;
  margin-bottom: 6px;
}

.col-header-spacer {
  height: 100%;
}

.col-header-prices {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.header-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', 'Montserrat', Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-align: center;
  text-transform: uppercase;
}

.header-badge.mini {
  color: var(--color-green-mini);
  text-shadow: 0 0 10px rgba(78, 224, 78, 0.45);
  border-left: 1px dotted var(--color-divider-vert);
}

.header-badge.normale {
  color: var(--color-white-normale);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  border-left: 1px dotted var(--color-divider-vert);
}

.header-badge.maxi {
  color: var(--color-red-maxi);
  text-shadow: 0 0 10px rgba(240, 67, 67, 0.45);
  border-left: 1px dotted var(--color-divider-vert);
}

/* ==========================================================================
   PIZZA ITEM ROWS
   ========================================================================== */
.items-list {
  display: flex;
  flex-direction: column;
}

.pizza-row {
  display: flex;
  align-items: stretch;
  height: 49.5px;
  border-bottom: 1px dotted var(--color-divider-dotted);
  padding: 2px 0 2px 0;
}

/* Left part: Title & Ingredients */
.pizza-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 8px;
  overflow: hidden;
}

.pizza-title-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1.18;
}

.pizza-num {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--color-gold-num);
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.pizza-name {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--color-gold);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pizza-ingredients {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 12.5px;
  font-style: italic;
  font-weight: 500;
  color: var(--color-ingredients);
  line-height: 1.25;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 2px;
}

/* Right part: Prices */
.pizza-prices {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}

.price-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', 'Oswald', Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 0 4px;
}

.price-cell.mini {
  color: var(--color-green-mini);
  text-shadow: 0 0 8px rgba(78, 224, 78, 0.35);
  border-left: 1px dotted var(--color-divider-vert);
}

.price-cell.normale {
  color: var(--color-white-normale);
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
  border-left: 1px dotted var(--color-divider-vert);
}

.price-cell.maxi {
  color: var(--color-red-maxi);
  text-shadow: 0 0 8px rgba(240, 67, 67, 0.35);
  border-left: 1px dotted var(--color-divider-vert);
}

/* ==========================================================================
   TV CONTROL OVERLAYS (AUTO-HIDING)
   ========================================================================== */
.tv-controls {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  gap: 10px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.tv-controls.show,
#screen-wrapper:hover .tv-controls {
  opacity: 1;
}

.tv-btn {
  background: rgba(18, 20, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.tv-btn:hover {
  background: rgba(245, 203, 60, 0.95);
  color: #000000;
  border-color: #f5cb3c;
  transform: translateY(-2px);
}

.tv-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* Live Clock (optional TV feature toggle with 'C' key) */
.tv-clock {
  position: absolute;
  top: 18px;
  right: 28px;
  font-family: 'Oswald', 'Montserrat', monospace;
  font-size: 17px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.55);
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: none;
}

/* ==========================================================================
   EDIT MODAL (Press 'E' to edit prices & names, saves to LocalStorage)
   ========================================================================== */
#edit-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

#edit-modal.open {
  display: flex;
}

.modal-content {
  background: #141619;
  border: 1px solid rgba(245, 203, 60, 0.5);
  border-radius: 12px;
  width: 900px;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  color: #ffffff;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 20px;
  color: var(--color-gold);
}

.modal-close-btn {
  background: none;
  border: none;
  color: #aaaaaa;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.edit-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.edit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 6px;
}

.edit-row input {
  background: #0d0f11;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.edit-row input:focus {
  border-color: var(--color-gold);
  outline: none;
}

.edit-num {
  width: 40px;
  color: var(--color-gold);
  font-weight: 700;
}

.edit-name {
  width: 220px;
  font-weight: 700;
}

.edit-ingredients {
  flex: 1;
  color: #aaaaaa;
}

.edit-mini {
  width: 85px;
  color: var(--color-green-mini);
  text-align: center;
  font-weight: 600;
}

.edit-normale {
  width: 85px;
  text-align: center;
  font-weight: 600;
}

.edit-maxi {
  width: 85px;
  color: var(--color-red-maxi);
  text-align: center;
  font-weight: 600;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: var(--color-gold);
  border: none;
  color: #000000;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.btn-primary:hover {
  background: #ffdb58;
}

::selection {
  background: #f5cb3c;
  color: #000000;
}
