/* LUMA Creative — brand tokeny
   Lumino Gold #F5C26B · Deep Night #0E1116 · Soft Ivory #FAF7F2
   Whisper Grey #8A8F99 · Signature Glow #F5C26B → #FFD9B8
   Písmo: Fraunces (nadpisy) · Inter (text & UI) */
:root {
  --ivory: #faf7f2;
  --ivory-deep: #f1ece1;
  --night: #0e1116;
  --night-2: #171c23;
  --card: #ffffff;
  --line: #ebe5d8;
  --line-dark: #262b32;
  --gold: #f5c26b;
  --glow: #ffd9b8;
  --gold-ink: #b07f2c;
  --grey: #8a8f99;
  --text: #1b1f25;
  --text-soft: #5b606a;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 1px 2px rgba(14, 17, 22, 0.04), 0 18px 38px -26px rgba(14, 17, 22, 0.34);
}

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

body {
  font-family: var(--sans);
  background: var(--ivory);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* --- Horná lišta --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; }
.brand-luma {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.2em;
  color: var(--night);
}
.sun {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold);
  margin: 0 12px 0 -4px;
  box-shadow:
    0 0 6px 2px rgba(245, 194, 107, 0.95),
    0 0 16px 7px rgba(255, 217, 184, 0.8);
  flex-shrink: 0;
}
.brand-creative {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.4rem;
  color: var(--grey);
}
.topbar-tag {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.84rem;
  color: var(--grey);
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 20px 70px;
}

/* --- Hero --- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(52% 68% at 82% 40%, rgba(245, 194, 107, 0.22), rgba(245, 194, 107, 0) 62%),
    radial-gradient(40% 60% at 6% 100%, rgba(255, 217, 184, 0.12), rgba(255, 217, 184, 0) 60%),
    var(--night);
  border-radius: 22px;
  padding: 44px 40px;
  margin-bottom: 22px;
}
.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 2.8px;
  color: var(--gold);
  margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.8rem;
  line-height: 1.1;
  color: #f6f1e8;
  letter-spacing: 0.2px;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
}
.hero-sub {
  margin-top: 14px;
  color: #abb0b8;
  font-size: 0.95rem;
  font-weight: 300;
}

/* --- Formulár --- */
form {
  display: flex;
  flex-direction: column;
  gap: 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.fields { display: flex; gap: 11px; }

input[type="text"] {
  flex: 1;
  min-width: 0;
  background: #faf8f3;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 13px 15px;
  border-radius: 11px;
  font-size: 1rem;
  font-family: var(--sans);
  transition: border-color 0.15s, background 0.15s;
}
.context-input { width: 100%; }
input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
}
input::placeholder { color: #a9a89e; }

button {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 11px;
  padding: 13px 26px;
  cursor: pointer;
  transition: transform 0.05s, filter 0.15s, background 0.15s;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

#submit-btn {
  background: linear-gradient(120deg, #f5c26b, #ffd9b8);
  color: var(--night);
  box-shadow: 0 9px 22px -11px rgba(245, 194, 107, 0.85);
}
#submit-btn:hover:not(:disabled) { filter: brightness(1.05); }

#clear-btn {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--line);
}
#clear-btn:hover:not(:disabled) {
  background: var(--ivory-deep);
  color: var(--text);
}

/* --- Stavové a chybové hlásenia --- */
.error {
  background: #fae9e3;
  border: 1px solid #ecccbe;
  color: #b2462a;
  padding: 13px 15px;
  border-radius: 12px;
  margin-top: 16px;
}
.status {
  color: var(--text-soft);
  text-align: center;
  padding: 24px;
}

/* Otáčajúce sa presýpacie hodiny počas generovania. */
@keyframes hourglass-flip {
  0%, 35%   { transform: rotate(0deg); }
  50%, 85%  { transform: rotate(180deg); }
  100%      { transform: rotate(360deg); }
}
.hourglass {
  display: inline-block;
  margin-right: 7px;
  animation: hourglass-flip 2.2s ease-in-out infinite;
}
.meta {
  color: var(--grey);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

section { margin-top: 26px; }
h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 16px;
}

