/*
 * Theme Name: rrudner
 * Author: rrudner
 * Version: 1.0
 */

@import url('https://fonts.googleapis.com/css?family=Saira&display=swap');

html {
  font-size: 16px;
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Saira', sans-serif;
  color: white;
  background-color: #141414;
  height: 100%;
  overflow-x: hidden;
  font-size: 1rem;
  line-height: 1.6;
  overscroll-behavior: none;
}

/* Animowane tło */
.bg {
  animation: slide 3s ease-in-out infinite alternate;
  background-image: linear-gradient(-60deg, rgb(157, 0, 0) 50%, rgb(20, 20, 20) 50%);
  bottom: 0;
  left: -50%;
  opacity: .5;
  position: fixed;
  right: -50%;
  top: 0;
  z-index: -1;
}

.bg2 {
  animation-direction: alternate-reverse;
  animation-duration: 4s;
}

.bg3 {
  animation-duration: 5s;
}

@keyframes slide {
  0% { transform: translateX(-25%); }
  100% { transform: translateX(25%); }
}

/* Header */
header {
  position: sticky;
  top: 0;
  background-color: black;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.logo-container {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-image {
  height: 2rem;
  width: auto;
}

.site-name {
  font-weight: 900;
  font-size: 1.5rem;
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

.logo-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-link:hover .site-name {
  color: rgb(157, 0, 0);
}

/* Nav — desktop */
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: rgb(157, 0, 0);
}

/* Nav — mobile */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    gap: 10px;
    padding: 12px 15px;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }

  .site-name {
    font-size: 1.2rem;
  }

  .logo-image {
    height: 1.5rem;
  }
}

/* Main content */
main {
  position: relative;
  min-height: 100vh;
  padding: 20px;
}

.content {
  background-color: rgba(0, 0, 0, .6);
  border-radius: 1.5em;
  box-shadow: 0 0 .25em rgba(0, 0, 0, .25);
  box-sizing: border-box;
  padding: 10vmin;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.6;
}

.content h1, .content h2 {
  margin: 0;
}

.content h1 {
  font-size: 2.5rem;
  font-weight: 900;
}

.content h2 {
  font-size: 1.75rem;
  font-weight: 700;
}

.content article {
  margin-bottom: 20px;
}

.content article h2 a {
  color: white;
  text-decoration: none;
  transition: color 0.4s;
}

.content article h2 a:hover {
  color: rgb(157, 0, 0);
}

.entry-content {
  font-size: 1rem;
  line-height: 1.6;
}

/* Sidebar */
aside#sidebar {
  background-color: rgba(0, 0, 0, .6);
  border-radius: 1em;
  padding: 15px;
  max-width: 300px;
  margin: 20px auto;
  font-size: 1rem;
  line-height: 1.6;
}

/* Footer */
footer {
  background-color: rgba(0, 0, 0, .6);
  padding: 10px;
  text-align: center;
  position: relative;
  bottom: 0;
  width: 100%;
  font-size: 1rem;
  line-height: 1.6;
  color: white;
}

/* Button */
.button, .read-more {
  border: none;
  border-radius: 10px;
  color: white;
  padding: 1em 2em;
  min-width: 10em;
  text-align: center;
  text-decoration: none;
  font-size: 1rem;
  margin: 0.25em;
  transition-duration: 0.4s;
  cursor: pointer;
  background-color: rgb(0, 0, 0);
  box-shadow: none;
}

.button:hover, .read-more:hover {
  background-color: rgb(157, 0, 0);
  color: white;
}

.inline {
  display: inline-flex;
}

/* Responsywność */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100vw;
  }

  footer {
    font-size: 0.75rem;
  }

  .content {
    padding: 5vmin;
  }

  .content h1 {
    font-size: 2rem;
  }

  .content h2 {
    font-size: 1.25rem;
  }
}

/* ── QR App wrapper ── */
#qr-app {
max-width: 480px;
margin: 2rem auto;
display: flex;
flex-direction: column;
align-items: center;
gap: 1.25rem;
}

