/* RESET */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --bg: #0b0f19;
  --text: #ffffff;
  --muted: #9aa0b1;
  --accent: #4d9fff;
  --accent-soft: rgba(77,159,255,0.18);
  --surface: rgba(18,22,33,0.75);
  --surface-strong: rgba(18,22,33,0.92);
  --radius: 22px;
  --shadow: 0 20px 50px rgba(0,0,0,0.55);
}

/* BG */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", sans-serif;
}

/* HEADER */
.top-bar {
  position: sticky; top: 0; z-index: 50;
  padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(11,15,25,0.7); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* CLICKABLE BRAND */
.brand { display: flex; align-items: center; gap: 8px; }

/* NON-CLICKABLE BRAND TEXT (white, bold, bigger) */
.brand-text {
  font-size: 1.12rem;   /* larger than nav items */
  font-weight: 800;
  color: #ffffff;
  line-height:1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right:6px; /* tiny spacing before nav */
  cursor: default;      /* no click */
  user-select: none;    /* cannot select */
}

.brand-text:hover {
  opacity: 1;           /* no hover effect */
  cursor: default;
}

/* NAVIGATION */
.nav {
  display: flex;
  gap: 3px;      /* reduced spacing */
  margin-left: auto;   /* THIS pushes nav fully to the right */
}

.nav-link {
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* MAIN AREA */
.main {
  padding: 18px;
  max-width: 500px;
  margin: 0 auto;
}

.hero h1 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(to right, #4d9fff, #7ab2ff);
  -webkit-background-clip: text;
  color: transparent;
}

/* SCANNER BOX */
.scanner-card {
  background: var(--surface-strong);
  padding: 20px;
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(14px);
}

.video-wrapper {
  width: 100%;
  aspect-ratio: 3/4;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

#preview {
  width: 100%;
  height: 100%;
}

.scan-border {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 3px solid rgba(77,159,255,0.6);
  animation: glowBorder 2s infinite ease-in-out;
}

@keyframes glowBorder {
  0% { box-shadow: 0 0 10px rgba(77,159,255,0.4); }
  50% { box-shadow: 0 0 28px rgba(77,159,255,0.8); }
  100% { box-shadow: 0 0 10px rgba(77,159,255,0.4); }
}

/* SCANNER CONTROLS */
.controls-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
  gap: 12px;
}

.btn.small {
  padding: 10px 14px;
  background: rgba(255,255,255,0.09);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
}

.btn.small:active { transform: scale(0.95); }

.fab-inline {
  font-size: 1.5rem;
  font-weight: bold;
  background: linear-gradient(135deg, #4d9fff, #1d75ff);
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}

/* RESULT POPUP */
.result-popup {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 85%; max-width: 340px;
  background: rgba(18,22,33,0.95);
  padding: 20px;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
  backdrop-filter: blur(14px);
  z-index: 10000;
  text-align: center;
}

.hidden { display: none; }

.close-btn {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; color: #fff;
  font-size: 1.8rem; cursor: pointer;
}

.result-link {
  margin-top: 10px;
  font-size: 1rem;
  word-break: break-all;
}

.result-link a {
  color: var(--accent);
  text-decoration: underline;
}

.result-actions {
  margin-top: 14px;
  display: flex; justify-content: center; gap: 10px;
}

/* --- QR GENERATOR PAGE --- */

.generator-card {
  background: var(--surface-strong);
  padding: 24px;
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(18px);
  margin-top: 24px;
}

.label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  padding: 12px 14px;
  font-size: 1rem;
  color: white;
  resize: none;
  outline: none;
}

.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(77,159,255,0.4);
}

.generator-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.btn.primary {
  flex: 1;
  padding: 12px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
}

#download-btn {
  flex: 1;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.12);
  color: white;
  backdrop-filter: blur(10px);
}

.qr-output {
  margin-top: 24px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px dashed rgba(255,255,255,0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 240px;
  text-align: center;
}

.qr-output canvas {
  width: 240px !important;
  height: 240px !important;
  display: block;
}

/* FOOTER */
.footer {
  text-align: center;
  margin: 30px 0;
  color: var(--muted);
}