/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #2563eb;
  --green:     #16a34a;
  --orange:    #ea580c;
  --purple:    #7c3aed;
  --yellow:    #ca8a04;
  --red:       #dc2626;
  --bg:        #f0f4f8;
  --card-bg:   #ffffff;
  --text:      #1e293b;
  --muted:     #64748b;
  --radius:    14px;
  --shadow:    0 4px 24px rgba(0,0,0,0.08);
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

/* ===== HEADER ===== */
header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.5px; }
nav { display: flex; gap: 8px; flex-wrap: wrap; }
nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all 0.2s;
}
nav a:hover, nav a.active {
  background: rgba(255,255,255,0.2);
  color: white;
}

/* ===== MAIN LAYOUT ===== */
main { max-width: 900px; margin: 0 auto; padding: 32px 20px 60px; }
.lekcija-main, .kviz-main { max-width: 860px; }

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 48px 24px 32px;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.hero h1 { font-size: 2.4rem; color: #1e3a8a; margin-bottom: 8px; }
.subtitle { color: var(--muted); font-size: 1rem; }

/* ===== CARD ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 1.4rem; color: #1e3a8a; margin-bottom: 14px; }
.card p { margin-bottom: 12px; }

/* VID HEADER */
.vid-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.vid-icon { font-size: 1.8rem; }
.vid-header h2 { margin-bottom: 0; }
.nesvrseni-header h2 { color: #ea580c; }
.svrseni-header   h2 { color: #16a34a; }
.tvorba-header    h2 { color: #7c3aed; }
.par-header       h2 { color: #0891b2; }
.dvovidni-header  h2 { color: #ca8a04; }

/* ===== HIGHLIGHT BOXES ===== */
.highlight-box {
  padding: 14px 18px;
  border-radius: 10px;
  margin-top: 14px;
  font-size: 0.97rem;
}
.highlight-box.blue   { background: #dbeafe; border-left: 4px solid #2563eb; color: #1e3a8a; }
.highlight-box.green  { background: #dcfce7; border-left: 4px solid #16a34a; color: #14532d; }
.highlight-box.orange { background: #ffedd5; border-left: 4px solid #ea580c; color: #7c2d12; }
.highlight-box.purple { background: #ede9fe; border-left: 4px solid #7c3aed; color: #4c1d95; }
.highlight-box.yellow { background: #fef9c3; border-left: 4px solid #ca8a04; color: #713f12; }

/* ===== PRIMJER BOX ===== */
.primjer-box {
  padding: 16px 20px;
  border-radius: 10px;
  margin: 12px 0;
}
.primjer-box h3 { font-size: 1rem; margin-bottom: 10px; }
.primjer-box ul { padding-left: 20px; }
.primjer-box li { margin-bottom: 6px; }
.nesvrseni-box { background: #fff7ed; border: 1px solid #fed7aa; }
.svrseni-box   { background: #f0fdf4; border: 1px solid #bbf7d0; }
.par-box       { background: #ecfeff; border: 1px solid #a5f3fc; }
.dvovidni-box  { background: #fefce8; border: 1px solid #fde68a; }

mark.nesvrseni { background: #fed7aa; color: #7c2d12; padding: 1px 4px; border-radius: 4px; }
mark.svrseni   { background: #bbf7d0; color: #14532d; padding: 1px 4px; border-radius: 4px; }

/* ===== TAGS ===== */
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; margin-left: 6px; }
.nesvrseni-tag { background: #ffedd5; color: #ea580c; }
.svrseni-tag   { background: #dcfce7; color: #16a34a; }

/* ===== TVORBA TABLE ===== */
.tvorba-table { overflow-x: auto; margin-top: 14px; }
.tvorba-table table { width: 100%; border-collapse: collapse; }
.tvorba-table th {
  background: #ede9fe;
  color: #4c1d95;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.9rem;
}
.tvorba-table td { padding: 9px 14px; border-bottom: 1px solid #e2e8f0; }
.tvorba-table tr:last-child td { border-bottom: none; }
.tvorba-table tr:hover td { background: #f8fafc; }

/* ===== PAR GRID ===== */
.par-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 10px; }
.par-item {
  background: white;
  border: 1px solid #e0f2fe;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== DVOVIDNI GRID ===== */
.dvovidni-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.dvovidni-badge {
  background: #fef9c3;
  border: 1px solid #fde68a;
  color: #713f12;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ===== SHEMA ===== */
.shema { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 600px) { .shema { grid-template-columns: 1fr; } }
.shema-box { padding: 20px; border-radius: 12px; }
.shema-box h3 { margin-bottom: 6px; font-size: 1.05rem; }
.shema-box p  { font-size: 0.9rem; margin-bottom: 10px; color: var(--muted); }
.shema-box ul { padding-left: 18px; }
.shema-box li { font-size: 0.9rem; margin-bottom: 4px; }
.shema-nesvrseni { background: #fff7ed; border: 2px solid #fb923c; }
.shema-svrseni   { background: #f0fdf4; border: 2px solid #4ade80; }
.shema-dvovidni  { background: #fefce8; border: 2px solid #facc15; }

/* ===== KVIZ NAV ===== */
.kviz-nav { margin-top: 16px; }
.kviz-nav h2 { font-size: 1.5rem; color: #1e3a8a; text-align: center; margin-bottom: 8px; }
.kviz-nav > p { text-align: center; color: var(--muted); margin-bottom: 20px; }
.kviz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.kviz-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: white;
  border: 2px solid #dbeafe;
  border-radius: 14px;
  padding: 20px 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.kviz-card:hover { border-color: #2563eb; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(37,99,235,0.15); }
.kviz-emoji { font-size: 2rem; margin-bottom: 8px; }
.kviz-card h3 { font-size: 1rem; color: #1e3a8a; margin-bottom: 4px; }
.kviz-card p  { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
.kviz-tag { background: #dbeafe; color: #1e40af; padding: 2px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; }

/* ===== KVIZ STYLES ===== */
.kviz-hero {
  text-align: center;
  padding: 36px 24px 24px;
  background: linear-gradient(135deg, #f0fdf4, #dbeafe);
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.kviz-hero h1 { font-size: 2rem; color: #1e3a8a; margin-bottom: 8px; }

.kviz-progress-bar { background: #e2e8f0; border-radius: 20px; height: 10px; margin: 16px 0 4px; }
.kviz-progress-fill { height: 10px; border-radius: 20px; background: linear-gradient(90deg, #2563eb, #7c3aed); transition: width 0.4s; }
.kviz-progress-text { text-align: right; font-size: 0.82rem; color: var(--muted); }

.kviz-question-block {
  background: white;
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border-left: 5px solid #2563eb;
}
.kviz-question-block .q-num {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.kviz-question-block .q-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 18px;
}
.q-note { font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; font-style: italic; }

/* OPCIJE */
.options-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.option-btn {
  width: 100%;
  text-align: left;
  padding: 13px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  font-size: 1rem;
  color: #1e293b;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.option-btn:hover:not(:disabled) { border-color: #2563eb; background: #eff6ff; }
.option-btn.correct  { background: #dcfce7 !important; border-color: #16a34a !important; color: #14532d !important; font-weight: 700; }
.option-btn.wrong    { background: #fee2e2 !important; border-color: #dc2626 !important; color: #991b1b !important; }
.option-btn:disabled { cursor: default; }
.option-icon { font-size: 1.1rem; min-width: 24px; text-align: center; }

/* MULTI SELECT */
.option-btn.selected { border-color: #2563eb; background: #dbeafe; }
.option-btn.correct-multi { background: #dcfce7 !important; border-color: #16a34a !important; color: #14532d !important; font-weight: 700; }
.option-btn.wrong-multi   { background: #fee2e2 !important; border-color: #dc2626 !important; color: #991b1b !important; }
.option-btn.missed-multi  { background: #fef9c3 !important; border-color: #ca8a04 !important; color: #713f12 !important; }

.confirm-btn {
  margin-top: 12px;
  padding: 10px 24px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s;
}
.confirm-btn:hover { background: #1d4ed8; }
.confirm-btn:disabled { background: #94a3b8; cursor: default; }

.feedback {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  display: none;
}
.feedback.correct-fb { background: #dcfce7; color: #14532d; border: 1px solid #bbf7d0; }
.feedback.wrong-fb   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.feedback.show { display: block; }

/* REZULTAT */
.rezultat-box {
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow);
  display: none;
}
.rezultat-box.show { display: block; }
.rezultat-emoji { font-size: 4rem; margin-bottom: 12px; }
.rezultat-box h2 { font-size: 1.8rem; color: #1e3a8a; margin-bottom: 8px; }
.rezultat-score { font-size: 3rem; font-weight: 800; color: #2563eb; margin: 12px 0; }
.rezultat-box p { color: var(--muted); margin-bottom: 20px; }
.btn-restart {
  padding: 12px 28px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  margin: 6px;
  transition: background 0.2s;
}
.btn-restart:hover { background: #1d4ed8; }
.btn-home { background: #7c3aed; }
.btn-home:hover { background: #6d28d9; }

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 28px;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 40px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .card { padding: 20px 16px; }
  .kviz-question-block { padding: 20px 16px; }
  .hero h1 { font-size: 1.7rem; }
  .kviz-grid { grid-template-columns: repeat(2, 1fr); }
  .header-inner { flex-direction: column; height: auto; padding: 10px 16px; gap: 8px; }
  nav { justify-content: center; }
}
