/* =============================================================================
   tv.css — sekce TV PREZENTACE v portálu (tv-admin.js). Prefix tva-.
   Barvy a písma z proměnných styles.css (brand GastroMach).
   Přehrávač na televizi má vlastní styl: tv-player.css.
   ============================================================================= */

/* FCH 1. 10.: .main má overflow hidden → sekce TV si musí skrolovat sama (jako #view-hr) */
#view-tv { flex: 1; min-height: 0; overflow: auto; }
.tva { padding: 18px 22px 28px; display: flex; flex-direction: column; gap: 14px; }
.tva-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tva-spacer { flex: 1; }
.tva-card { background: var(--white); border: 1px solid var(--g1); border-radius: 10px; padding: 14px 16px;
            display: flex; flex-direction: column; gap: 10px; }
.tva-card-title { font-family: var(--head); font-size: 14px; font-weight: 600; }
.tva-meta { font-size: 11.5px; color: var(--g4); }
.tva-b { font-weight: 600; }
.tva-hlaska { padding: 14px 16px; border: 1px dashed var(--g2); border-radius: 10px; background: var(--white);
              color: var(--g4); font-size: 13px; }
.tva-hlaska-chyba { color: var(--red); border-color: var(--red); background: #FCEDED; }
.tva-hlaska .tva-btn { margin-left: 10px; }

/* Tlačítka a pole */
.tva-btn { height: 30px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--g2); background: var(--white);
           color: var(--black); font-family: var(--body); font-weight: 600; font-size: 12px; cursor: pointer;
           display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.tva-btn:hover { border-color: var(--green); color: var(--green-dark); }
.tva-btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.tva-btn-green:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.tva-btn-red { color: var(--red); }
.tva-btn-red:hover { border-color: var(--red); color: var(--red); background: #FCEDED; }
.tva-btn-mini { height: 26px; padding: 0 8px; font-size: 12px; }
.tva-input { height: 32px; padding: 0 10px; border: 1px solid var(--g2); border-radius: 7px; background: var(--white);
             font-family: var(--body); font-size: 12.5px; color: var(--black); outline: none; width: 100%; }
textarea.tva-input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.4; }
.tva-input:focus { border-color: var(--green); }
.tva-num { width: 80px; }
.tva-lbl { display: block; font-size: 11px; font-weight: 600; color: var(--g4); text-transform: uppercase;
           letter-spacing: 0.03em; margin: 8px 0 4px; }
.tva-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; margin-top: 6px; }
.tva-chk input { accent-color: var(--green); width: 15px; height: 15px; }
.tva-chk-mini { margin: 0; }
.tva-zf { display: flex; flex-direction: column; min-width: 0; }
.tva-zf .tva-lbl { margin-top: 4px; }
.tva-zf-row { display: flex; gap: 10px; flex-wrap: wrap; }
.tva-zf-row > .tva-zf { flex: 1; min-width: 120px; }
.tva-grow { flex: 1; min-width: 200px; }

/* Tabulka (Obrazovky, Správci) */
.tva-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tva-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--g4); text-transform: uppercase;
                letter-spacing: 0.03em; padding: 6px 8px; border-bottom: 1px solid var(--g1); }
.tva-table td { padding: 10px 8px; border-bottom: 1px solid var(--g1); vertical-align: middle; }
.tva-table select.tva-input { min-width: 180px; }
.tva-akce { text-align: right; white-space: nowrap; }
.tva-akce .tva-btn { margin-left: 4px; }
.tva-stav { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; }
.tva-stav::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--g2); }
.tva-stav-on { color: var(--green-dark); }
.tva-stav-on::before { background: var(--green); box-shadow: 0 0 0 3px rgba(34,181,115,0.18); }
.tva-stav-off { color: var(--g4); }
.tva-navod ol { margin-left: 18px; font-size: 12.5px; line-height: 1.7; }
.tva-navod code { font-family: var(--mono); font-size: 11.5px; background: var(--g1); padding: 1px 5px; border-radius: 4px; }

/* Prezentace — karty */
.tva-pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tva-pl { background: var(--white); border: 1px solid var(--g1); border-radius: 10px; padding: 14px 16px;
          display: flex; flex-direction: column; gap: 6px; }
