/* fonts.css sa linkuje priamo v HTML (cez asset() = cache busting);
   @import by verziu nedostal a drzal by sa stareho suboru v cache. */

/* Dark monochrome vizual ladeny s michalnovotny.com. Font: Space Grotesk (OFL, self-hosted). */
:root {
  --bg: #0a0a0b;
  --card: #141417;
  --card-2: #1c1c20;      /* inputy, jemne odlisene plochy */
  --text: #f4f4f5;
  --muted: #8b8b93;
  --border: #2a2a31;
  --border-strong: #4a4a52; /* focus / aktivny outline */
  --primary: #ffffff;      /* akcent = biela (focus, range, aktivne stavy) */
  --primary-press: #d8d8dc;
  --inverse-fg: #0a0a0b;   /* text na bielom tlacidle */
  /* funkcne farby (alerty) - tlmene, citatelne na tmavom */
  --danger: #ff7367;
  --warn-bg: #2a2410;
  --warn-border: #5c4a1e;
  --warn-fg: #e8c778;
  --ok-bg: #12241a;
  --ok-border: #2f6b48;
  --ok-fg: #86d3a6;
  --radius: 0;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
input, button, select, textarea { font-family: inherit; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.brand { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.topright { display: flex; align-items: center; gap: 16px; }
.logout { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.logout:hover { color: var(--text); text-decoration: underline; }
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--warn-fg);
  background: transparent; border: 1px solid var(--warn-border);
  padding: 3px 9px; border-radius: 0;
}

/* prihlasovacia stranka: uzsia karta, fotka vpravo, formular vertikalne na stred */
.layout.login-layout { align-items: center; min-height: calc(100vh - 160px); }
.layout.login-layout .card { flex: 0 0 480px; }

.wrap { max-width: 1400px; margin: 40px auto; padding: 0 18px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 0;
  padding: 26px; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}

/* formular vlavo, fotka Michala vpravo */
.layout { display: flex; gap: 40px; align-items: flex-start; }
.layout .card { flex: 0 0 820px; max-width: 100%; }
/* fotka ma FIXNU vysku (nezavisi od vysky formulara - nezvacsi sa pri vlozeni obrazka);
   sticky ju drzi v zabere aj pri scrollovani dlheho formulara */
.hero-photo {
  flex: 1 1 auto; min-width: 0; overflow: hidden;
  height: 86vh; position: sticky; top: 40px;
  display: flex; align-items: stretch;
}
.hero-photo img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: 84% center; /* Michal je v pravej casti fotky */
}
@media (max-width: 1000px) {
  .layout { display: block; }
  .hero-photo { display: none; } /* na uzkych obrazovkach fotku skryjeme */
}
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.025em; margin: 0 0 6px; }
.cardhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
/* Vycistit formular - tlacidlo s ikonou (kos) a sivym ramikom */
.btn-reset {
  flex: 0 0 auto; margin-top: 6px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 13px; font-size: 13px; font-weight: 600;
  color: var(--muted); background: transparent; border: 1px solid var(--border); cursor: pointer;
  transition: color .12s, border-color .12s;
}
.btn-reset:hover { color: var(--text); border-color: var(--border-strong); }
.btn-reset svg { width: 15px; height: 15px; flex: 0 0 auto; }
.formhead { display: flex; align-items: center; justify-content: space-between; }
.chip {
  font-size: 12px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--border); border-radius: 0; padding: 3px 10px;
}

