/* Container & Layout */
.ai-wrap { position: relative; }
.ai-container { max-width: 860px; margin: 0 auto; padding: 24px 16px; }
.ai-title { font-size: 28px; font-weight: 700; margin: 0 0 16px; }

/* Form */
#ai-result-card {margin-top: 30px;}
.ai-form { display: grid; gap: 30px; grid-template-columns: 1fr; padding-top: 10px; padding-bottom: 10px;}
.ai-label { display: grid; gap: 6px; font-size: 14px; color: #fff; }
.ai-input, .ai-textarea {
  width: 100%; padding: 10px 12px; background: #fff; color: #0f172a;
  border: 1px solid #cbd5e1; border-radius: 13px; outline: none;
}
.ai-input:focus, .ai-textarea:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,.2); }
.ai-textarea { min-height: 44px; height: 96px; }
.ai-btn {
  display: inline-block; border: 0; border-radius: 13px; padding: 12px 16px;
  background: #0ea5e9; color: #fff; font-weight: 700; cursor: pointer;
}
.ai-btn:hover { filter: brightness(0.96); }

/* Card */
.ai-card-head { display: flex; justify-content: space-between; align-items: center; padding: 20px; color: #062320; }
.ai-card-title { font-weight: 600; }
.ai-card-title-history {
  margin-bottom: 10px;
}
.ai-badge { font-size: 12px; background: #e2e8f0; padding: 3px 8px; border-radius: 6px; color: #000; }

.ai-badge-result {
  padding: 10px;
  color: #000;
  border-radius: 100% !important;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ai-left {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 70px;
  color: #062320;
}

/* List view - history */
.ai-list { 
  display: grid;
  gap: 20px;
}

.ai-kitem { 
  position: relative;
}

.ai-kitem-layer { 
  position: absolute;
  top: 4px;
  right: 4px;
  width: 100%;
  height: 100%;
  padding: 10px; 
  background: rgba(59, 197, 197, 0.4);
  border-radius: 13px;
  z-index: 1;
}

.ai-kitem-inner { 
  display: flex;
  padding: 10px; 
  background: #fff; 
  justify-content: space-between; 
  gap: 30px;
  z-index: 2;
  position: relative;
  border-radius: 13px;
}

.ai-kitem-inner-result { 
  display: flex;
  padding: 10px; 
  background: #fff; 
  justify-content: space-between; 
  gap: 5px;
  z-index: 2;
  position: relative;
  flex-direction: row;
  justify-content: space-between;
}



@media (max-width: 768px) {
  .ai-kitem-inner {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .ai-kitem-inner-result {
    flex-direction: column;
    align-items: center;
  }
}

.ai-khead {
  width: fit-content;
}

.ai-kword { font-weight: 600; color: #0f172a; }
.ai-kstatus { 
  white-space: nowrap; 
  width: fit-content;
}
.ai-kmatches { font-size: 14px; color: #0f172a;}
.ai-kmatches-sources {
  margin-top: 10px;
  font-size: 12px;
  color: #0f172a;
}
.ai-kmatches-sources .ai-muted {
  display: inline-block;
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ai-history-brand {
  margin-top: 6px;
  font-size: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.ai-history-brand .ai-pill { margin-left: 0; }

.ai-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 18px;
}
.ai-result-meta > div {
  background: rgba(255,255,255,0.8);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: #072623;
  box-shadow: 0 0 0 1px rgba(7,38,35,0.06);
}

.ai-result-summary-cards {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 24px;
}
.ai-summary-card {
  background: #fff;
  border-radius: 13px;
  padding: 16px;
  text-align: center;
  border: 3px solid transparent;
  box-shadow: 0 10px 20px rgba(7,38,35,0.05);
}
.ai-summary-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #072623;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ai-summary-value {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 80px;
}
.ai-summary-card .ai-pill {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 20px;
}
.ai-brand-snippet {
  margin-top: 10px;
  font-size: 13px;
  color: #0f172a;
  background: rgba(7,38,35,0.06);
  border-radius: 10px;
  padding: 8px 12px;
  text-align: left;
}

.ai-sources-group {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}
@media (min-width: 768px) {
  .ai-sources-group {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}
.ai-sources-block {
  background: #fff;
  border-radius: 13px;
  padding: 16px;
  box-shadow: 0 0 0 1px rgba(7,38,35,0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-sources-title {
  font-weight: 700;
  color: #072623;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.ai-sources-subtitle {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f172a;
  margin-top: 10px;
}
.ai-sources-links {
  font-size: 13px;
  line-height: 1.4;
}
.ai-engine-brand {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-engine-brand .ai-pill {
  align-self: flex-start;
}

/* Pills & States */
.ai-pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.ai-pill.ok  { background: #dcfce7; color: #166534; }
.ai-pill.bad { background: #fee2e2; color: #991b1b; }
.ai-error { color: #dc2626; font-size: 13px; margin-bottom: 10px; }
.ai-error-text { color: #b91c1c; font-size: 12px; }
.ai-muted { color: #94a3b8; font-size: 11px; }

/* Links */
.ai-link { color: #0369a1; text-decoration: underline; word-break: break-all; display: block; }
.ai-link:hover { text-decoration: none; }

/* Raw JSON */
.ai-raw {
  margin-top: 16px; font-size: 12px; background: #0b1220; color: #e2e8f0;
  border: 1px solid #1f2937; border-radius: 12px; padding: 12px; overflow: auto;
}

/* Utils */
.ai-hidden { display: none !important; }


#ai-checker-merged { position: relative; }
/* scoped borders for result/history quality */
#ai-checker-merged-wrap .ai-border-red    { border: 3px solid #e11d48 !important; border-radius: 13px; }
#ai-checker-merged-wrap .ai-border-orange { border: 3px solid #f59e0b !important; border-radius: 13px; }
#ai-checker-merged-wrap .ai-border-green  { border: 3px solid #10b981 !important; border-radius: 13px; }
/* disabled submit look */
#ai-checker-merged-wrap .ai-btn[disabled],
#ai-checker-merged-wrap .ai-btn.ai-btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(60%);
}
/* popup */
#ai-checker-merged-wrap .ai-popup.ai-hidden { display: none; }
#ai-checker-merged-wrap .ai-popup {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
#ai-checker-merged-wrap .ai-popup-inner {
  background: #fff; border-radius: 13px; padding: 16px 18px; max-width: 520px; width: calc(100% - 40px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
#ai-checker-merged-wrap .ai-popup-close {
  border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; float: right;
}
/* compact result spacing */
#ai-checker-merged-wrap #ai-result-compact .ai-kitem { margin-top: 0; }
/* Loading overlay over the form */
#ai-checker-merged .ai-loading-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.55);
  display: none;            /* toggled to flex while loading */
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 13px;      /* match card/form rounding */
}
#ai-checker-merged .ai-loading-box {
  background: #fff;
  border-radius: 13px;
  padding: 18px 20px;
  font-weight: 600;
  font-size: 18px;
  position: relative;
  min-width: 220px;
  text-align: center;
}
#ai-checker-merged .ai-loading-close {
  position: absolute;
  top: 6px; right: 8px;
  border: 0; background: transparent;
  font-size: 20px; line-height: 1;
  cursor: pointer;
}
#ai-checker-merged .ai-loading-text {
  display: block;
  padding: 8px 0 2px;
}
/* Result overlay (card over the form) */
#ai-checker-merged .ai-result-overlay {
  position: relative;
  inset: 0;
  background: rgba(15,23,42,0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border-radius: 13px;
}

#ai-popup-msg {
  color: black;
}

#ai-checker-merged .ai-result-overlay .ai-card {
  margin: 0;
}
#ai-checker-merged .ai-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#ai-checker-merged .ai-result-close {
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}
#ai-result-overlay #ai-result-card-merged {
  width: 100%;
  height: 100%;
}

#ai-result-card-merged {
  position: relative;
}

.ai-kitem-inner-result-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: start;
}

.ai-kitem-inner-result-wrapper .ai-card-head {
  padding: 0px;
  width: 100%;
}

.ai-kitem-inner-result-wrapper .ai-kitem-inner-result {
  padding: 0px;
}

.ai-kitem-inner-result .ai-card-head {
  display: flex;
}

.ai-loading-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ai-loading-box span {
  color: #062320;
  font-size: 20px;
}

.ai-loading-close {
  display: none;
}

.ai-btn-disabled,
.ai-btn-disabled:disabled,
.cta-box.ai-btn-disabled {
  pointer-events: none !important;   /* nema klika mišem */
  cursor: not-allowed !important;     /* vizuelni signal */
  user-select: none !important;       /* ne može selekcija teksta */
  -webkit-user-select: none !important;
  touch-action: none !important;      /* bez touch gestova */
  opacity: 0.55 !important;           /* “sivo” */
  filter: grayscale(100%) !important; /* dodatno zatamni */
  box-shadow: none !important;        /* bez senki (ako ih ima) */
  transform: none !important;         /* bez skala/hover efekata */
  outline: none !important;           /* nema outline-a */
}

#cf-turnstile-container iframe {
  width: 250px !important;
}

#cf-turnstile-container{
  display: flex !important;
  justify-content: center !important;
}
