/* minut.sk — Záznamy (Pro countdown log) page.
   Builds on style.css (vars) and admin.css (layout, table). */

/* /zaznam reuses the shared admin-body layout: the body fills the viewport
   (its background + scrollbar span the whole width) and the .admin-shell card
   is centered at ~1080px — exactly like the /account and /admin pages. So we
   deliberately DON'T cap the body width here (that left a dead band + an
   inset scrollbar on wide screens). Vertical scroll: .admin-body{overflow:auto}. */

/* The hidden attribute must win over class display rules (e.g. .z-howto-reopen). */
[hidden] { display: none !important; }

/* Shared building blocks (mirrors the inline styles used on /admin). */
.panel {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px; padding: 1.1rem 1.3rem; margin-bottom: 1.4rem;
}
.panel h3 { font-size: 1rem; margin: 0 0 0.7rem; font-weight: 600; }

.btn-fill {
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 0.7rem 1.4rem; font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.btn-fill:hover { filter: brightness(1.08); }
.btn-fill:disabled { opacity: 0.5; cursor: default; }
/* When the CTA button is a link (<a class="btn-fill">) it's inline by default,
   so its vertical padding overlaps the paragraph above — make it a proper block. */
a.btn-fill { display: inline-block; text-decoration: none; margin-top: 0.4rem; }

.act {
  font-size: 0.82rem; padding: 0.4rem 0.75rem; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.04);
  color: #cfd5e3; cursor: pointer; transition: background .15s, color .15s;
}
.act:hover { background: rgba(255,255,255,0.1); color: var(--fg); }
.act.warn:hover { background: rgba(255,107,107,0.2); color: #fff; }
/* Compact square icon button (e.g. the row-delete ✕) — keeps the column narrow. */
.act.icon-btn { padding: 0.3rem; width: 1.9rem; line-height: 1; text-align: center; font-size: 0.9rem; }

.msg { font-size: 0.88rem; margin-top: 0.6rem; min-height: 1.1em; }
.msg.ok { color: #5fd38a; }
.msg.error { color: #ff6b6b; }
.sub { color: var(--muted); font-size: 0.88rem; }

/* ---- Upgrade / login CTA ---- */
.z-cta {
  max-width: 560px; margin: 2rem auto; text-align: center;
  background: linear-gradient(180deg, rgba(79,140,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(79,140,255,0.2);
  border-radius: 18px; padding: 2.4rem 1.8rem;
  box-shadow: 0 14px 46px rgba(0,0,0,0.28);
}
.z-cta h2 { font-size: 1.4rem; margin: 0.7rem 0 1.1rem; line-height: 1.3; }
.z-features { list-style: none; padding: 0; margin: 1.2rem 0; text-align: left;
  display: inline-block; color: #dbe0ec; }
.z-features li {
  padding: 0.4rem 0.2rem; font-size: 0.96rem; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.z-features li:last-child { border-bottom: none; }
.z-price { font-size: 1.5rem; font-weight: 700; margin: 0.6rem 0 1.2rem; }
/* Free-trial highlight box above the plan buttons. */
.z-trial {
  display: flex; align-items: center; gap: 0.8rem;
  max-width: 30rem; margin: 1.4rem auto 0.5rem;
  text-align: left;
  background: linear-gradient(120deg, rgba(79,140,255,0.16), rgba(120,90,255,0.14));
  border: 1px solid rgba(79,140,255,0.42);
  border-radius: 14px; padding: 0.8rem 1.1rem;
  box-shadow: 0 6px 22px rgba(79,140,255,0.16);
}
.z-trial-icon {
  flex: 0 0 auto; font-size: 1.5rem; line-height: 1;
  filter: drop-shadow(0 0 8px rgba(120,140,255,0.55));
}
.z-trial-text { display: flex; flex-direction: column; gap: 0.15rem; }
.z-trial-text b {
  color: #eaf1ff; font-weight: 800; font-size: 1.05rem; line-height: 1.3;
  letter-spacing: 0.01em;
}
.z-trial-sub { color: #b6c6e6; font-size: 0.88rem; line-height: 1.4; }
.z-trial-note { max-width: 34rem; margin: 1.3rem auto 0; line-height: 1.5; }
.z-plans { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; margin: 1.8rem 0 0.4rem; }
.plan-btn { padding: 0.72rem 1.5rem; border-radius: 999px; font-size: 0.98rem; }
.plan-btn.plan-year {
  background: rgba(255, 255, 255, 0.06); color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.plan-btn.plan-year:hover { background: rgba(255, 255, 255, 0.12); }
.pro-badge {
  display: inline-block; background: linear-gradient(135deg, #ffb347, #ff7b54);
  color: #1a1a1a; font-weight: 800; font-size: 0.78rem; letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem; border-radius: 999px;
}

/* ---- How it works (onboarding) ---- */
.z-howto { border-color: rgba(79,140,255,0.35);
  background: linear-gradient(180deg, rgba(79,140,255,0.09), rgba(255,255,255,0.03)); }
.z-howto-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.z-howto-head h3 { margin: 0; }
.z-howto-close {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.82rem; padding: 0.2rem 0.4rem; border-radius: 6px;
}
.z-howto-close:hover { color: var(--fg); background: rgba(255,255,255,0.08); }
.z-steps {
  list-style: none; margin: 1rem 0 0.4rem; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.9rem;
}
.z-step { display: flex; gap: 0.7rem; align-items: flex-start; }
.z-step-num {
  flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 0.95rem;
  background: var(--accent); color: #fff;
}
.z-step b { display: block; margin-bottom: 0.15rem; font-size: 0.95rem; }
.z-step p { margin: 0; font-size: 0.85rem; color: #cfd5e3; line-height: 1.45; }
.z-howto-tip { margin: 0.9rem 0 0; font-size: 0.85rem; color: #cfd5e3;
  background: rgba(255,255,255,0.05); border-radius: 8px; padding: 0.55rem 0.7rem; }
.z-howto-reopen { display: inline-flex; margin: -0.6rem 0 1.4rem; }

/* Inline explanatory hints */
.z-hint { margin: -0.2rem 0 0.9rem; font-size: 0.86rem; color: var(--muted); line-height: 1.5; max-width: 70ch; }
.z-field-hint { color: var(--muted); font-size: 0.72rem; }
.z-log-head { margin-bottom: 0.6rem; }
.z-log-head h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.z-log-head .z-hint { margin: 0; }

/* ---- Stats panel ---- */
.z-stats-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.z-stats-head h3 { margin: 0; }
.z-stat-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin: 0.9rem 0;
}
.z-stat {
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 0.8rem; display: flex; flex-direction: column; gap: 0.2rem;
}
.z-stat-num { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.z-stat-lbl { color: var(--muted); font-size: 0.8rem; }
.z-chart {
  display: flex; align-items: flex-end; gap: 3px; height: 90px; margin: 0.4rem 0 0.2rem;
}
.z-bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%;
  justify-content: flex-end; min-width: 0; }
.z-bar-fill {
  width: 100%; max-width: 22px; min-height: 2px; border-radius: 3px 3px 0 0;
  background: var(--accent); opacity: 0.85;
}
.z-bar:hover .z-bar-fill { opacity: 1; }
.z-bar-lbl { font-size: 0.62rem; color: var(--muted); margin-top: 3px; }
.z-proj-stats { margin-top: 0.8rem; display: flex; flex-direction: column; gap: 0.3rem; }
.z-proj-row {
  display: flex; justify-content: space-between; gap: 1rem; font-size: 0.88rem;
  padding: 0.3rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.z-proj-row:last-child { border-bottom: none; }
.z-proj-val { color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.z-stats-note { margin: 0.7rem 0 0; font-size: 0.76rem; color: var(--muted); }

/* ---- Settings panel ---- */
.z-settings-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem;
}
.z-field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.z-field.z-toggle { flex-direction: row; align-items: center; gap: 0.55rem; color: #cfd5e3; }
.z-field select, .z-field input[type="text"], .z-field input[type="date"], .z-field input[type="number"] {
  background: var(--bg); color: var(--fg); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px; padding: 0.5rem 0.6rem; font-size: 0.9rem;
}

/* ---- Projects ---- */
.z-projects { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.8rem; }
.z-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px; padding: 0.3rem 0.4rem 0.3rem 0.8rem; font-size: 0.86rem;
}
.z-chip button {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.07); border: none; cursor: pointer;
  color: #cfd5e3; line-height: 1; width: 1.5rem; height: 1.5rem;
  border-radius: 50%; padding: 0; transition: background 0.15s, color 0.15s;
}
.z-chip .z-chip-bg svg { width: 14px; height: 14px; fill: currentColor; display: block; }
.z-chip .z-chip-bg:hover { background: var(--accent); color: #fff; }
.z-chip .z-chip-del { font-size: 1.05rem; }
.z-chip .z-chip-del:hover { background: rgba(255, 107, 107, 0.85); color: #fff; }
.z-newproj { display: flex; gap: 0.5rem; }
.z-newproj input {
  flex: 1; max-width: 280px; background: var(--bg); color: var(--fg);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 8px; padding: 0.5rem 0.7rem;
}

/* ---- Filters + log table ---- */
.z-filters {
  display: flex; flex-wrap: wrap; align-items: end; gap: 0.7rem 1rem; margin-bottom: 1rem;
}
.z-filters label { display: flex; flex-direction: column; gap: 0.3rem;
  font-size: 0.78rem; color: var(--muted); }
.z-filters input, .z-filters select {
  background: var(--bg); color: var(--fg); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px; padding: 0.45rem 0.55rem; font-size: 0.88rem;
}
.z-filters input.num { width: 70px; }
/* The min–max pair sits on one line ("od – do"), not stacked. */
.z-filters .z-range { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); }
.z-filters > .act { align-self: end; }

#logTable td.note-cell { white-space: normal; min-width: 160px; max-width: 280px; color: #cfd5e3; }
#logTable .note-input {
  width: 100%; background: var(--bg); color: var(--fg);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; padding: 0.3rem 0.45rem;
  font-size: 0.85rem;
}
#logTable select.row-project {
  background: var(--bg); color: var(--fg); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; padding: 0.3rem 0.4rem; font-size: 0.83rem;
}
.status-completed { color: #5fd38a; }
.status-running { color: var(--accent); }
.status-aborted { color: var(--muted); }

/* ---- Responsive ---- */

/* ≤720px: 16px form controls — anything smaller makes iOS Safari auto-zoom
   the whole page on focus, which is the single most jarring mobile bug. */
@media (max-width: 720px) {
  .z-filters input, .z-filters select,
  .z-field select, .z-field input[type="text"], .z-field input[type="date"], .z-field input[type="number"],
  .z-newproj input,
  #logTable .note-input, #logTable select.row-project { font-size: 1rem; }
  .z-filters input.num { width: 84px; }
}

/* Phone: filters become a tidy 2-col grid instead of a ragged wrap; the three
   stat cards stay side-by-side (comparison at a glance) but compact. */
@media (max-width: 560px) {
  .panel { padding: 0.9rem 0.95rem; margin-bottom: 1rem; }
  .z-cta { padding: 1.6rem 1.1rem; }
  .z-stat-cards { gap: 0.5rem; }
  .z-stat { padding: 0.6rem 0.65rem; }
  .z-stat-num { font-size: 1.15rem; }
  .z-filters { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
  .z-filters label { min-width: 0; }
  .z-filters input:not(.num), .z-filters select { width: 100%; }
  .z-filters .z-range input.num { flex: 1; width: auto; min-width: 0; }
  .z-filters > .act { width: 100%; }
  .z-newproj input { max-width: none; }
  .z-chart { height: 70px; }
  .z-bar-lbl { font-size: 0.56rem; }
}

/* ---- Toast (same as /admin) ---- */
.toast {
  position: fixed; left: 50%; bottom: 1.3rem; transform: translateX(-50%) translateY(2rem);
  background: #1b2030; color: var(--fg); padding: 0.7rem 1.1rem; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; font-size: 0.9rem; z-index: 50; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: rgba(80,200,120,0.55); }
.toast.err { border-color: rgba(255,107,107,0.65); }