.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 16px 0 6px; }
/* cervena hviezdicka = povinne pole */
.req { color: var(--danger); font-weight: 700; }
.reqhint { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
input[type=text], input[type=url], input[type=date], input[type=password] {
  width: 100%; padding: 12px 14px; font-size: 15px; color: var(--text);
  background: var(--card-2); border: 1px solid var(--border); border-radius: 0; outline: none;
}
input::placeholder { color: #5c5c64; }
input:focus { border-color: var(--border-strong); }
input[type=date] { color-scheme: dark; }
.row { display: flex; gap: 14px; }
.col { flex: 1; min-width: 0; }

/* vlastny autocomplete pre Tag (ukotveny pod inputom) */
.autocomplete { position: relative; }
.ac-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  margin: 0; padding: 4px; list-style: none;
  background: var(--card-2); border: 1px solid var(--border); border-radius: 0;
  max-height: 220px; overflow-y: auto; box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.ac-item { padding: 8px 11px; border-radius: 0; cursor: pointer; font-size: 14px; }
.ac-item:hover, .ac-item.active { background: var(--primary); color: var(--inverse-fg); }

/* riadky nazvov: input + select zdrojoveho jazyka + tlacidlo Prelozit */
.nameline { display: flex; gap: 8px; align-items: center; }
.nameline input { flex: 1; min-width: 0; }
.srcsel {
  flex: 0 0 auto; padding: 12px 8px; font-size: 13px; font-weight: 600;
  color: var(--text); background: var(--card-2); border: 1px solid var(--border);
  border-radius: 0; cursor: pointer; outline: none;
}
.srcsel:focus { border-color: var(--border-strong); }
/* Prelozit = utilitne tlacidlo (ghost), aby netromflo hlavne CTA */
.tbtn {
  flex: 0 0 auto; min-width: 96px; padding: 12px 14px; font-size: 14px; font-weight: 600;
  color: var(--text); background: transparent; border: 1px solid var(--border);
  border-radius: 0; cursor: pointer; transition: background .12s, border-color .12s;
}
.tbtn:hover:not(:disabled) { background: var(--card-2); border-color: var(--border-strong); }
.tbtn:disabled { opacity: .4; cursor: default; }
.rowmsg { font-size: 12px; margin: 5px 0 0; }
.rowmsg.ok { color: var(--muted); }
.rowmsg.err { color: var(--danger); }

/* info ikonka + tooltip pri Nacitat */
.infowrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.infobtn {
  width: 26px; height: 26px; flex: 0 0 auto; align-self: center;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  font-weight: 700; font-size: 13px; font-style: italic; cursor: pointer; padding: 0;
}
.infobtn:hover { color: var(--text); border-color: var(--border-strong); }
.tooltip {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 270px;
  padding: 11px 13px; background: var(--card-2); border: 1px solid var(--border-strong);
  color: var(--text); font-size: 12px; font-weight: 400; font-style: normal; line-height: 1.55;
  box-shadow: 0 12px 32px rgba(0,0,0,.55);
}
.tooltip strong { font-weight: 600; }

/* vyber typu - aktivny je outlined highlight (ako aktivny tab na jeho webe) */
.segmented { display: flex; gap: 8px; }
.segmented button {
  flex: 1; padding: 14px 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  transition: color .12s, border-color .12s, background .12s;
}
.segmented button:hover { color: var(--text); border-color: var(--border-strong); }
.segmented button svg { width: 20px; height: 20px; flex: 0 0 auto; }
.segmented button.active { background: var(--card-2); color: var(--text); border-color: var(--border-strong); }

/* tlacidla: spolocny tvar */
button.primary, button.ghost, button.success {
  margin-top: 18px; padding: 18px 20px; font-size: 15px; font-weight: 600;
  border-radius: 0; cursor: pointer; border: 1px solid transparent;
  line-height: 1.2; transition: background .12s, border-color .12s, opacity .12s;
}
/* biele inverzne = hlavne CTA (Prihlasit, Publikovat, Pridat dalsi, modal OK) */
button.primary, button.success { background: var(--primary); color: var(--inverse-fg); width: 100%; }
button.primary:hover, button.success:hover { background: var(--primary-press); }
button.primary:disabled, button.success:disabled { opacity: .45; cursor: default; }
/* ghost = sekundarne (Koncept) */
button.ghost { background: transparent; color: var(--text); border-color: var(--border); }
button.ghost:hover { border-color: var(--border-strong); background: var(--card-2); }
button.ghost:disabled { opacity: .45; cursor: default; }

/* riadok Koncept / Publikovat */
.submitrow { display: flex; gap: 10px; margin-top: 6px; }
.submitrow button { flex: 1 1 0; width: auto; min-width: 0; margin-top: 12px; }
#btnPublish::after { content: "  \2192"; } /* sipka -> ako na jeho CTA */
.submithint { font-size: 11px; color: var(--muted); margin: 8px 0 0; text-align: center; line-height: 1.7; }
.actions { display: flex; gap: 12px; }
.actions .ghost { flex: 0 0 120px; }
.actions .primary { flex: 1; }
.linkbtn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 6px; }
.linkbtn:hover { color: var(--text); text-decoration: underline; }

.dropzone {
  margin-top: 6px; border: 1.5px dashed var(--border); border-radius: 0;
  padding: 26px; text-align: center; color: var(--muted); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.dropzone:hover { border-color: var(--border-strong); }
.dropzone.drag { border-color: var(--text); background: rgba(255,255,255,.04); }
.drophint { font-size: 13px; }

/* cropper 2:3 (pan & zoom do pevneho ramceka) */
.cropper { margin-top: 6px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cropcanvas {
  display: block; background: var(--card-2);
  border: 1px solid var(--border); border-radius: 0;
  cursor: grab; touch-action: none;
}
.cropcanvas.grabbing { cursor: grabbing; }
.zoomrow { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 300px; }
.zoomlbl { font-size: 12px; font-weight: 600; color: var(--muted); }
.zoomrow input[type=range] { flex: 1; accent-color: var(--primary); }
.croptools { display: flex; gap: 14px; }
.imginfo { font-size: 12px; color: var(--muted); margin: 0; }
.cropper .rowmsg { margin: 0; text-align: center; max-width: 340px; }

.warnings {
  background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 0;
  padding: 10px 12px; margin-bottom: 8px; font-size: 13px; color: var(--warn-fg);
}
.warnings ul { margin: 6px 0 0; padding-left: 18px; }
.error { color: var(--danger); font-size: 14px; margin-top: 12px; }

.result { margin-top: 16px; padding: 14px 16px; border-radius: 0; font-size: 14px; }
.result.ok { background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--ok-fg); }
.result.err { background: var(--warn-bg); border: 1px solid var(--danger); color: var(--danger); }
.result button { margin-top: 12px; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.result-actions button, .result-actions .weblink { margin-top: 0; }
.weblink {
  display: inline-flex; align-items: center; padding: 18px 20px; font-size: 14px; font-weight: 600;
  background: var(--primary); color: var(--inverse-fg); border: 1px solid var(--primary); text-decoration: none;
}
.weblink:hover { background: var(--primary-press); }
.result pre {
  margin: 8px 0 0; padding: 10px; background: #0d0d0f; border: 1px solid var(--border);
  border-radius: 0; overflow-x: auto; font-size: 12px; max-height: 260px; color: var(--text);
}

.hidden { display: none !important; }

/* potvrdzovaci modal pred zapisom */
.modal {
  position: fixed; inset: 0; z-index: 50; padding: 20px;
  background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center;
}
.modalcard {
  width: 100%; max-width: 460px; max-height: 85vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 0;
  padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.modalcard h2 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 14px; }
.modalbody { font-size: 13px; }
.cmrow { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cmrow span { flex: 0 0 84px; color: var(--muted); }
.cmrow b { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.cmthumb {
  display: block; margin: 12px auto 0; width: 100px; height: 150px; object-fit: cover;
  border-radius: 0; border: 1px solid var(--border);
}
.modalwarn {
  font-size: 13px; margin: 14px 0 0; padding: 10px 12px; border-radius: 0;
  background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-fg);
}
.modalactions { display: flex; gap: 10px; margin-top: 18px; }
.modalactions button { flex: 1 1 0; width: auto; margin-top: 0; }

.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff;
}
.spinner {
  width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