.badge {
  display: inline-block;
  background: #fdedcf;
  border: 1px solid #f1d9a6;
  color: var(--gold-ink);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  vertical-align: middle;
}

/* --- AI analýza --- */
#analysis {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.analysis-head h2 { margin-bottom: 0; }
.analysis-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
#analyze-btn {
  background: var(--night);
  color: var(--gold);
  border: 1px solid #2a2f37;
  white-space: nowrap;
}
#analyze-btn:hover:not(:disabled) { background: var(--night-2); }

#stop-btn {
  background: transparent;
  color: #b2462a;
  border: 1px solid #e3b6a8;
  padding: 13px 20px;
  white-space: nowrap;
}
#stop-btn:hover:not(:disabled) { background: #fae9e3; }

.analysis-content:empty { display: none; }
.analysis-content {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: #2c2f35;
}
/* Živý stream textu počas generovania. */
.analysis-content.streaming {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 440px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-soft);
  background: #faf8f2;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.analysis-content h1,
.analysis-content h2,
.analysis-content h3 {
  font-family: var(--serif);
  font-weight: 600;
  margin: 22px 0 8px;
  line-height: 1.3;
  color: var(--text);
}
.analysis-content h1 { font-size: 1.6rem; }
.analysis-content h2 { font-size: 1.3rem; color: var(--gold-ink); margin-bottom: 8px; }
.analysis-content h3 { font-size: 1.1rem; }
.analysis-content p { margin: 10px 0; }
.analysis-content ul,
.analysis-content ol { margin: 10px 0 10px 22px; }
.analysis-content li { margin: 5px 0; }
.analysis-content strong { color: var(--night); }
.analysis-content em { color: var(--text-soft); }
.analysis-content blockquote {
  border-left: 3px solid var(--gold);
  background: #fbf6ec;
  padding: 8px 14px;
  color: var(--text-soft);
  margin: 12px 0;
  border-radius: 0 8px 8px 0;
}
.analysis-content hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.analysis-content code {
  background: var(--ivory-deep);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.9em;
}

/* --- Výsledky vyhľadávania --- */
.result {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 17px;
  margin-bottom: 11px;
  box-shadow: var(--shadow);
}
.result a.title {
  font-family: var(--serif);
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
}
.result a.title:hover { color: var(--gold-ink); }
.result .domain {
  color: var(--gold-ink);
  font-size: 0.8rem;
  letter-spacing: 0.3px;
  margin: 4px 0 7px;
}
.result .snippet { color: var(--text-soft); font-size: 0.93rem; }

/* --- Priame odkazy --- */
.category { margin-bottom: 20px; }
.category h3 {
  font-size: 0.74rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 1.6px;
  margin-bottom: 9px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 15px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.chip:hover {
  border-color: var(--gold);
  background: #fdf4e3;
  color: var(--gold-ink);
}

footer {
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--grey);
  font-size: 0.82rem;
}
.footer-brand {
  margin-top: 6px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--text-soft);
}

/* --- Dialóg „Vymazať" + progress bar --- */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 28px;
  max-width: 460px;
  width: calc(100% - 32px);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 24px 60px -18px rgba(14, 17, 22, 0.5);
}
.modal::backdrop {
  background: rgba(14, 17, 22, 0.55);
}
.modal-q {
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.4;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.modal-btn-primary {
  background: linear-gradient(120deg, #f5c26b, #ffd9b8);
  color: var(--night);
}
.modal-btn-secondary {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--line);
}
.progress-track {
  height: 16px;
  background: var(--ivory-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0 10px;
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(120deg, #f5c26b, #ffd9b8);
  border-radius: 999px;
  transition: width 0.4s ease;
}
#progress-pct {
  font-family: var(--serif);
  font-size: 1.35rem;
  text-align: right;
  color: var(--gold-ink);
  margin-bottom: 4px;
}

@media (max-width: 720px) {
  .topbar { padding: 14px 18px; }
  .topbar-tag { display: none; }
  main { padding: 22px 14px 56px; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 2.1rem; }
  .hero-sub { font-size: 0.9rem; }
  .fields { flex-direction: column; }
  #analyze-btn { width: 100%; }
}
