/* =========================
   ZÁKLAD
   ========================= */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #172554 0, #020617 45%, #020617 100%);
  color: #f0f4fa;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

/* jemné glow pozadí (stejné jako dashboard) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 0%, rgba(56,189,248,0.12), transparent 55%),
    radial-gradient(circle at 90% 20%, rgba(94,234,212,0.08), transparent 55%);
  z-index: -1;
}

/* kontejner */
.page {
  width: 100%;
  max-width: 1100px;
}

/* =========================
   HEADER
   ========================= */
.header {
  text-align: center;
  margin-bottom: 18px;
}

.header h1 {
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.header h1::before {
  content: "";
  width: 8px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3b82f6, #22c55e);
}

.subtitle {
  margin: 0;
  color: rgba(226,232,240,0.72);
  font-size: 0.95rem;
}

/* =========================
   LAYOUT (2 panely)
   ========================= */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

/* =========================
   KARTY (stejné jako dashboard)
   ========================= */
.card {
  background: radial-gradient(circle at 0 0, rgba(148,163,184,0.22), rgba(15,23,42,0.98));
  border: 1px solid rgba(148,163,184,0.35);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow:
    0 18px 45px rgba(15,23,42,0.95),
    0 0 0 1px rgba(15,23,42,0.85) inset;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  opacity: 0.22;
  background: radial-gradient(circle at 0 0, rgba(56,189,248,0.48), transparent 55%);
  pointer-events: none;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.help-text {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: rgba(226,232,240,0.7);
}

/* =========================
   FORM
   ========================= */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.form-group label {
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: rgba(226,232,240,0.85);
}

.form-group input {
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.35);
  padding: 9px 12px;
  font-size: 0.95rem;
  background: rgba(2,6,23,0.85);
  color: #f0f4fa;
  outline: none;
  box-shadow: 0 0 0 1px rgba(15,23,42,0.65) inset;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.form-group input:focus {
  border-color: rgba(59,130,246,0.75);
  box-shadow:
    0 0 0 1px rgba(59,130,246,0.35),
    0 0 0 4px rgba(59,130,246,0.18);
  transform: translateY(-1px);
}

/* =========================
   TLAČÍTKA (pill + glow)
   ========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.35);
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: inherit;
  background: radial-gradient(circle at 30% 0%, rgba(248,250,252,0.16), transparent);
  box-shadow: 0 0 0 1px rgba(15,23,42,0.8), 0 10px 25px rgba(15,23,42,0.75);
  transition: transform 0.1s ease-out, box-shadow 0.15s ease-out, background 0.15s ease-out, border-color 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
  background: radial-gradient(circle at 20% 0%, rgba(248,250,252,0.24), rgba(15,23,42,0.65));
  border-color: rgba(248,250,252,0.35);
  box-shadow: 0 12px 30px rgba(15,23,42,0.9);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(15,23,42,0.85);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* primární = gradient jako tab.active */
.btn.primary {
  border: none;
  background: linear-gradient(135deg, #3b82f6, #22c55e);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(37,99,235,0.55);
}

.btn.primary:hover {
  box-shadow: 0 14px 30px rgba(37,99,235,0.7);
}

/* secondary */
.btn.secondary {
  background: rgba(15,23,42,0.7);
}

/* řádek tlačítek */
.button-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

/* =========================
   STATUS TEXT
   ========================= */
.status-text {
  min-height: 1.2em;
  margin-top: 10px;
  font-size: 0.85rem;
}

.status-text.ok { color: #bbf7d0; }
.status-text.error { color: #fecaca; }

/* =========================
   VIDEO (karta styl)
   ========================= */
.video-wrapper {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(2,6,23,0.75);
  max-width: 720px;
  margin: 0 auto 14px;
  box-shadow:
    0 18px 45px rgba(15,23,42,0.95),
    0 0 0 1px rgba(15,23,42,0.85) inset;
}

#video {
  display: block;
  width: 100%;
  height: auto;
}

#canvas { display: none; }

.results {
  min-height: 1.2em;
  font-size: 0.9rem;
  color: #e5e7eb;
  text-align: center;
}

/* =========================
   SVĚTLÝ REŽIM (stejné jako dashboard)
   ========================= */
body.light {
  background: radial-gradient(circle at top, #f9fafb 0, #d1d5db 45%, #d1d5db 100%);
  color: #111827;
}

body.light::before {
  background:
    radial-gradient(circle at 10% 0%, rgba(59,130,246,0.18), transparent 50%),
    radial-gradient(circle at 90% 20%, rgba(34,197,94,0.14), transparent 55%);
}

body.light .subtitle,
body.light .help-text {
  color: rgba(17,24,39,0.7);
}

body.light .card {
  background: radial-gradient(circle at 0 0, rgba(219,234,254,0.9), #e5e7eb);
  border-color: rgba(148,163,184,0.7);
  box-shadow:
    0 10px 24px rgba(15,23,42,0.18),
    0 0 0 1px rgba(148,163,184,0.4) inset;
}

body.light .card::before {
  background: radial-gradient(circle at 0 0, rgba(59,130,246,0.24), transparent 55%);
}

body.light .form-group input {
  background: rgba(255,255,255,0.9);
  color: #111827;
  border-color: rgba(148,163,184,0.7);
  box-shadow: 0 0 0 1px rgba(148,163,184,0.35) inset;
}

body.light .btn {
  background: radial-gradient(circle at 30% 0%, rgba(255,255,255,0.9), rgba(226,232,240,0.9));
  border-color: rgba(148,163,184,0.8);
  box-shadow: 0 6px 18px rgba(148,163,184,0.7);
}

body.light .btn:hover {
  background: radial-gradient(circle at 20% 0%, rgba(255,255,255,0.95), rgba(226,232,240,0.95));
}
