/* ── JRCMO Vertex AI Search v3.0 ── */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700;800&display=swap');

.jvcs-root *,
.jvcs-root *::before,
.jvcs-root *::after,
.jvcs-overlay *,
.jvcs-overlay *::before,
.jvcs-overlay *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Bastia', 'Neue Haas Grotesk', 'Barlow', 'Helvetica Neue', Arial, sans-serif;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SEARCH BAR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.jvcs-bar {
  background: #151840;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  min-height: 66px;
  gap: 20px;
  flex-wrap: nowrap;
  width: 100%;
}

.jvcs-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.jvcs-ai-label {
  background: #ea7c27;
  color: #ffffff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 5px 9px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.jvcs-bar-title {
  color: #ffffff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Input + Button row ── */
.jvcs-bar-right {
  display: flex;
  flex: 1;
  min-width: 0;
  max-width: 680px;
  align-items: stretch;       /* stretch so both fill exact same height */
  height: 46px;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;           /* clips child corners — no gap, no bleed */
}

/* Input wrapper */
.jvcs-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 100%;               /* fill parent height */
}

.jvcs-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  flex-shrink: 0;
  z-index: 1;
}

.jvcs-input {
  width: 100%;
  height: 100% !important;    /* fill wrapper height exactly */
  background: #0d1130 !important;
  border: 1.5px solid #2a2f5a !important;
  border-right: none !important;
  border-radius: 0 !important; /* parent overflow:hidden handles corners */
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ea7c27;
  font-size: 14px;
  font-weight: 400;
  padding: 0 16px 0 40px;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
  display: block;
}

.jvcs-input::placeholder {
  color: #4a5080 !important;
  -webkit-text-fill-color: #4a5080 !important;
  font-style: italic;
  opacity: 1;
}

.jvcs-input:focus,
.jvcs-input:focus-visible {
  background: #0d1130 !important;
  border-color: #ea7c27 !important;
  border-right: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  outline: none !important;
  box-shadow: none !important;
}

.jvcs-input:-webkit-autofill,
.jvcs-input:-webkit-autofill:hover,
.jvcs-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0d1130 inset !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ea7c27;
}

/* ── Search Button ── */
.jvcs-btn {
  background: #ea7c27 !important;
  color: #ffffff !important;
  border: none !important;
  padding: 0 22px;
  height: 100% !important;    /* fill parent height exactly */
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 0 !important; /* parent overflow:hidden handles corners */
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  vertical-align: top;
}