.tva-pl-nazev { font-family: var(--head); font-weight: 600; font-size: 15px; }
.tva-pl-akce { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tva-pl-name { width: 280px; font-weight: 600; }
.tva-pl-tv { margin-top: -6px; }

/* Detail prezentace: seznam snímků + editor */
.tva-detail { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.tva-sl-rows { display: flex; flex-direction: column; gap: 6px; }
.tva-sl { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--g1); border-radius: 8px;
          background: var(--white); cursor: pointer; }
.tva-sl:hover { border-color: var(--g2); }
.tva-sl-sel { border-color: var(--green); background: #F1FAF5; }
.tva-sl-off { opacity: 0.5; }
.tva-sl-drag { opacity: 0.35; }
.tva-grip { cursor: grab; color: var(--g3); font-size: 12px; letter-spacing: -2px; }
.tva-sl-cislo { font-family: var(--mono); font-size: 11px; color: var(--g4); width: 16px; text-align: right; }
.tva-sl-info { flex: 1; min-width: 0; }
.tva-sl-info .tva-b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tva-sl-add { align-self: flex-start; margin-top: 4px; }

/* Miniatury šablon */
.tva-lay { display: grid; gap: 2px; width: 96px; aspect-ratio: 16 / 9; background: var(--g1); padding: 2px; border-radius: 4px; }
.tva-lay > div { background: #D8EFE3; color: var(--green-dark); font-family: var(--mono); font-size: 10px; font-weight: 600;
                 display: flex; align-items: center; justify-content: center; border-radius: 2px; min-width: 0; min-height: 0; }
.tva-lay-mini { width: 54px; flex-shrink: 0; }
.tva-lay-mini > div { font-size: 7px; }
.tva-lay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.tva-lay-grid-velka { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tva-lay-grid-velka .tva-lay { width: 100%; }
.tva-lay-pick { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 8px 6px; border: 1px solid var(--g1);
                border-radius: 8px; background: var(--white); cursor: pointer; text-align: center; }
.tva-lay-pick:hover { border-color: var(--g2); }
.tva-lay-pick-sel { border-color: var(--green); background: #F1FAF5; }
.tva-lay-pick-sel .tva-lay > div { background: var(--green); color: #fff; }

/* Editor snímku */
.tva-ed-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.tva-ed-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; align-items: start; margin-top: 6px; }
.tva-ed-zony { display: flex; flex-direction: column; gap: 10px; }
.tva-zona { border: 1px solid var(--g1); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.tva-zona-head { display: flex; gap: 8px; align-items: center; }
.tva-zona-head select { width: 210px; flex-shrink: 0; }
.tva-zona-klic { width: 26px; height: 26px; flex-shrink: 0; border-radius: 6px; background: var(--green); color: #fff;
                 font-family: var(--mono); font-weight: 600; display: flex; align-items: center; justify-content: center; }
.tva-zona-f { display: flex; flex-direction: column; gap: 4px; }
.tva-ed-nahled { position: sticky; top: 10px; }
.tva-nahled-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; }
.tva-nahled { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tva-ed-akce { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--g1); padding-top: 10px; }

/* Média */
.tva-upload { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.tva-upload .tva-zf { min-width: 240px; }
.tva-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tva-media { border: 1px solid var(--g1); border-radius: 8px; overflow: hidden; background: var(--white); display: flex; flex-direction: column; }
.tva-media img, .tva-media video, .tva-media-x { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #000; display: block; }
.tva-media-x { display: flex; align-items: center; justify-content: center; color: var(--g3); }
.tva-media-info { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 11.5px; }
.tva-media-info span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Modální okno, toast */
.tva-modal-bg { position: fixed; inset: 0; background: rgba(30,30,30,0.45); z-index: 900; display: flex;
                align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.15s ease; }
.tva-modal { background: var(--white); border-radius: 12px; padding: 18px 20px; width: 100%; max-width: 560px;
             max-height: calc(100vh - 40px); overflow: auto; display: flex; flex-direction: column; gap: 4px;
             box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.tva-modal-title { font-family: var(--head); font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.tva-modal-text { font-size: 13px; line-height: 1.5; color: var(--black); margin-bottom: 8px; }
.tva-modal-akce { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.tva-modal-akce .tva-meta { margin-right: auto; }
.tva-url { font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.tva-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; background: var(--black);
             color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 12.5px; box-shadow: 0 6px 20px rgba(0,0,0,0.2);
             max-width: calc(100vw - 40px); }
.tva-toast-chyba { background: var(--red); }

/* Nápověda (tlačítko ? v horní liště, stránka Obrazovky) */
.tva-help-btn { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--g2); background: #fff;
                color: var(--g4); font-family: var(--mono); font-size: 13px; font-weight: 600; cursor: pointer;
                line-height: 1; flex-shrink: 0; }
.tva-help-btn:hover { border-color: var(--green); color: var(--green); }
.tva-help { font-size: 13px; line-height: 1.55; color: var(--black); }
.tva-help p { margin: 0 0 8px; }
.tva-help ul, .tva-help ol { margin: 0 0 8px 20px; }
.tva-help li { margin-bottom: 4px; }
.tva-help a { color: var(--green-dark); font-weight: 600; }
.tva-help code { font-family: var(--mono); font-size: 11.5px; background: var(--g1); padding: 1px 5px; border-radius: 4px; }
.tva-help-h { font-family: var(--head); font-weight: 600; font-size: 14px; margin: 14px 0 6px; padding-top: 10px;
              border-top: 1px solid var(--g1); }
.tva-code { position: relative; margin: 6px 0 8px; }
.tva-code pre { margin: 0; padding: 10px 92px 10px 12px; background: #1E1E1E; color: #E8E8E8; border-radius: 7px;
                font-family: var(--mono); font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }
.tva-code .tva-btn { position: absolute; top: 6px; right: 6px; }
.tva-help-tab td { vertical-align: top; }
.tva-help-tab td:first-child { width: 34%; font-weight: 600; }

.tva-auta { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 12px; max-height: 260px;
             overflow: auto; border: 1px solid var(--g1); border-radius: 8px; padding: 8px 10px; }

@media (max-width: 1200px) {
  .tva-detail { grid-template-columns: 1fr; }
  .tva-ed-body { grid-template-columns: 1fr; }
  .tva-ed-nahled { position: static; }
}
