/* === ZÁKLADNÍ NASTAVENÍ === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  transition: background-color 0.6s ease, color 0.6s ease;
}

body {
  background-color: #151b28;
  color: #e5e7eb;
  overflow-x: hidden;
}

/* === HLAVIČKA - SJEDNOCENÁ S HLAVNÍM GENERÁTOREM === */
.site-header {
  position: relative;
  background: url("https://www.onlinevyuka.fun/generatorqr/assets/img/header.png") center center / cover no-repeat;
  color: #fff;
  padding: 80px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: background-color 0.6s ease, color 0.6s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: brightness(0.9);
  z-index: 1;
}

.header-inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  position: relative;
}

/* === Logo === */
.site-header img.site-logo {
  width: 220px;
  height: auto;
  margin-bottom: 14px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  transition: transform 0.3s ease, filter 0.6s ease;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.site-header img.site-logo:hover {
  transform: scale(1.05);
}

.site-header h1 {
  font-size: 1.9rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  transition: color 0.6s ease;
  margin: 10px 0;
}

.site-header .subtitle {
  font-size: 1rem;
  color: #e0e7ff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  transition: color 0.6s ease;
  margin-top: 5px;
}

/* === TLAČÍTKO ZPĚT === */
.btn-back {
  position: absolute;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff !important;
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(59,130,246,0.4);
  transition: all 0.3s ease;
  z-index: 10;
}

.btn-back:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(59,130,246,0.6);
}

/* === HLAVNÍ OBSAH === */
.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
  padding: 30px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* === FORMULÁŘ === */
.form-section {
  background: #0b0f16;
  color: #f0f0f0;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  padding: 25px;
  width: 100%;
  max-width: 500px;
  transition: background-color 0.6s ease, box-shadow 0.6s ease;
}

label {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
  color: #cbd5e1;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="color"],
input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #1e2535;
  background: #111826;
  color: #f1f5f9;
  margin-top: 4px;
  transition: all 0.3s ease;
}

input:focus {
  border-color: #3b82f6;
  outline: none;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* === TLAČÍTKA === */
.btn {
  display: inline-block;
  padding: 10px 18px;
  margin-top: 15px;
  margin-right: 8px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn.primary {
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn.primary:hover {
  background: linear-gradient(145deg, #2563eb, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59,130,246,0.5);
}

.btn:not(.primary) {
  background: #1e293b;
  color: #fff;
}

.btn:not(.primary):hover {
  background: #334155;
  transform: translateY(-2px);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === NÁHLED VIZITKY === */
.preview-section {
  background: #ffffff;
  color: #111;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  padding: 20px;
  width: 100%;
  max-width: 500px;
  text-align: center;
}

.preview-section h2 {
  font-size: 20px;
  margin-top: 0;
  margin-bottom: 15px;
}

/* === VIZITKA === */
.card {
  background: #f9f9f9;
  border-radius: 16px;
  padding: 15px;
  color: #000;
  width: 100%;
  box-sizing: border-box;
}

.card-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.left img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #eee;
  object-fit: cover;
}

.right {
  flex: 1;
  text-align: left;
  min-width: 180px;
}

.qr-wrap {
  text-align: center;
  margin-top: 10px;
}

/* === PATIČKA - SJEDNOCENÁ S HLAVNÍM GENERÁTOREM === */
.site-footer {
  background: #0f1725;
  color: #94a3b8;
  padding: 30px 20px;
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  transition: background-color 0.6s ease, color 0.6s ease;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-inner p {
  margin: 8px 0;
}

.footer-inner .small {
  font-size: 0.85rem;
  opacity: 0.9;
}

.site-footer a {
  color: #60a5fa;
  text-decoration: none;
  transition: color 0.3s ease;
}

.site-footer a:hover {
  color: #3b82f6;
  text-decoration: underline;
}

/* === SVĚTLÝ REŽIM === */
body.light-mode {
  background-color: #e9eef6;
  color: #1f2937;
}

body.light-mode .site-header::before {
  background: rgba(255,255,255,0.45);
}

body.light-mode .site-header h1,
body.light-mode .site-header .subtitle {
  color: #1a1a1a;
  text-shadow: none;
}

body.light-mode .form-section {
  background-color: #ffffff;
  color: #1a1a1a;
  box-shadow: 0 4px 25px rgba(0,0,0,0.15);
}

body.light-mode input[type="text"],
body.light-mode input[type="email"],
body.light-mode input[type="url"],
body.light-mode input[type="color"],
body.light-mode input[type="file"] {
  background: #f3f4f6;
  color: #111;
  border: 1px solid #cbd5e1;
}

body.light-mode .btn.primary {
  background: #2563eb;
  color: white;
}

body.light-mode .site-footer {
  background: #f3f4f6;
  color: #4b5563;
}

body.light-mode .site-footer a {
  color: #2563eb;
}

body.light-mode .site-footer a:hover {
  color: #1e40af;
}

/* === RESPONSIVNÍ DESIGN - OPRAVA PRO MOBIL === */
@media (max-width: 768px) {
  /* HLAVIČKA - kompletní přepracování pro mobil */
  .site-header {
    padding: 30px 10px;
    width: 100%;
    max-width: 100%;
  }

  .header-inner {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  /* Logo menší pro mobily */
  .site-header img.site-logo {
    width: 160px;
    margin-bottom: 10px;
  }

  .site-header h1 {
    font-size: 1.4rem;
    margin: 8px 0;
  }

  .site-header .subtitle {
    font-size: 0.9rem;
    margin-top: 4px;
  }

  /* Tlačítko Zpět pod hlavičku */
  .btn-back {
    position: relative;
    top: auto;
    right: auto;
    margin-top: 15px;
    width: auto;
    order: 3;
    font-size: 13px;
    padding: 8px 12px;
  }

  /* Hlavní kontejner */
  .container {
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    width: 100%;
  }

  .form-section,
  .preview-section {
    width: 100%;
    max-width: 100%;
    margin: 0 0 20px 0;
    padding: 20px 15px;
  }

  /* Grid pro formulář na 1 sloupec */
  .grid-2 {
    grid-template-columns: 1fr;
  }

  /* Vizitka na mobilu */
  .card-inner {
    flex-direction: column;
    align-items: center;
  }

  .right {
    text-align: center;
  }

  .qr-wrap {
    margin-top: 10px;
  }

  /* Patička */
  .site-footer {
    padding: 20px 15px;
  }

  .footer-inner .small {
    font-size: 0.8rem;
  }
}

/* Extra malé displeje */
@media (max-width: 480px) {
  .site-header {
    padding: 25px 5px;
  }

  .site-header img.site-logo {
    width: 140px;
  }

  .site-header h1 {
    font-size: 1.2rem;
  }

  .site-header .subtitle {
    font-size: 0.85rem;
  }

  .btn-back {
    font-size: 12px;
    padding: 6px 10px;
  }

  .form-section,
  .preview-section {
    padding: 15px 10px;
  }
}

/* === ANIMACE PŘEPNUTÍ REŽIMU === */
body {
  transition: background-color 0.4s ease, color 0.4s ease, filter 0.4s ease;
}

body.light-mode {
  filter: brightness(1);
  transition: background-color 0.4s ease, color 0.4s ease, filter 0.4s ease;
}

body.transitioning {
  transition: none;
  animation: fadeTransition 0.4s ease;
}

@keyframes fadeTransition {
  0%   { opacity: 0; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}