body {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  background: #000000;
  color: #f5f5f5;
  font-weight: 200;
}

p, li, label, input, button, h1, h2, h3 {
  font-weight: 200;
}

h3{
  margin: 10px;
  margin-left: 0;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

header h1 {
  margin-bottom: .25rem;
}

/* panely */
section {
  margin-top: 24px;
  padding: 16px;
  border-radius: 12px;
  background: #111111;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .7);
}

input[type="text"] {
  width: 97%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #333333;
  background: #050505;
  color: #f5f5f5;
  margin-bottom: 8px;
}

button {
  padding: 8px 16px;
  border-radius: 8px;
 border: 0px solid #ffffff;
   background: #000000;
  color: #ffffff;
  cursor: pointer;
}

button:hover {
  background: #e9e9e9;
  color: #000000;
}

ul {
/*   max-width: 320px;
 */  list-style: none;
  margin: 0;
  padding: 0;
}

li + li {
  margin-top: 6px;
}

a {
  color: #ffffff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* drobný text */
small {
  color: #9a9a9a;
}

.msg {
  margin-top: 4px;
  font-size: .9em;
  color: #cccccc;
}

/* grid projektů */
.projects ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.projects li {
  margin: 0;
}

/* karta projektu */
.project-card {
  background: #050505;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .7);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .9);
}

.project-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* náhled plánu */
.project-preview-wrap {
  width: 100%;
  border-radius: 8px;
  background: #000000;
  border: 1px solid #333333;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  overflow: hidden;
}

.project-preview {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* placeholder když není PNG */
.project-preview.placeholder {
  width: 100%;
  text-align: center;
  font-size: .85rem;
  color: #9a9a9a;
  padding: 24px 6px;
}

.project-card h3 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 400;


}

.project-meta {
  font-size: .8rem;
  color: #b3b3b3;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-actions {
  margin-top: 8px;
}

.btn-view {
  display: block;
  text-align: center;
  padding: 6px 8px;
  border-radius: 8px;
   background: #292929;
   color: #000000;
  font-weight: 600;
  text-decoration: none;
/*   border: 1px solid #ffffff;
 */  cursor: pointer;
}

.btn-view:hover {
  background: #e5e5e5;
}


.btn-link.primary {
  background: #000000;
  color: #ffffff;
  font-weight: 600;
  border-color: #ffffff;
}

.btn-link:hover {
  background: #111111;
  text-decoration: none;
}


/* skrytý select (kvůli přístupnosti ho neničíme display:none) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* grid malých kartiček šablon */
.template-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

/* jedna kartička šablony */
.template-card {
  border-radius: 10px;
  border: 1px solid #333333;
  background: #050505;
  padding: 8px 10px;
  text-align: left;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  color: #f5f5f5;

}

/* používám <button>, takže zrušíme defaultní styl pro tlačítko */
.template-card {
  font-family: inherit;
}

/* název šablony */
.template-card .name {
  display: block;
  font-weight: 400;
}

/* ID šablony / technický název */
.template-card .id {
  display: block;
  font-size: 0.75rem;
  color: #9a9a9a;
  margin-top: 2px;
}

/* aktivně zvolená šablona */
.template-card.active {
  border-color: #ffffff;
  background: #ffffff;
  transform: translateY(-1px);
    color: #000000;

}


/* skrytý select – necháme ho kvůli formuláři, ale vizuálně schováme */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* menší grid kartiček šablon */
.template-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* bylo ~160px */
  gap: 6px;                                                   /* menší mezera */
  margin-top: 6px;
}

/* menší kartička šablony */
.template-card {
  border-radius: 8px;
  border: 1px solid #333333;
  background: #050505;
  padding: 6px 8px;              /* méně paddingu */
  text-align: left;
  font-size: 0.75rem;            /* menší text */
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  color: #f5f5f5;
  font-family: inherit;
}

/* menší náhled */
.template-thumb {
  width: 100%;
  aspect-ratio: 3 / 2;           /* nižší, užší obdélník */
  border-radius: 6px;
  background: #000000;
  border: 1px solid #333333;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 0.9rem;
}


.template-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* když se nepodaří načíst obrázek */
.template-thumb--empty {
  border-style: dashed;
}

/* název šablony – jen text, žádné ID */
.template-card .name {
  display: block;
  font-weight: 300;
}

/* aktivní šablona */
.template-card.active {
  border-color: #ffffff;
  background: #111111;
  transform: translateY(-1px);
  color: #ffffff;
}

/* řádek s filtrem složek */
.folder-filter {
  margin-top: 8px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.folder-filter label {
  color: #b3b3b3;
}

.folder-filter select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #333333;
  background: #050505;
  color: #f5f5f5;
}

/* malé tlačítko pro přesun projektu */
.btn-move {
  display: inline-block;
  margin-top: 6px;
  margin-left: 0;
  padding: 4px 8px;
  border-radius: 6px;
  border: solid 0px;
  background: #111111;
  color: #f5f5f5;
  cursor: pointer;
}

.btn-move:hover {
  background: #1b1b1b;
}


/* breadcrumb nahoře, jako Google Drive */
.path-bar {
  margin-top: 8px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.9rem;
  align-items: center;
}

.path-bar .crumb {
  border-radius: 999px;
  border: 1px solid #333333;
  background: #050505;
  padding: 2px 10px;
  cursor: pointer;
  color: #f5f5f5;
}

.path-bar .crumb:hover {
  background: #111111;
}

.path-bar span {
  color: #777777;
}

/* řádek se složkami pod breadcrumbem */
.folders-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.folder-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #333333;
  background: #050505;
  cursor: pointer;
  font-size: 0.85rem;
}

