/* ── HY Attorneys Vertex AI Search v3.0 ── */

/* Site fonts: Inter for UI/headings, Open Sans for body */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Open+Sans:wght@400;500;600;700&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;
  /* Match site body font (Open Sans), fall back to site UI font (Inter) */
  font-family: 'Open Sans','Inter','Helvetica Neue',Arial,sans-serif;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   DESKTOP SEARCH BAR (> 900px)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.jvcs-bar {
  background: #212326;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  flex-wrap: nowrap;
  width: 100%;
  min-height: 66px;
  overflow: hidden;
}

/* Desktop: badge + title side by side */
.jvcs-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}

.jvcs-ai-label {
  background: #af1d20;
  color: #fff;
  /* Headings use Inter on the site */
  font-family: 'Inter','Helvetica Neue',Arial,sans-serif;
  font-size: clamp(14px, 2.2vw, 28px);
  font-weight: 800;
  letter-spacing: 1px;
  padding: 5px 9px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-block;
}

.jvcs-bar-title {
  color: #fff;
  font-family: 'Inter','Helvetica Neue',Arial,sans-serif;
  font-size: clamp(11px, 1.55vw, 20px);
  font-weight: 800;
  letter-spacing: clamp(0.5px, 0.15vw, 2px);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

/* Desktop: input+button row */
.jvcs-bar-right {
  display: flex;
  flex: 1;
  min-width: 0;
  max-width: 800px;
  margin-left: auto;
  align-items: stretch;
  height: 46px;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.jvcs-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 100%;
}

.jvcs-input {
  width: 100%;
  height: 100% !important;
  background: #141617 !important;
  border: 1.5px solid #434549 !important;
  border-right: none !important;
  border-radius: 0 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #af1d20;
  font-size: 14px;
  padding: 0 16px;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
  display: block;
}

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

.jvcs-input:focus,
.jvcs-input:focus-visible {
  background: #141617 !important;
  border-color: #af1d20 !important;
  border-right: none !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !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 #141617 inset !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #af1d20;
}

.jvcs-btn {
  background: #af1d20 !important;
  color: #fff !important;
  border: none !important;
  padding: 0 22px;
  height: 100% !important;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 0 !important;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s;
  /* Buttons use Inter to match site headings/UI */
  font-family: 'Inter','Helvetica Neue',Arial,sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.jvcs-btn:hover    { background: #9a191c !important; }
.jvcs-btn:active   { background: #881618 !important; }
.jvcs-btn:disabled { background: #7a1416 !important; cursor: wait; }
.jvcs-btn:focus    { outline: none !important; box-shadow: none !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   OVERLAY & POPUP
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.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(20,22,23,.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;
}

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

.jvcs-popup {
  position: relative;
  background: #fff;
  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(175,29,32,.3),
    0 40px 100px rgba(20,22,23,.55),
    0 12px 36px rgba(20,22,23,.3);
  animation: jvcs-pop-in .25s cubic-bezier(.34,1.2,.64,1) both;
  margin: auto;
}

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

.jvcs-popup-header {
  background: #212326;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  flex-shrink: 0;
  border-bottom: 2.5px solid #af1d20;
}

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

.jvcs-popup-title {
  color: #fff;
  font-family: 'Inter','Helvetica Neue',Arial,sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.jvcs-vertex-badge {
  background: rgba(175,29,32,.2);
  color: #af1d20;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  border: 1px solid rgba(175,29,32,.35);
}

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

.jvcs-close-btn:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.55);
  color: #fff;
}

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

.jvcs-popup-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: #f2f3f5;
  min-height: 160px;
}

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

.jvcs-popup-footer {
  background: #fff;
  border-top: 1px solid #e8e8e8;
  padding: 10px 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.jvcs-footer-powered {
  font-size: 11px;
  color: #969990;
  display: flex;
  align-items: center;
  gap: 7px;
}

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

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

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESULT CARDS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.jvcs-meta {
  padding: 10px 20px;
  font-size: 12px;
  color: #434549;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

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

.jvcs-results-list {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.jvcs-result-card:hover {
  border-left-color: #af1d20;
  box-shadow: 0 4px 20px rgba(175,29,32,.11), 0 1px 4px rgba(0,0,0,.05);
  transform: translateX(3px);
}

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

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

.jvcs-result-title {
  /* Titles use Inter to match site headings */
  font-family: 'Inter','Helvetica Neue',Arial,sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #212326;
  margin-bottom: 6px;
  line-height: 1.4;
  transition: color .15s;
}

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

.jvcs-result-snippet {
  font-size: 13px;
  color: #434549;
  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: #af1d20;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.jvcs-arrow {
  font-size: 16px;
  color: #af1d20;
  opacity: 0;
  transition: opacity .15s, transform .15s;
}

.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: #434549;
  font-size: 14px;
}

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

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

.jvcs-error-state {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px;
  background: #fbeeee;
  border: 1px solid #e0a3a4;
  border-left: 4px solid #af1d20;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  color: #7a1416;
  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: #969990;
  font-size: 14px;
  text-align: center;
  line-height: 1.6;
  gap: 4px;
}

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

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

body.jvcs-open { overflow: hidden !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE BREAKPOINTS
   
   > 900px   Desktop  — single row, clamp() fluid fonts
   ≤ 900px   Tablet+  — 2 rows stacked
   ≤ 600px   Mobile   — smaller padding/fonts
   ≤ 420px   XSmall   — badge top, title below (column)
   ≤ 320px   Tiny     — minimum everything
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── ≤ 900px: 2-row layout ── */
@media (max-width: 900px) {
  .jvcs-bar {
    flex-wrap: wrap;
    padding: 14px 16px;
    min-height: auto;
    gap: 10px;
  }

  .jvcs-bar-left {
    width: 100%;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;   /* badge + title stay on one line as long as they fit */
    overflow: hidden;
  }

  .jvcs-ai-label {
    font-size: 20px;
    padding: 4px 8px;
    flex-shrink: 0;
  }

  .jvcs-bar-title {
    font-size: 18px;
    letter-spacing: 1.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
  }

  .jvcs-bar-right {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    flex-shrink: unset;
    height: 46px;
  }

  .jvcs-popup { max-width: calc(100% - 24px); }
}

/* ── ≤ 600px: smaller fonts ── */
@media (max-width: 600px) {
  .jvcs-bar       { padding: 12px 14px; gap: 8px; }
  .jvcs-ai-label  { font-size: 17px; padding: 4px 7px; }
  .jvcs-bar-title { font-size: 15px; letter-spacing: 1.2px; }
  .jvcs-bar-right { height: 44px; }
  .jvcs-btn       { padding: 0 14px; font-size: 12px; letter-spacing: .8px; gap: 5px; }
  .jvcs-input     { font-size: 13px; padding: 0 12px; }

  .jvcs-overlay         { padding: 12px 10px; }
  .jvcs-popup           { max-width:100%; max-height:92vh; border-radius:10px; }
  .jvcs-popup-title     { font-size: 11px; letter-spacing: 1.2px; }
  .jvcs-result-title    { font-size: 14px; }
  .jvcs-result-snippet  { font-size: 12px; }
  .jvcs-results-list    { padding: 10px; gap: 6px; }
  .jvcs-result-card     { padding: 11px 13px 10px; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ≤ 420px — CRITICAL FIX
   Badge + Title don't fit on one line
   → use column layout:
   [AI]
   GET JOSH'S ANSWERS FROM HIS AI MIND
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ≤ 420px (320px–420px)
   FIX: keep row layout — badge left aligned,
   title wraps to the right of it
   
   Result:
   [AI] GET JOSH'S ANSWERS
        FROM HIS AI MIND
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 420px) {
  .jvcs-bar { padding: 10px 12px; gap: 8px; }

  .jvcs-bar-left {
    flex-direction: row;      /* keep row — not column */
    align-items: flex-start;  /* align badge and title from top */
    gap: 8px;
    width: 100%;
    flex-wrap: nowrap;
  }

  .jvcs-ai-label {
    font-size: 13px;
    padding: 4px 7px;
    border-radius: 3px;
    flex-shrink: 0;           /* badge stays fixed size */
    margin-top: 2px;          /* visually aligns with title first line */
  }

  .jvcs-bar-title {
    font-size: 13px;
    letter-spacing: .8px;
    white-space: normal;      /* allow wrapping */
    word-break: break-word;
    text-align: left;         /* left aligned — matches badge */
    overflow: visible;
    text-overflow: unset;
    flex: 1;                  /* take remaining width */
    min-width: 0;
    line-height: 1.3;
  }

  .jvcs-bar-right { height: 42px; }
  .jvcs-btn       { padding: 0 11px; font-size: 11px; letter-spacing: .5px; gap: 4px; }
  .jvcs-btn svg   { width: 12px; height: 12px; }
  .jvcs-input     { font-size: 12px; padding: 0 10px; }

  .jvcs-popup-title  { font-size: 10px; }
  .jvcs-vertex-badge { display: none; }
  .jvcs-result-title { font-size: 13px; }
  .jvcs-results-list { padding: 8px; }
  .jvcs-result-card  { padding: 10px 11px 9px; }
}

/* ── ≤ 320px: same row layout, just tighter ── */
@media (max-width: 320px) {
  .jvcs-bar       { padding: 10px; gap: 7px; }
  .jvcs-ai-label  { font-size: 12px; padding: 3px 6px; }
  .jvcs-bar-title { font-size: 12px; letter-spacing: .5px; }
  .jvcs-bar-right { height: 40px; }
  .jvcs-btn       { padding: 0 10px; font-size: 10px; }
  .jvcs-input     { font-size: 11px; padding: 0 8px; }
}
