/* Janet AI · Comparison Engine Widget Styles v2.0 */

.jce-widget {
  font-family: "Heebo","Segoe UI",system-ui,-apple-system,Arial,sans-serif;
  direction: rtl;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  margin: 32px 0;
  box-shadow: 0 2px 12px rgba(46,155,239,.07);
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

.jce-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 16px;
  background: linear-gradient(135deg, #071223 0%, #0d2041 100%);
  color: #fff;
  flex-wrap: wrap;
}

.jce-title {
  font-size: 1.25rem;
  font-weight: 900;
  margin: 0 0 4px;
  color: #fff;
}

.jce-subtitle {
  font-size: .85rem;
  color: #7cc4f8;
  margin: 0;
}

.jce-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex-shrink: 0;
}

.jce-live-badge {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  background: rgba(255,255,255,.12);
  border-radius: 99px;
  padding: 2px 10px;
  color: #f4c77b;
}

.jce-updated {
  font-size: .72rem;
  color: #9db0c4;
}

/* ─── Section ────────────────────────────────────────────────────────────── */

.jce-section {
  border-top: 1px solid #e9eef5;
  padding: 0 0 8px;
}

.jce-section-title {
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: #1272c4;
  padding: 14px 24px 10px;
  margin: 0;
  border-bottom: 1px solid #eef2f7;
  background: #f7f9fc;
}

/* ─── Row ────────────────────────────────────────────────────────────────── */

.jce-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f4f8;
  transition: background .15s;
}

.jce-row:hover { background: #f7f9fc; }
.jce-row:last-child { border-bottom: none; }

.jce-best {
  background: linear-gradient(to left, #f0f9ff 0%, #f8fbff 60%, #fff 100%) !important;
  box-shadow: inset 0 -1px 0 rgba(46,155,239,.15);
}

/* ─── Columns ────────────────────────────────────────────────────────────── */

.jce-col { display: flex; flex-direction: column; gap: 2px; }

.jce-col-provider { flex: 1.4; min-width: 0; }
.jce-col-price    { flex: 1;   align-items: flex-start; min-width: 100px; }
.jce-col-cta      { flex: 0 0 auto; align-items: flex-end; }

/* ─── Provider ───────────────────────────────────────────────────────────── */

.jce-badge-best {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: #1272c4;
  background: #e0f0ff;
  border-radius: 99px;
  padding: 2px 8px;
  width: fit-content;
  margin-bottom: 2px;
}

.jce-provider-name {
  font-size: .95rem;
  font-weight: 700;
  color: #0d1622;
}

.jce-provider-meta {
  font-size: .75rem;
  color: #6b7a8d;
}

/* ─── Price ──────────────────────────────────────────────────────────────── */

.jce-price {
  font-size: 1.15rem;
  font-weight: 900;
  color: #1d2d3a;
  line-height: 1.1;
}

.jce-price-best { color: #1272c4; }

.jce-price-unit {
  font-size: .72rem;
  color: #6b7a8d;
  margin-top: -2px;
}

.jce-diff {
  font-size: .75rem;
  color: #e05b2e;
  font-weight: 600;
}

.jce-saved {
  font-size: .75rem;
  color: #1a9950;
  font-weight: 700;
}

/* ─── CTA button ─────────────────────────────────────────────────────────── */

.jce-btn {
  display: inline-flex;
  align-items: center;
  font-size: .82rem;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 99px;
  text-decoration: none;
  transition: all .18s;
  white-space: nowrap;
  background: #e9eef5;
  color: #1272c4;
}

.jce-btn:hover { background: #d0e4f5; transform: translateY(-1px); }

.jce-btn-best {
  background: #2e9bef;
  color: #fff;
}

.jce-btn-best:hover { background: #1272c4; transform: translateY(-1px); }

/* ─── Loading / Error ────────────────────────────────────────────────────── */

.jce-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 16px;
  color: #6b7a8d;
  font-size: .9rem;
}

.jce-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e9eef5;
  border-top-color: #2e9bef;
  border-radius: 50%;
  animation: jce-spin .7s linear infinite;
}

@keyframes jce-spin { to { transform: rotate(360deg); } }

.jce-error {
  padding: 24px;
  text-align: center;
  color: #6b7a8d;
  font-size: .85rem;
}

.jce-error p { font-weight: 700; margin-bottom: 4px; }

.jce-hotel-fallback {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  flex-wrap: wrap;
}

.jce-fallback-txt {
  font-size: .82rem;
  color: #45586c;
  flex: 1;
}

.jce-stale-warning {
  background: #fff8e1;
  border: 1px solid #f4c77b;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: .8rem;
  color: #7a5c00;
  margin-bottom: 12px;
}

/* ─── Disclosure ─────────────────────────────────────────────────────────── */

.jce-disclosure {
  font-size: .72rem;
  color: #8898a8;
  line-height: 1.6;
  padding: 12px 24px 16px;
  border-top: 1px solid #f0f4f8;
  margin: 0;
  background: #fafbfc;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .jce-row    { flex-wrap: wrap; gap: 8px; }
  .jce-col-provider { flex: 1 1 100%; }
  .jce-col-price    { flex: 1; }
  .jce-header { padding: 16px; }
  .jce-section-title { padding: 12px 16px 8px; }
}

/* ─── Dark mode ──────────────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  .jce-widget        { background: #0d1622; border-color: rgba(255,255,255,.08); }
  .jce-section-title { background: #111d2c; color: #7cc4f8; border-color: rgba(255,255,255,.06); }
  .jce-section       { border-top-color: rgba(255,255,255,.06); }
  .jce-row           { border-bottom-color: rgba(255,255,255,.06); }
  .jce-row:hover     { background: #131f30; }
  .jce-best          { background: linear-gradient(to left, #0e1d30, #0d1622) !important; }
  .jce-provider-name { color: #d4e3f3; }
  .jce-provider-meta { color: #4e6278; }
  .jce-price         { color: #d4e3f3; }
  .jce-btn           { background: #1a2a40; color: #7cc4f8; }
  .jce-btn:hover     { background: #1e3a58; }
  .jce-disclosure    { background: #080f1a; color: #4e6278; border-top-color: rgba(255,255,255,.06); }
}