.folder-card:hover {
  background: #111111;
}

.folder-icon {
  font-size: 1rem;
}

.folder-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}



/* ---------- Modal pro přesun projektu ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.visible {
  display: flex;
}

.modal-window {
  background: #06060a;
  border-radius: 16px;
  padding: 16px 18px;
  min-width: min(420px, 100% - 32px);
  max-height: 80vh;
  box-shadow: 0 18px 45px rgba(0,0,0,.75);
  border: 1px solid #262626;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal-title {
  font-weight: 600;
  font-size: 1rem;
}

.modal-close {
  border: none;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  font-size: 1.1rem;
}

.modal-body {
  overflow-y: auto;
  padding: 8px 0;
}

.modal-footer {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.move-targets {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.move-target {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #050505;
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
}

.move-target:hover {
  background: #101010;
}

.move-target.current {
  border-color: #7aa2ff;
  background: #0c1220;
}

.modal-footer button {
  border-radius: 999px;
  border: 1px solid #444;
  background: #111;
  color: #eee;
  padding: 4px 12px;
  cursor: pointer;
}

.modal-footer button:hover {
  background: #181818;
}

body.modal-open {
  overflow: hidden;
}

/* --- tweaks 2025-12-20 --- */

/* Template cards should stay small even if there is only one template */
.template-cards{
  grid-template-columns: repeat(auto-fill, minmax(110px, 150px));
  justify-content: start;
}

.template-card{
  max-width: 150px;
}

/* Project cards: preview/title are no longer a link */
.project-main{
  display: block;
}

/* Buttons in project card stacked */
.project-actions{
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Preview + Edit buttons */
.btn-view,
.btn-edit{
  display: block;
  width: 92%;
  text-align: center;
  padding: 6px 8px;
  border-radius: 8px;
   background: #202020;
  color: #ffffff;
  font-weight: 200;
  text-decoration: none;
  cursor: pointer;
}

.btn-view:hover,
.btn-edit:hover{
  background: #ececec;
  text-decoration: none;
  color: #000000;
}

.btn-move{
  text-align: center;
  margin-top: 0;
  margin-left: 10px;
}

.btn-duplicate,
.btn-delete{
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  border: 0;
  background: #111111;
  color: #f5f5f5;
  cursor: pointer;
  font-family: inherit;
}

.btn-duplicate:hover{
  background: #1b1b1b;
}

.btn-delete{
  background: #2a0d0d;
}

.btn-delete:hover{
  background: #4a1414;
  color: #ffffff;
}

    .project-actions{
      display:flex;
      align-items:center;
      gap:10px;
      flex-wrap:wrap;
    }
    .project-actions .actions-right{
      margin-right:auto;
      display:flex;
      align-items:center;
      gap:8px;
      flex-wrap:wrap;
    }
    .project-actions .btn-code{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      width:38px;
      height:34px;
      padding:0;
      border-radius:10px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
      font-weight:700;
/*       letter-spacing:.2px;
 */      text-decoration:none;
      user-select:none;
      margin-right: 20px;
    }
