@font-face {
  font-family: 'Evogria';
  src: url('font/Evogria.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Evogria';
  src: url('font/Evogria Italic.otf') format('opentype');
  font-weight: normal;
  font-style: italic;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-dots: #f5f1e8;
  --bg-white: #ffffff;
  --text-dark: #000000;
  --text-gray: #666666;
  --border-color: #000000;
  --accent-gold: #d4af37;
}

body {
  font-family: 'Evogria', 'Inter', sans-serif;
  background: var(--bg-white);
  color: var(--text-dark);
  overflow: hidden;
  margin: 0;
  padding: 0;
}

#app {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ===== EDITOR SIDEBAR ===== */
.editor-sidebar {
  width: 380px;
  background: #1a1a1a;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.editor-header {
  padding: 20px;
  background: #111111;
  border-bottom: 1px solid #333333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-logo {
  height: 40px;
  width: auto;
}

.mode-btn {
  background: #333333;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.mode-btn:hover {
  background: #444444;
}

.editor-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.editor-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-section h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #aaaaaa;
}

/* TV Selector */
.tv-select {
  width: 100%;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.tv-select:focus {
  outline: none;
  border-color: #555555;
}

.tv-select option {
  background: #2a2a2a;
  color: #ffffff;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: #aaaaaa;
  font-weight: 500;
}

.field input,
.field textarea {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #555555;
}

.add-btn,
.primary-btn,
.secondary-btn {
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.add-btn {
  background: #2a2a2a;
  color: #ffffff;
  border: 1px dashed #444444;
}

.add-btn:hover {
  background: #333333;
  border-color: #666666;
}

.primary-btn {
  background: #4a90e2;
  color: #ffffff;
}

.primary-btn:hover {
  background: #3a7bc8;
}

.save-btn {
  font-size: 16px;
  padding: 14px 20px;
}

.save-btn.has-changes {
  background: #ff9800;
  animation: pulse 2s infinite;
}

.save-btn.has-changes:hover {
  background: #f57c00;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.save-info {
  text-align: center;
  font-size: 13px;
  margin-top: 8px;
  font-weight: 500;
}

.secondary-btn {
  background: #2a2a2a;
  color: #ffffff;
}

.secondary-btn:hover {
  background: #333333;
}

.secondary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.share-section input {
  font-size: 12px;
  padding: 8px 10px;
}

.info-text {
  font-size: 13px;
  color: #888888;
  margin-bottom: 16px;
  line-height: 1.5;
}

.tv-link-group {
  margin-bottom: 16px;
}

.tv-link-group:last-child {
  margin-bottom: 0;
}

.tv-link-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #cccccc;
  margin-bottom: 6px;
}

.link-row {
  display: flex;
  gap: 8px;
}

.link-input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
}

.link-input:focus {
  outline: none;
  border-color: #555555;
}

/* Section card */
.section-card {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-card-header input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #444444;
  color: #ffffff;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
}

.section-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: #888888;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  transition: color 0.2s;
}

.icon-btn:hover {
  color: #ffffff;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: start;
}

.item-inputs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-inputs input {
  background: #1a1a1a;
  border: 1px solid #444444;
  color: #ffffff;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 13px;
}

.item-inputs input.item-name {
  font-weight: 500;
}

.item-inputs input.item-desc {
  font-size: 11px;
  color: #aaaaaa;
}

.item-price-input {
  background: #1a1a1a;
  border: 1px solid #444444;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  width: 70px;
  text-align: center;
}

/* ===== PREVIEW AREA ===== */
.preview-area {
  flex: 1;
  background: #2a2a2a;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  position: relative;
  user-select: none;
}

.preview-area .tv-screen {
  width: 1080px;
  height: 1920px;
  background: var(--bg-dots);
  background-image: url('pictures/back_tv1.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform-origin: center center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

/* Zoom controls */
.zoom-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 100;
}

.zoom-btn {
  background: #3a3a3a;
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.zoom-btn:hover {
  background: #4a4a4a;
}

.zoom-level {
  color: #ffffff;
  font-size: 13px;
  min-width: 50px;
  text-align: center;
  font-weight: 500;
}

.tv-screen .menu-container {
  width: 100%;
  max-width: 920px;
  padding: 0 80px;
  height: 1920px;
  max-height: 1920px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  box-sizing: border-box;
}

#menu-preview {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  padding-top: 60px;
  padding-bottom: 60px;
  box-sizing: border-box;
}

/* Logo header */
.menu-header {
  text-align: center;
  margin-bottom: 40px;
}

.menu-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}

.menu-logo img {
  max-width: 500px;
  height: auto;
}

.menu-subtitle {
  font-size: 18px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-gray);
  font-weight: 400;
}

/* Menu section */
.menu-section {
  margin-bottom: 48px;
}

.section-title {
  font-family: 'Evogria', 'Bebas Neue', sans-serif;
  font-size: 48px;
  letter-spacing: 1px;
  margin-bottom: 16px;
  color: var(--text-dark);
}

.section-box {
  border: 3px solid var(--border-color);
  border-radius: 16px;
  padding: 30px 40px;
  background: transparent;
  backdrop-filter: none;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
  gap: 24px;
}

.menu-item:last-child {
  margin-bottom: 0;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-family: 'Evogria', 'Bebas Neue', sans-serif;
  font-size: 32px;
  letter-spacing: 0.5px;
  color: var(--text-dark);
  line-height: 1.2;
}

.item-description {
  font-size: 18px;
  color: var(--text-dark);
  margin-top: 4px;
  font-weight: 400;
}

.item-price {
  font-family: 'Evogria', 'Bebas Neue', sans-serif;
  font-size: 36px;
  color: var(--text-dark);
  white-space: nowrap;
  font-weight: 400;
  text-shadow: none;
  border: none;
}

.section-note {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid #cccccc;
  font-size: 16px;
  color: var(--text-gray);
  font-style: italic;
}

/* Fullscreen mode */
.preview-area.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  padding: 0;
  background: var(--bg-dots);
}

.preview-area.fullscreen .tv-screen {
  width: 1080px;
  height: 1920px;
  max-width: 100vw;
  max-height: 100vh;
  transform: scale(1);
  border-radius: 0;
  box-shadow: none;
}

/* TV Display Mode - ukryj edytor */
body.tv-mode .editor-sidebar {
  display: none;
}

body.tv-mode .preview-area {
  width: 100vw;
  height: 100vh;
  padding: 0;
  background: var(--bg-dots);
}

body.tv-mode .preview-area .tv-screen {
  width: 1080px;
  height: 1920px;
  max-width: 100vw;
  max-height: 100vh;
  transform: scale(1);
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

/* Responsive */
@media (max-width: 1080px) {
  .preview-area .tv-screen {
    transform: scale(0.35);
  }

  .tv-screen .menu-container {
    padding: 40px 60px;
  }
}

@media (max-width: 900px) {
  #app {
    flex-direction: column;
  }

  .editor-sidebar {
    width: 100%;
    max-height: 40vh;
  }

  .preview-area {
    padding: 10px;
  }

  .preview-area .tv-screen {
    transform: scale(0.25);
  }

  .section-title {
    font-size: 36px;
  }

  .item-name {
    font-size: 24px;
  }

  .item-price {
    font-size: 28px;
  }
}
