:root {
  --accent: #ff6f61;
  --bg: #f9f9fb;
  --card-bg: #fff;
  --text: #333;
  --border: #ddd;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

h1 {
  color: var(--accent);
  margin-bottom: 20px;
}

.scanner-card {
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  padding: 20px;
  max-width: 420px;
  width: 100%;
  overflow: hidden;
  transition: all 0.3s ease;
}

.video-wrapper {
  position: relative;
  width: 100%;
  height: 128px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--accent);
  background: #000;
  margin-bottom: 15px;
}

video {
  width: 100%;
}

canvas {
  display: none;
}

.zoom-controls {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: none;
  flex-direction: column;
  gap: 6px;
}

.zoom-controls button {
  background: rgba(255,255,255,0.85);
  color: var(--accent);
  border: none;
  font-size: 1.3em;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.1s;
}

.zoom-controls button:active {
  transform: scale(0.9);
}

#startCamera {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,111,97,0.9);
  color: #fff;
  border: none;
  font-size: 2.5em;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s, opacity 0.3s;
  padding-left: 14px;
  font-family: 'Arial', 'Helvetica', sans-serif;
}

#startCamera:hover {
  background: #ff5b4f;
  transform: translate(-50%, -50%) scale(1.1);
}

.codes {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.code-block {
  display: flex;
  flex-direction: column;
  width: 48%;
  align-items: stretch;
  overflow: hidden;
  transition: all 0.3s ease;
}

.code-input {
  padding: 10px;
  font-size: 1.1em;
  border: 1px solid var(--border);
  text-align: center;
  border-radius: 10px;
  transition: border-radius 0.3s ease;
}

.code-input.active {
  border-radius: 10px 10px 0 0;
}

.code-input:focus {
  outline: none;
  border-color: var(--accent);
}

.scan-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1em;
  border-radius: 0 0 10px 10px;
  cursor: pointer;
  transform-origin: top;
  transform: scaleY(0);
  opacity: 0;
  height: 0;
  margin: 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease,
    height 0.3s ease,
    margin 0.3s ease;
}

.scan-btn.visible {
  transform: scaleY(1);
  opacity: 1;
  height: 42px;
}

.scan-btn:hover {
  background: #ff594a;
}

.button-row {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  transition: margin-top 0.3s ease;
}

#searchBtn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 20px;
  font-size: 1.1em;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

#searchBtn:hover {
  background: #ff594a;
}

/* ===== FULLSCREEN SLIDE MENU ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 420px;
  /* background: var(--card-bg); */
  padding: 10px 20px;
  /* border-radius: 15px; */
  /* box-shadow: 0 3px 8px rgba(0,0,0,0.1); */
  margin-bottom: 20px;
  position: relative;
  z-index: 20;
}

.hamburger {
  font-size: 1.8em;
  cursor: pointer;
  color: var(--accent);
  user-select: none;
  transition: transform 0.3s;
  background: var(--card-bg);
  border-radius: 15px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  padding: 3px 8px;
}

.hamburger:active {
  transform: scale(0.9);
}

/* Overlay behind the menu */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9;
}

/* Side menu container */
.side-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--card-bg);
  box-shadow: 2px 0 15px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  /* padding: 80px 20px; */
  transition: left 0.3s ease;
  z-index: 40;
}

.side-menu.show {
  left: 0;
}

.menu-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.side-menu h2 {
  margin-bottom: 40px;
  color: var(--accent);
  font-size: 1.6em;
}

.side-menu a {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 14px 0;
  font-size: 1.2em;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s, color 0.2s;
}

.side-menu a:hover {
  background: var(--accent);
  color: #fff;
}

.close-menu {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2em;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
}
/* ===== SECTION TITLE ===== */
.section-title {
  text-align: center;
  color: var(--accent);
  margin-bottom: 15px;
  font-size: 1.4em;
  font-weight: 600;
  padding-bottom: 5px;
}
#logo {
  cursor: pointer;
  width: 100px;
}

#result {
  text-align: center;
  margin-top: 20px;
}

#result div {
  position: relative; /* konieczne, by badge mogło się pozycjonować względem tego elementu */
  display: inline-block;
}

#result img {
  width: 150px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  margin-top: 10px;
  display: block;
}

.badge {
  position: absolute;
  top: 44px;
  right: -4px;
  background-color: #ff5555;
  color: white;
  padding: 5px 16px;
  font-size: 10px;
  font-weight: bold;
  transform: rotate(45deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  pointer-events: none; /* żeby nie blokowała kliknięć na obrazku */
}

/* Ścięte rogi */
.badge::before,
.badge::after {
  content: "";
  position: absolute;
  top: 0;
  width: 25px;
  height: 100%;
  background: inherit;
}

.badge::before {
  left: -11px;
  transform: skewX(-45deg);
  transform-origin: left;
}

.badge::after {
  right: -11px;
  transform: skewX(45deg);
  transform-origin: right;
}