/* ── Tabs ── */
.qr-tabs {
  display: flex;
  gap: 0.5rem;
}

.qr-tabs .button {
  opacity: 0.55;
  transition: opacity 0.3s, background-color 0.3s;
}

.qr-tabs .button.active {
  opacity: 1;
  background-color: rgb(157, 0, 0);
}

/* ── Zakładki ── */
#tab-gen,
#tab-scan {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
}

/* ── Pole tekstowe ── */
#qr-txt {
width: 100%;
box-sizing: border-box;
padding: 0.75em 1em;
border-radius: 10px;
border: 2px solid transparent;
background-color: rgba(255, 255, 255, 0.08);
color: white;
font-family: 'Saira', sans-serif;
font-size: 1rem;
outline: none;
transition: border-color 0.3s, background-color 0.3s;
}

#qr-txt::placeholder {
color: rgba(255, 255, 255, 0.4);
}

#qr-txt:focus {
border-color: rgb(157, 0, 0);
background-color: rgba(255, 255, 255, 0.12);
}

/* ── Kontener QR kodu ── */
#qr-out:empty {
display: none;
}

#qr-out {
display: flex;
justify-content: center;
align-items: center;
background-color: white;
border-radius: 12px;
padding: 1rem;
min-width: 332px;
min-height: 332px;
}

#qr-out img,
#qr-out canvas {
display: block;
max-width: 100%;
height: auto;
}

/* ── Czytnik QR — pełny reset inline stylów biblioteki ── */
#qr-reader {
width: 100% !important;
max-width: 340px !important;
border-radius: 12px;
overflow: hidden;
background-color: black;
box-sizing: border-box !important;
padding: 0 !important;
margin: 0 auto !important;
}

#qr-reader * {
box-sizing: border-box !important;
}

#qr-reader__scan_region {
position: relative !important;
width: 100% !important;
left: auto !important;
right: auto !important;
margin: 0 !important;
padding: 0 !important;
display: flex !important;
justify-content: center !important;
align-items: center !important;
overflow: hidden !important;
}

#qr-reader__scan_region video {
display: block !important;
width: 100% !important;
max-width: 340px !important;
height: auto !important;
margin: 0 !important;
left: 0 !important;
position: relative !important;
transform: none !important;
object-fit: cover;
border-radius: 8px;
}

#qr-reader__scan_region canvas {
display: none !important;
}

#qr-reader__scan_region img {
display: block !important;
width: 100% !important;
height: auto !important;
margin: 0 !important;
}

#qr-reader__dashboard {
width: 100% !important;
text-align: center;
padding: 0.5rem 0;
font-size: 0.85rem;
color: rgba(255, 255, 255, 0.6);
}

#qr-reader__dashboard_section_csr button,
#qr-reader__dashboard_section_swaplink {
display: none !important;
}

/* ── Wynik skanowania ── */
#scan-result {
width: 100%;
background-color: rgba(0, 0, 0, 0.6);
border-radius: 10px;
padding: 1em;
text-align: center;
word-break: break-all;
}

#scan-txt {
margin: 0.5em 0;
font-size: 1rem;
color: white;
}

/* ── Rząd przycisków ── */
.qr-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* ── Przycisk główny (primary) ── */
.button--primary {
  background-color: rgb(157, 0, 0);
}

.button--primary:hover {
  background-color: rgb(200, 0, 0);
}

/* ── QR mobilka ── */
@media (max-width: 520px) {
  #qr-app {
  margin: 1rem auto;
  padding: 0 0.5rem;
  }

  #qr-out {
  min-width: 0;
  min-height: 0;
  width: 100%;
  padding: 0.75rem;
  }

  #qr-reader {
  max-width: 100% !important;
  }

  #qr-txt {
  font-size: 0.95rem;
  }

  .button {
    padding: 0.75em 1.25em;
    font-size: 0.9rem;
    min-width: 0;
  }
}
