/**
 * dedictvi-prilohy-verejne.css
 * Přílohy ve veřejném formuláři žádosti: kartičky s náhledy, drag drop, lightbox.
 * Navazuje na barvy formuláře (--red, --beige, --border, --ink).
 */

.nkd-priloha-field { margin-top: 0.7rem; }

.nkd-priloha-drag-hint {
  font-size: 0.78rem;
  color: var(--ink-soft, var(--ded-fe-ink-soft));
  margin: 0.4rem 0 0.5rem;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.nkd-priloha-drag-hint span:first-child { font-style: normal; font-size: 1rem; }

.nkd-priloha-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.6rem;
}

.nkd-priloha-item {
  position: relative;
  width: 160px;
  background: #fff;
  border: 1px solid var(--border, var(--ded-fe-border));
  border-radius: 8px;
  padding: 0.45rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s, transform 0.15s, opacity 0.15s;
}
.nkd-priloha-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.nkd-priloha-item[draggable="true"] { cursor: grab; }
.nkd-priloha-item[draggable="true"]:active { cursor: grabbing; }
.nkd-priloha-item.is-dragging { opacity: 0.4; transform: scale(0.95); }
.nkd-priloha-item.is-drop-before { box-shadow: -3px 0 0 0 var(--red, var(--ded-fe-red)); }
.nkd-priloha-item.is-drop-after { box-shadow: 3px 0 0 0 var(--red, var(--ded-fe-red)); }

.nkd-priloha-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 5px;
  display: block;
  cursor: zoom-in;
  background: #f0f0f1;
}
.nkd-priloha-item video {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 5px;
  display: block;
  background: #000;
}
.nkd-priloha-icon {
  width: 100%;
  height: 140px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--beige, #f5f1e8);
  color: var(--ink-soft, var(--ded-fe-ink-soft));
  gap: 0.4rem;
}
.nkd-priloha-icon-glyph { font-size: 2.5rem; line-height: 1; }
.nkd-priloha-ext { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.nkd-priloha-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red, var(--ded-fe-red));
  color: #fff;
  border: 2px solid #fff;
  font-size: 16px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  z-index: 2;
  transition: background 0.15s, transform 0.15s;
}
.nkd-priloha-remove:hover { background: var(--ded-fe-red-hover); transform: scale(1.08); }

.nkd-priloha-name {
  font-size: 0.72rem;
  color: var(--ink, var(--ded-fe-ink));
  text-align: center;
  margin-top: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nkd-priloha-link {
  font-size: 0.68rem;
  color: #2d6a9f;
  text-align: center;
  display: block;
  text-decoration: none;
  margin-top: 0.15rem;
}
.nkd-priloha-link:hover { text-decoration: underline; }

.nkd-priloha-badge-main {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  background: rgba(193,85,61,0.95);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  letter-spacing: 0.02em;
  z-index: 1;
  pointer-events: none;
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}

.nkd-priloha-duration {
  position: absolute;
  bottom: 2.2rem;
  right: 0.6rem;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
  z-index: 1;
  pointer-events: none;
}

/* Upload placeholder */
.nkd-priloha-item.is-uploading {
  pointer-events: none;
  opacity: 0.75;
}
.nkd-priloha-item.is-uploading .nkd-priloha-progress {
  width: 100%;
  height: 140px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--beige, #f5f1e8);
}
.nkd-priloha-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border, var(--ded-fe-border));
  border-top-color: var(--red, var(--ded-fe-red));
  border-radius: 50%;
  animation: ded-spin 0.9s linear infinite;
}

/* Lightbox */
.nkd-priloha-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  cursor: zoom-out;
}
.nkd-priloha-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.nkd-priloha-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  font-size: 24px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  padding: 0;
}
.nkd-priloha-lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* file-upload-zone z formuláře dopracujeme pro drag-over */
.file-upload-zone.drag-over {
  border-color: var(--red, var(--ded-fe-red)) !important;
  background: rgba(193,85,61,0.05) !important;
}
