/* DreamTeam Reality – hlavní CSS v2.0.0 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

/* ── Navigační lišta ── */
.top-nav {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 12px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-brand {
  color: white;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-block;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

.nav-link.disabled {
  color: rgba(255, 255, 255, 0.4);
  cursor: default;
  pointer-events: none;
}

/* ── Hlavička stránky ── */
header {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

header h1 {
  font-size: 28px;
  margin-bottom: 8px;
  color: #667eea;
}

header .subtitle {
  font-size: 14px;
  color: #666;
}

/* ── Layout ── */
.container {
  max-width: 1000px;
  margin: 0 auto;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: #667eea;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 12px;
}

/* ── Formuláře ── */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
  font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="file"],
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="file"]:focus,
select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  padding-right: 40px;
}

/* ── Tlačítka ── */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-block;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-block {
  width: 100%;
  margin-top: 12px;
}

/* ── Grid ── */
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .two-column {
    grid-template-columns: 1fr;
  }
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Výběrový seznam ── */
.selector-list {
  list-style: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.selector-item {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
}

.selector-item:hover {
  background: #f9f9f9;
}

.selector-item.selected {
  background: #e3f2fd;
  border-left: 4px solid #667eea;
}

.selector-item .item-name {
  font-weight: 600;
  color: #333;
  display: block;
  margin-bottom: 4px;
}

.selector-item .item-detail {
  font-size: 12px;
  color: #999;
}

/* ── Statusové zprávy ── */
.status-msg {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

.status-info {
  background: #e3f2fd;
  color: #1976d2;
  border-left: 4px solid #1976d2;
}

.status-success {
  background: #e8f5e9;
  color: #388e3c;
  border-left: 4px solid #388e3c;
}

.status-error {
  background: #ffebee;
  color: #c62828;
  border-left: 4px solid #c62828;
}

/* ── Animace ── */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Dokumentová mřížka ── */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.doc-item {
  padding: 16px;
  border: 2px solid #f0f0f0;
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.doc-item:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.doc-item.generated {
  border-color: #4caf50;
  background: #f1f8e9;
}

.doc-item .doc-name {
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.doc-item .doc-status {
  font-size: 12px;
  color: #999;
}

/* ── LV prvky ── */
.lv-status {
  padding: 12px;
  background: #f5f5f5;
  border-radius: 6px;
  margin-top: 12px;
  font-size: 13px;
  color: #666;
}

.parcel-list {
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-top: 12px;
  max-height: 250px;
  overflow-y: auto;
}

.parcel-item {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.parcel-item input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}

/* ════════════════════════════════════════════════════════════════════════════
   NASTAVENÍ – Provider toggle (Vision + Edit provider přepínač)
   ════════════════════════════════════════════════════════════════════════════ */

.provider-toggle {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.provider-option {
  flex: 1;
  min-width: 180px;
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  background: #fafafa;
  font-weight: normal !important;
  margin-bottom: 0 !important;
  color: #333;
}

.provider-option:hover {
  border-color: #667eea;
  background: #f0f2ff;
}

.provider-option.active {
  border-color: #667eea;
  background: #eef0fd;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.provider-option input[type="radio"] {
  width: auto;
  flex-shrink: 0;
  accent-color: #667eea;
  cursor: pointer;
}

.provider-icon {
  font-size: 22px;
  line-height: 1;
}

.provider-name {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  display: block;
}

.provider-desc {
  font-size: 12px;
  color: #888;
  display: block;
  margin-top: 2px;
}

.provider-option .provider-name,
.provider-option .provider-desc {
  display: block;
}

/* ── Malá poznámka u labelu ── */
.label-note {
  font-weight: normal;
  font-size: 12px;
  color: #999;
}

/* ── Field hint ── */
.field-hint {
  font-size: 12px;
  color: #888;
  margin-top: 5px;
  font-weight: normal;
}

.field-hint code {
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

/* ── Button row ── */
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Status warning ── */
.status-warning {
  background: #fff8e1;
  color: #f57c00;
  border-left: 4px solid #f57c00;
}

/* ── Model chip list (seznam modelů Ollama) ── */
.model-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.model-chip {
  padding: 4px 10px;
  background: #f0f0f0;
  border-radius: 12px;
  font-size: 12px;
  color: #555;
  font-family: "Consolas", monospace;
}

.model-chip-active {
  background: #667eea;
  color: white;
}

/* ════════════════════════════════════════════════════════════════════════════
   NASTAVENÍ – API klíče
   ════════════════════════════════════════════════════════════════════════════ */

.api-key-row,
.folder-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.api-key-row input,
.folder-row input {
  flex: 1;
  min-width: 0;
}

.btn-icon {
  padding: 10px 12px;
  flex-shrink: 0;
}

.key-status {
  margin-top: 6px;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
}

.key-ok      { color: #388e3c; background: #f1f8e9; }
.key-missing { color: #c62828; background: #ffebee; }

.info-list { display: flex; flex-direction: column; gap: 12px; }

.info-item {
  padding: 12px;
  background: #f9f9f9;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.info-item a { color: #667eea; }


/* ════════════════════════════════════════════════════════════════════════════
   FOTO – Drag & drop zona
   ════════════════════════════════════════════════════════════════════════════ */

.dropzone {
  border: 2px dashed #ccc;
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: default;
  transition: border-color 0.2s, background 0.2s;
  margin-top: 12px;
  background: #fafafa;
}

.dropzone.drag-over {
  border-color: #667eea;
  background: #f0f2ff;
}

.dropzone-icon { font-size: 36px; margin-bottom: 8px; }
.dropzone-text { font-size: 14px; color: #888; }


/* ════════════════════════════════════════════════════════════════════════════
   FOTO – Seznam souborů
   ════════════════════════════════════════════════════════════════════════════ */

.file-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.file-count-badge {
  background: #667eea;
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.file-list-actions { display: flex; gap: 6px; }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.file-list {
  list-style: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.file-item {
  border-bottom: 1px solid #eee;
  transition: background 0.15s;
}

.file-item:last-child { border-bottom: none; }

.file-item.deselected { opacity: 0.45; }

.file-item-label {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  cursor: pointer;
  gap: 8px;
  font-weight: normal;
}

.file-item-label:hover { background: #f5f5f5; }

.file-item-name {
  flex: 1;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-size {
  font-size: 11px;
  color: #aaa;
  flex-shrink: 0;
}


/* ════════════════════════════════════════════════════════════════════════════
   FOTO – Spuštění
   ════════════════════════════════════════════════════════════════════════════ */

.run-buttons {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-run {
  flex: 1;
  padding: 14px;
  font-size: 16px;
}


/* ════════════════════════════════════════════════════════════════════════════
   FOTO – Progress bar
   ════════════════════════════════════════════════════════════════════════════ */

.progress-wrap {
  margin-bottom: 16px;
}

.progress-bar-bg {
  background: #f0f0f0;
  border-radius: 8px;
  height: 14px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 13px;
  color: #666;
  text-align: right;
}

.current-step {
  font-size: 14px;
  color: #333;
  font-style: italic;
  min-height: 20px;
  margin-bottom: 12px;
}

.progress-log {
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 8px;
  padding: 12px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12px;
  max-height: 260px;
  overflow-y: auto;
  line-height: 1.6;
}

.log-line      { margin: 0; }
.log-ok        { color: #6db36d; }
.log-warn      { color: #e8c97e; }
.log-err       { color: #f07070; }
.log-step      { color: #9da8d0; }


/* ════════════════════════════════════════════════════════════════════════════
   FOTO – Souhrn výsledků
   ════════════════════════════════════════════════════════════════════════════ */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.summary-item {
  text-align: center;
  padding: 16px;
  border-radius: 10px;
}

.summary-num  { font-size: 36px; font-weight: 800; }
.summary-lbl  { font-size: 12px; margin-top: 4px; }

.summary-ok   { background: #e8f5e9; color: #388e3c; }
.summary-warn { background: #fff8e1; color: #f57c00; }
.summary-err  { background: #ffebee; color: #c62828; }

@media (max-width: 600px) {
  .summary-grid { grid-template-columns: 1fr; }
  .run-buttons  { flex-direction: column; }
  .api-key-row, .folder-row { flex-wrap: wrap; }
}

.parcel-item label {
  margin: 0;
  cursor: pointer;
  display: inline;
  font-weight: normal;
}

/* ── Modální okno ── */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 32px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #333;
}

.modal-close {
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #999;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #333;
}

/* ── Zápatí ── */
.footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  color: white;
  font-size: 12px;
}
