/* ══════════════════════════════════════════════════
   UNMCG — ai.css
   AI Centar: forma, odgovor, modal, export, profil
   ══════════════════════════════════════════════════ */

/* ── Wrapper ─────────────────────────────────────── */
.us-ai-wrap { font-family: system-ui, sans-serif; max-width: 960px; }

/* ── Hero header + kartice (Faza 6) ──────────────── */
.us-ai-header-hero h2 { font-size: 1.7rem; color: #0a2342; margin: 0 0 .25rem; }
.us-ai-subtitle { color: #6b7a99; margin: 0; font-size: .95rem; }

.us-ai-tools { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 1.25rem; }
.us-ai-tools-title {
  font-size: 1.05rem; color: #0a2342; margin: 0 0 .75rem;
  padding-bottom: .4rem; border-bottom: 2px solid #c9a84c;
}
.us-ai-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .85rem;
}
.us-ai-card {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1.1rem .75rem; cursor: pointer; text-align: center;
  background: #fff; border: 1px solid #dde3ef; border-radius: 12px;
  color: #0a2342; font: inherit; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.us-ai-card:hover {
  transform: translateY(-3px); border-color: #c9a84c;
  box-shadow: 0 8px 22px rgba(10,35,66,.12);
}
.us-ai-card.active {
  background: #0a2342; color: #fff; border-color: #0a2342;
}
.us-ai-card.active .us-ai-card-label { color: #fff; }
.us-ai-card-icon {
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; border-radius: 50%; background: #f1f5f9; color: #0a2342;
}
.us-ai-card.active .us-ai-card-icon { background: #c9a84c; color: #0a2342; }
.us-ai-card-label { font-size: .84rem; font-weight: 600; line-height: 1.25; }

.us-ai-selected {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  background: #f8fafc; border: 1px solid #dde3ef; border-left: 4px solid #c9a84c;
  border-radius: 8px; padding: .6rem .9rem; margin-bottom: 1.25rem;
}
.us-ai-selected-label { color: #6b7a99; font-size: .85rem; }
.us-ai-selected strong { color: #0a2342; }
.us-ai-change {
  margin-left: auto; background: none; border: 1px solid #dde3ef; border-radius: 20px;
  padding: .3rem .8rem; cursor: pointer; font-size: .82rem; color: #0a2342; transition: all .15s;
}
.us-ai-change:hover { border-color: #c9a84c; color: #9a7a35; }

.us-ai-card-desc { font-size: .72rem; color: #6b7a99; line-height: 1.35; }
.us-ai-card.active .us-ai-card-desc { color: #cfe0ff; }

/* Nove opcije forme (rješenja/bodovanje) */
.us-ai-opts { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: .85rem; }
.us-ai-opt { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; color: #1a2b45; cursor: pointer; }

/* ══════════════════════════════════════════════════
   HERO + ILUSTROVANI PROFESOR (izolovano: unmcg-ai-*)
   ══════════════════════════════════════════════════ */
.unmcg-ai-hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.5rem; align-items: center;
  background: linear-gradient(135deg, #0a2342 0%, #13315c 100%);
  border-radius: 20px; padding: 2.25rem 2rem; margin-bottom: 1.75rem;
  color: #fff; overflow: hidden; box-shadow: 0 14px 40px rgba(10,35,66,.18);
}
.unmcg-ai-badge {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #0a2342; background: #c9a84c;
  padding: .25rem .7rem; border-radius: 20px; margin-bottom: .85rem;
}
.unmcg-ai-hero-title { font-size: 1.9rem; line-height: 1.15; margin: 0 0 .6rem; color: #fff; }
.unmcg-ai-hero-sub { font-size: .98rem; line-height: 1.6; color: #cfe0ff; margin: 0 0 1.4rem; max-width: 40ch; }
.unmcg-ai-hero-cta { display: flex; flex-wrap: wrap; gap: .65rem; }

.unmcg-ai-button {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 1.25rem; border-radius: 10px; cursor: pointer;
  font-size: .92rem; font-weight: 600; text-decoration: none; border: 2px solid transparent;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s; font-family: inherit;
}
.unmcg-ai-button-primary { background: #c9a84c; color: #0a2342; }
.unmcg-ai-button-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(201,168,76,.35); color: #0a2342; }
.unmcg-ai-button-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.unmcg-ai-button-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Profesor */
.unmcg-ai-professor { position: relative; min-height: 260px; display: flex; align-items: center; justify-content: center; }
.unmcg-ai-prof-svg { width: 270px; max-width: 100%; height: auto; animation: unmcgFloat 5s ease-in-out infinite; filter: drop-shadow(0 12px 22px rgba(0,0,0,.28)); }
.unmcg-ai-prof-img { width: 100%; max-width: 360px; height: auto; display: block; border-radius: 14px; animation: unmcgFloat 5s ease-in-out infinite; filter: drop-shadow(0 14px 26px rgba(0,0,0,.30)); }

.unmcg-ai-sym {
  position: absolute; font-size: 1.4rem; color: #c9a84c; font-family: Georgia, serif;
  opacity: .85; animation: unmcgFloat 6s ease-in-out infinite;
}
.unmcg-ai-sym.s1 { top: 6%;  left: 8%;  animation-delay: 0s; }
.unmcg-ai-sym.s2 { top: 22%; right: 6%; animation-delay: .8s; }
.unmcg-ai-sym.s3 { bottom: 18%; left: 4%; animation-delay: 1.6s; color:#fff; }
.unmcg-ai-sym.s4 { bottom: 8%; right: 10%; animation-delay: 2.2s; }
.unmcg-ai-sym.s5 { top: 46%; left: 0; animation-delay: 3s; color:#fff; }

.unmcg-ai-bubble {
  position: absolute; background: #fff; color: #0a2342; font-size: .74rem; font-weight: 600;
  padding: .4rem .7rem; border-radius: 12px; box-shadow: 0 6px 16px rgba(0,0,0,.18);
  white-space: nowrap; animation: unmcgPulse 3.5s ease-in-out infinite;
}
.unmcg-ai-bubble::after { content: ''; position: absolute; bottom: -6px; left: 16px; border: 6px solid transparent; border-top-color: #fff; }
.unmcg-ai-bubble.b1 { top: -4%;  left: 2%;  animation-delay: 0s; }
.unmcg-ai-bubble.b2 { top: 12%;  right: -4%; animation-delay: 1.2s; }
.unmcg-ai-bubble.b3 { top: 30%;  left: -6%; animation-delay: 2.4s; }

@keyframes unmcgFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes unmcgPulse { 0%,100% { transform: scale(1); opacity: .95; } 50% { transform: scale(1.05); opacity: 1; } }

/* „Pitaj AI nastavnika" follow-up chipovi */
.unmcg-ai-followups { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: 1rem 1.25rem; border-top: 1px solid #f1f5f9; }
.unmcg-ai-followups-label { font-size: .82rem; color: #6b7a99; font-weight: 600; margin-right: .25rem; }
.unmcg-ai-chip {
  background: #f8fafc; border: 1px solid #dde3ef; border-radius: 20px; padding: .35rem .8rem;
  font-size: .82rem; color: #0a2342; cursor: pointer; transition: all .15s; font-family: inherit;
}
.unmcg-ai-chip:hover { border-color: #c9a84c; background: #fffdf5; }
.unmcg-ai-chip:disabled { opacity: .5; cursor: default; }
.unmcg-ai-loading { color: #6b7a99; font-style: italic; }

@media (prefers-reduced-motion: reduce) {
  .unmcg-ai-prof-svg, .unmcg-ai-sym, .unmcg-ai-bubble { animation: none; }
}
@media (max-width: 760px) {
  .unmcg-ai-hero { grid-template-columns: 1fr; text-align: center; padding: 1.75rem 1.25rem; }
  .unmcg-ai-hero-sub { max-width: none; }
  .unmcg-ai-hero-cta { justify-content: center; }
  .unmcg-ai-professor { min-height: 220px; margin-top: .5rem; }
  .unmcg-ai-bubble.b2, .unmcg-ai-bubble.b3 { display: none; }
}

@media (max-width: 560px) {
  .us-ai-card-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .us-ai-card { padding: .85rem .5rem; }
  .unmcg-ai-hero-title { font-size: 1.5rem; }
  .unmcg-ai-button { width: 100%; }
}

/* ── Header + quota ─────────────────────────────── */
.us-ai-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem;
}
.us-ai-header h2 { margin: 0; font-size: 1.6rem; color: #0a2342; }
.us-ai-quota {
  display: flex; align-items: center; gap: .35rem;
  background: #f8fafc; border: 1px solid #dde3ef;
  border-radius: 20px; padding: .3rem .9rem; font-size: .85rem; color: #6b7a99;
}
.us-ai-quota-n { font-weight: 700; font-size: 1.05rem; color: #0a2342; }
.us-ai-quota-n.low { color: #b91c1c; }

/* ── Form ────────────────────────────────────────── */
.us-ai-form { display: flex; flex-direction: column; gap: 1.25rem; }

.us-ai-step {
  display: flex; gap: 1rem; align-items: flex-start;
  background: #fff; border: 1px solid #dde3ef; border-radius: 12px; padding: 1.25rem;
}
.us-ai-step-num {
  flex-shrink: 0; width: 2rem; height: 2rem;
  background: #0a2342; color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}
.us-ai-step-body { flex: 1; }
.us-ai-step-label { font-weight: 700; color: #0a2342; margin-bottom: .75rem; font-size: .95rem; }
.us-ai-step-opt { font-weight: 400; color: #6b7a99; font-size: .82rem; }

.us-ai-selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.us-ai-ctx-grid  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.us-ai-textarea {
  width: 100%; resize: vertical; min-height: 140px;
  font-family: system-ui, sans-serif; font-size: .92rem; line-height: 1.6;
}
.us-ai-char-count { font-size: .78rem; color: #6b7a99; margin-top: .25rem; text-align: right; }

.us-ai-submit-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: .75rem;
}
.us-ai-error { color: #b91c1c; font-size: .88rem; font-weight: 600; padding: .6rem .9rem; background: #fef2f2; border-radius: 8px; border: 1px solid #fecaca; }

/* ── Odgovor ─────────────────────────────────────── */
.us-ai-response {
  background: #fff; border: 1px solid #dde3ef; border-radius: 12px; overflow: hidden;
}
.us-ai-resp-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid #f1f5f9; flex-wrap: wrap; gap: .75rem;
  background: #f8fafc;
}
.us-ai-resp-header h3 { margin: 0 0 .25rem; font-size: 1.1rem; color: #0a2342; }
.us-ai-resp-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.us-ai-meta-tag {
  background: #e0f2fe; color: #075985; border-radius: 20px;
  padding: .15rem .65rem; font-size: .75rem; font-weight: 500;
}
.us-ai-resp-actions { display: flex; flex-wrap: wrap; gap: .35rem; }

.us-ai-resp-content {
  padding: 1.5rem; font-size: .93rem; line-height: 1.75; color: #1a2b45;
  max-height: 60vh; overflow-y: auto;
}
.us-ai-resp-content h2 { font-size: 1.2rem; color: #0a2342; margin: 1.25rem 0 .5rem; }
.us-ai-resp-content h3 { font-size: 1.05rem; color: #0a2342; margin: 1rem 0 .4rem; }
.us-ai-resp-content h4 { font-size: .95rem; color: #0a2342; margin: .75rem 0 .35rem; }
.us-ai-resp-content p  { margin: 0 0 .75rem; }
.us-ai-resp-content ul,
.us-ai-resp-content ol { padding-left: 1.5rem; margin: 0 0 .75rem; }
.us-ai-resp-content li { margin-bottom: .3rem; }
.us-ai-resp-content strong { color: #0a2342; }
.us-ai-resp-content code {
  background: #f1f5f9; border-radius: 4px; padding: .15rem .4rem;
  font-size: .88em; font-family: 'Courier New', monospace; color: #0a2342;
}
.us-ai-resp-content pre {
  background: #0a2342; color: #e2e8f0; border-radius: 8px;
  padding: 1rem 1.25rem; overflow-x: auto; margin: .75rem 0;
}
.us-ai-resp-content pre code { background: none; color: inherit; padding: 0; font-size: .85rem; }

.us-ai-resp-footer {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.25rem; border-top: 1px solid #f1f5f9; background: #f8fafc;
}
.us-ai-toast-inline { font-size: .82rem; color: #15803d; font-weight: 600; }

/* ── Info gate ───────────────────────────────────── */
.us-ai-gate { display: flex; justify-content: center; padding: 2rem 0; }
.us-ai-gate-inner {
  max-width: 580px; text-align: center;
  background: #fff; border: 1px solid #dde3ef; border-radius: 16px; padding: 2.5rem 2rem;
}
.us-ai-gate-icon { font-size: 3.5rem; margin-bottom: .75rem; line-height: 1; }
.us-ai-gate-inner h2 { color: #0a2342; margin: 0 0 .75rem; font-size: 1.5rem; }
.us-ai-gate-inner p  { color: #6b7a99; margin: 0 0 1.5rem; }
.us-ai-gate-features { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.us-ai-gate-feat {
  background: #f8fafc; border: 1px solid #dde3ef; border-radius: 10px;
  padding: .85rem; text-align: left;
}
.us-ai-gate-feat span { font-size: 1.5rem; display: block; margin-bottom: .25rem; }
.us-ai-gate-feat strong { display: block; color: #0a2342; font-size: .9rem; margin-bottom: .25rem; }
.us-ai-gate-feat p { color: #6b7a99; font-size: .8rem; margin: 0; }

/* ── Modal ───────────────────────────────────────── */
.us-ai-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10,35,66,.45); display: flex;
  align-items: center; justify-content: center; padding: 1rem;
}
.us-ai-modal-box {
  background: #fff; border-radius: 14px; padding: 1.5rem;
  max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.us-ai-modal-wide { max-width: 780px; }
.us-ai-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.us-ai-modal-header h3 { margin: 0; color: #0a2342; }
.us-ai-modal-actions { display: flex; gap: .75rem; margin-top: 1rem; }
.us-ai-save-msg { font-size: .85rem; padding: .5rem; border-radius: 6px; }
.us-ai-save-msg.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.us-ai-save-msg.error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── Print ───────────────────────────────────────── */
@media print {
  .us-ai-resp-actions, .us-ai-resp-footer, .us-ai-header,
  .us-ai-form, #usAiFormSection, .us-sidebar, .us-topbar,
  .us-hamburger { display: none !important; }
  .us-ai-resp-content {
    max-height: none; padding: 0;
    font-size: 11pt; line-height: 1.6; color: #000;
  }
  .us-ai-response { border: none; }
  .us-ai-resp-header { background: none; border: none; }
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .us-ai-selectors,
  .us-ai-ctx-grid { grid-template-columns: 1fr; }
  .us-ai-resp-header { flex-direction: column; }
  .us-ai-gate-features { grid-template-columns: 1fr; }
  .us-ai-step { flex-direction: row; }
}
@media (max-width: 480px) {
  .us-ai-resp-actions { gap: .25rem; }
  .us-ai-resp-actions .us-btn { font-size: .75rem; padding: .3rem .65rem; }
}
