/* Promptovač – styly */

:root {
  --bg: #f4f5fb;
  --card: #ffffff;
  --text: #1c2033;
  --muted: #6b7186;
  --accent: #5b5bd6;
  --accent-dark: #4747b8;
  --border: #e3e5f0;
  --error: #c62842;
  --ok: #1d8a4e;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(28, 32, 51, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}

header h1 { margin: 0; font-size: 2.2rem; }
.subtitle { color: var(--muted); margin: 0.4rem 0 0; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.section-title {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
}

textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.form-row {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.form-group { flex: 1; min-width: 220px; }
.form-group.narrow { flex: 0 0 180px; }

input[type="number"] {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.hint { color: var(--muted); font-size: 0.8rem; margin: 0.4rem 0 0; }

.image-preview {
  position: relative;
  display: inline-block;
  margin-top: 0.5rem;
}

.image-preview img {
  max-width: 180px;
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.image-preview button {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--error);
  color: #fff;
  cursor: pointer;
  font-size: 0.75rem;
}

/* Výběr modelů */
.models-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

.link-btn:hover { text-decoration: underline; }

.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.5rem;
}

.model-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.model-item:hover { border-color: var(--accent); }
.model-item.checked { border-color: var(--accent); background: #f2f2fd; }
.model-item input { margin-top: 0.25rem; }

.model-name { font-weight: 600; font-size: 0.95rem; }
.model-desc { color: var(--muted); font-size: 0.8rem; }

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  margin-left: 0.4rem;
  vertical-align: middle;
  background: #ececfa;
  color: var(--accent-dark);
}

.badge.no-vision { background: #fdf0e7; color: #a05a1c; }

/* Akce a průběh */
.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
  padding: 0.7rem 1.6rem;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.primary-btn { background: var(--accent); color: #fff; }
.primary-btn:hover { background: var(--accent-dark); }
.primary-btn:disabled { background: #b9b9e0; cursor: not-allowed; }

.secondary-btn {
  background: var(--card);
  border: 1px solid var(--accent);
  color: var(--accent-dark);
}

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

.progress {
  flex: 1;
  min-width: 200px;
  height: 26px;
  background: var(--border);
  border-radius: 99px;
  position: relative;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s;
}

#progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

/* Výsledky */
.results { display: flex; flex-direction: column; gap: 0.75rem; }

.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--ok);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
}

.result-card.error { border-left-color: var(--error); }
.result-card.skipped { border-left-color: #d99a4e; }
.result-card.pending { border-left-color: var(--accent); }
.result-card.pending .result-text { color: var(--muted); }

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.result-model { font-weight: 700; }
.result-meta { color: var(--muted); font-size: 0.8rem; }

.result-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
}

.result-text.error-text { color: var(--error); }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 2rem 1rem;
}

footer a { color: var(--accent); }

.hidden { display: none !important; }

@media (max-width: 600px) {
  header h1 { font-size: 1.7rem; }
  .form-group.narrow { flex: 1; }
}