.jvcs-btn:hover    { background: #d06b1e !important; }
.jvcs-btn:active   { background: #b85e18 !important; }
.jvcs-btn:disabled { background: #a8601c !important; cursor: wait; }
.jvcs-btn:focus    { outline: none !important; box-shadow: none !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   OVERLAY — always fixed to viewport
   (element is moved to <body> via JS)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.jvcs-overlay {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(8, 10, 32, 0.80);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2147483647 !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px 16px;
  transform: none !important;
  will-change: opacity;
}

.jvcs-overlay.is-open {
  display: flex !important;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   POPUP MODAL
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.jvcs-popup {
  position: relative;
  background: #ffffff;
  width: 100%;
  max-width: 780px;
  max-height: 85vh;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 0 1.5px rgba(234,124,39,0.3),
    0 40px 100px rgba(8,10,32,0.55),
    0 12px 36px rgba(8,10,32,0.3);
  animation: jvcs-pop-in 0.25s cubic-bezier(0.34,1.2,0.64,1) both;
  margin: auto;
}

@keyframes jvcs-pop-in {
  from { opacity: 0; transform: scale(0.93) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Popup Header ── */
.jvcs-popup-header {
  background: #151840;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  flex-shrink: 0;
  border-bottom: 2.5px solid #ea7c27;
}

.jvcs-popup-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.jvcs-popup-title {
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.jvcs-vertex-badge {
  background: rgba(234,124,39,0.2);
  color: #ea7c27;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  border: 1px solid rgba(234,124,39,0.35);
}

.jvcs-close-btn {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  padding: 0;
  line-height: 1;
  font-family: inherit;
  flex-shrink: 0;
}

.jvcs-close-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.55);
  color: #ffffff;
}

.jvcs-close-btn:focus { outline: none !important; }

/* ── Popup Body (scrollable) ── */
.jvcs-popup-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: #f4f5fa;
  min-height: 160px;
}

.jvcs-popup-body::-webkit-scrollbar { width: 4px; }
.jvcs-popup-body::-webkit-scrollbar-track { background: #eceef5; }
.jvcs-popup-body::-webkit-scrollbar-thumb { background: #ea7c27; border-radius: 4px; }

/* ── Popup Footer ── */
.jvcs-popup-footer {
  background: #ffffff;
  border-top: 1px solid #eceef6;
  padding: 10px 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.jvcs-footer-powered {
  font-size: 11px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.2px;
}

.jvcs-footer-dot {
  width: 6px;
  height: 6px;
  background: #ea7c27;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  animation: jvcs-pulse 2s ease-in-out infinite;
}

@keyframes jvcs-pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:0.45; transform:scale(0.65); }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESULTS META BAR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.jvcs-meta {
  padding: 10px 20px;
  font-size: 12px;
  color: #6b7280;
  background: #ffffff;
  border-bottom: 1px solid #e8eaf2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

.jvcs-meta strong { color: #151840; font-weight: 700; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESULT CARDS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.jvcs-results-list {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jvcs-result-card {
  display: block;
  background: #ffffff;
  border: 1px solid #e2e5ef;
  border-left: 3.5px solid transparent;
  border-radius: 9px;
  padding: 14px 18px 13px;
  text-decoration: none !important;
  color: inherit !important;
  transition: border-left-color 0.15s, box-shadow 0.15s, transform 0.13s;
  cursor: pointer;
}

.jvcs-result-card:hover {
  border-left-color: #ea7c27;
  box-shadow: 0 4px 20px rgba(234,124,39,0.11), 0 1px 4px rgba(0,0,0,0.05);
  transform: translateX(3px);
  text-decoration: none !important;
}

.jvcs-result-source {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 5px;
  letter-spacing: 0.2px;
}

.jvcs-result-favicon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  border-radius: 2px;
  flex-shrink: 0;
}

.jvcs-result-title {
  font-size: 15px;
  font-weight: 700;
  color: #151840;
  margin-bottom: 6px;
  line-height: 1.4;
  transition: color 0.15s;
}

.jvcs-result-card:hover .jvcs-result-title {
  color: #ea7c27;
}

.jvcs-result-snippet {
  font-size: 13px;
  font-weight: 400;
  color: #4b5563;
  line-height: 1.65;
}

.jvcs-result-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.jvcs-ai-tag {
  font-size: 10px;
  font-weight: 700;
  color: #ea7c27;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.jvcs-arrow {
  font-size: 16px;
  color: #ea7c27;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  line-height: 1;
}

.jvcs-result-card:hover .jvcs-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   STATES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.jvcs-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 20px;
  gap: 16px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
}

.jvcs-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e4e7ef;
  border-top-color: #ea7c27;
  border-radius: 50%;
  animation: jvcs-spin 0.7s linear infinite;
}

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

.jvcs-error-state {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px;
  background: #fff6f0;
  border: 1px solid #f5c8a0;
  border-left: 4px solid #ea7c27;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  color: #7c3b0a;
  line-height: 1.65;
}

.jvcs-error-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.jvcs-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 20px;
  color: #9ca3af;
  font-size: 14px;
  text-align: center;
  line-height: 1.6;
  gap: 4px;
}

.jvcs-no-results {
  text-align: center;
  padding: 52px 20px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.7;
}

.jvcs-no-results strong { color: #151840; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BODY LOCK when modal open
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
body.jvcs-open {
  overflow: hidden !important;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE — Tablet
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 900px) {
  .jvcs-bar { padding: 0 16px; gap: 14px; }
  .jvcs-bar-title { font-size: 28px; letter-spacing: 1.5px; }
  .jvcs-btn { padding: 0 18px; font-size: 12px; }
  .jvcs-popup { max-width: calc(100% - 32px); }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE — Mobile
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 640px) {
  .jvcs-bar {
    flex-wrap: wrap;
    padding: 12px 14px;
    min-height: auto;
    gap: 10px;
  }
  .jvcs-bar-left {
    width: 100%;
    justify-content: center;
  }
  .jvcs-bar-right {
    width: 100%;
    max-width: 100%;
  }
  .jvcs-overlay {
    padding: 16px 12px;
    align-items: center;
  }
  .jvcs-popup {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
  }
  .jvcs-result-title   { font-size: 14px; }
  .jvcs-result-snippet { font-size: 12px; }
  .jvcs-results-list   { padding: 10px; gap: 7px; }
  .jvcs-result-card    { padding: 12px 14px 10px; }
  .jvcs-btn            { padding: 0 16px; font-size: 12px; }
}

@media (max-width: 420px) {
  .jvcs-bar-title { font-size: 11px; letter-spacing: 1px; }
  .jvcs-ai-label  { font-size: 11px; padding: 4px 7px; }
  .jvcs-popup-title { font-size: 11px; }
}