/* Prevent overscroll bounce effect */
html, body {
  overscroll-behavior: none;
}

/* Full-viewport layout root (Chrome requires explicit height on flex ancestors) */
html {
  height: 100%;
}

body {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #FAF9F5;
  font-family: "Inter Tight", "Inter", sans-serif;
}

/* ── Landing state: natural page flow ─────────────────────────────────────── */
/* (no body/overflow overrides needed — layout stays height:100% / overflow:hidden) */

/* Header: blend with page in landing, border in results */
#site-header {
  background: #FAF9F5;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
body:has(.main-layout.results-visible) #site-header {
  background: #FAF9F5;
  border-bottom-color: #e5e7eb;
}

/* Filter checkboxes */
.filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #1A1A1A;
  user-select: none;
}

.filter-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #1A1A1A;
  cursor: pointer;
}

.filter-check:hover span {
  color: #1A1A1A;
  opacity: 0.7;
}

/* ── LinkedIn-style filter pills ─────────────────────────────────────────── */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Text input pill */
.fp-input {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #d8dbd9;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-family: inherit;
  outline: none;
  background: white;
  color: #1A1A1A;
  transition: border-color 0.15s;
}

.fp-input::placeholder { color: #7d9187; }
.fp-input:focus { border-color: #1A1A1A; }

/* Text input with clear button */
.fp-input-wrap { position: relative; flex-shrink: 0; }
.fp-input-w { width: 100%; padding-right: 28px; }
.fp-clear {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 0.7rem; color: #7d9187; padding: 2px; line-height: 1;
}
.fp-clear:hover { color: #1A1A1A; }

/* Dropdown pill wrapper */
.fp-wrap { position: relative; flex-shrink: 0; }

/* Pill button */
.fp-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #d8dbd9;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  background: white;
  color: #5a6a62;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}

.fp-btn:hover { border-color: #1A1A1A; color: #1A1A1A; }

.fp-btn.active {
  background: #1A1A1A;
  border-color: #1A1A1A;
  color: white;
}

/* Chevron icon */
.fp-chevron { width: 14px; height: 14px; opacity: 0.45; flex-shrink: 0; }
.fp-btn.active .fp-chevron { opacity: 0.75; }

/* Dropdown panel */
.fp-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 6px 0;
  z-index: 200;
  min-width: 210px;
  display: none;
}

.fp-panel.open { display: block; }

/* Dropdown option row */
.dp-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 0.875rem;
  cursor: pointer;
  color: #1A1A1A;
  user-select: none;
}

.dp-option:hover { background: #f7f8f7; }

.dp-option input {
  width: 15px;
  height: 15px;
  accent-color: #1A1A1A;
  cursor: pointer;
  flex-shrink: 0;
}

/* Right controls group */
.fp-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Reset link button */
.fp-reset {
  font-size: 0.75rem;
  color: #7d9187;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 4px;
  transition: color 0.15s;
  font-family: inherit;
}

.fp-reset:hover { color: #e74c3c; }

/* Job card */
.job-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 22px 18px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-color: #c8c8c8;
}

/* Card header: company name + apply button */
.job-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.job-company {
  font-size: 0.8125rem;
  color: #6b7280;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Apply button — pill shape */
.btn-apply {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #1A1A1A;
  padding: 6px 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 9999px;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  background: #ffffff;
  font-family: inherit;
}

.btn-apply:hover {
  border-color: #1A1A1A;
  background: #f9f9f9;
}

/* Job title */
.job-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* Location row */
.job-location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Divider between location and footer */
.job-divider {
  border-top: 1px solid #f0f0f0;
  margin: 4px 0 0;
}

/* Footer: work type + time */
.job-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.job-type {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 400;
}

.job-time {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-left: auto;
}

/* Skeleton loading */
.skeleton-card {
  height: 140px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}
.skeleton-card:nth-child(3n)   { height: 160px; }
.skeleton-card:nth-child(3n+2) { height: 120px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Active filter buttons */
#btn-new-only.active {
  background: #E4EBF8;
  border-color: #1A1A1A;
  color: #1A1A1A;
}

/* ── Main layout: Chat (1/3) + Jobs (2/3) ────────────────────────────────── */

/* Header must not grow/shrink so the main-layout can fill the rest */
#site-header {
  flex-shrink: 0;
}

.main-layout {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

/* ── Hero area (shown before first search) ───────────────────────────────── */

.hero-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
  text-align: center;
}

.main-layout:not(.results-visible) .chat-panel {
  justify-content: center;
  padding-bottom: 60px;
  background: #FAF9F5;
}

.hero-title {
  font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin: 0;
  color: #2e2a27;
  text-align: center;
  line-height: 1.15;
}

.hero-italic {
  font-family: 'Lora', serif;
  font-style: italic;
  font-weight: 400;
}

.hero-subtitle {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: clamp(14px, 1.8vw, 18px);
  font-weight: 400;
  color: #756e68;
  text-align: center;
  margin: 16px 0 0;
  line-height: 1.6;
}

/* Suggestion chips */
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0 24px;
  max-width: 720px;
  width: 100%;
  margin: 20px auto 0;
}

.hero-chip {
  padding: 7px 16px;
  border: 1px solid #d8dbd9;
  border-radius: 9999px;
  font-size: 0.8125rem;
  color: #5a6a62;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.hero-chip:hover {
  border-color: #1A1A1A;
  color: #1A1A1A;
  background: #f7f8f7;
}

/* In results state: hide hero, reveal chat history */
.main-layout.results-visible .hero-area {
  display: none;
}

.main-layout.results-visible .hero-chips {
  display: none;
}

/* In hero state: hide chat messages */
.main-layout:not(.results-visible) .chat-messages {
  display: none;
}

/* In hero state: Lovable-style search card */
.main-layout:not(.results-visible) .chat-input-area {
  max-width: 56rem;
  width: 100%;
  margin: 32px auto 0;
  padding: 0 24px;
}

.main-layout:not(.results-visible) .chat-input-wrap {
  border-radius: 1rem;
  padding: 26px 32px;
  background: #ffffff;
  box-shadow: 0 1px 12px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
  gap: 20px;
  align-items: center;
}

.main-layout:not(.results-visible) .chat-textarea {
  font-size: 15px;
}

.main-layout:not(.results-visible) .chat-send-btn {
  width: auto;
  height: auto;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

/* Show "Search" text in landing, hide arrow SVG */
.send-icon { display: none; } /* hidden by default; CSS below overrides per state */

.main-layout:not(.results-visible) .send-label { display: inline; }
.main-layout:not(.results-visible) .send-icon  { display: none; }

/* Show arrow icon in results chat, hide text */
.main-layout.results-visible .send-label { display: none; }
.main-layout.results-visible .send-icon  { display: flex; align-items: center; justify-content: center; }

/* Search button: gray when empty, dark when has value */
.main-layout:not(.results-visible) .chat-send-btn:not(.search-has-value) {
  background: rgba(46,42,39,0.12);
  color: #756e68;
  cursor: default;
}
.main-layout:not(.results-visible) .chat-send-btn.search-has-value {
  background: #2e2a27;
  color: #fff;
  cursor: pointer;
}
.main-layout:not(.results-visible) .chat-send-btn {
  font-family: 'Inter Tight', 'Inter', sans-serif;
}

/* ── Chat Panel ──────────────────────────────────────────────────────────── */

.chat-panel {
  flex: 1 1 0; /* hero: take full width */
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #FAF9F5;
  border-right: 1px solid transparent;
  min-height: 0;
  overflow: hidden;
  transition: flex 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.3s ease 0.3s;
}

.main-layout.results-visible .chat-panel {
  flex: 0 0 33.333%;
  border-right-color: #e5e7eb;
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #e5e7eb;
  background: white;
  flex-shrink: 0;
}

.chat-avatar-icon {
  width: 30px;
  height: 30px;
  background: #1A1A1A;
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-panel-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1A1A1A;
  line-height: 1.2;
}

.chat-panel-subtitle {
  font-size: 0.7rem;
  color: #7d9187;
  margin-top: 1px;
}

.chat-clear-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: white;
  color: #7d9187;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.chat-clear-btn:hover {
  border-color: #1A1A1A;
  color: #1A1A1A;
}

/* Messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #d8dbd9; border-radius: 2px; }

/* Message rows */
.chat-msg-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-msg-row.user {
  align-items: flex-end;
}

.chat-msg-row.assistant {
  align-items: flex-start;
}

/* Bubbles */
.chat-bubble {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.8125rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble.user {
  background: #1A1A1A;
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
  background: #F2EFE8;
  color: #1A1A1A;
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: #F2EFE8;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c1c7c3;
  animation: typing-bounce 1.2s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Input area */
.chat-input-area {
  padding: 12px 16px 14px;
  background: #FAFAF8;
  flex-shrink: 0;
}

.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f2ec;
  border: none;
  border-radius: 12px;
  padding: 8px 8px 8px 12px;
}

.chat-input-wrap:focus-within {
  background: #f5f2ec;
}

.chat-textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.8125rem;
  font-family: inherit;
  color: #1A1A1A;
  resize: none;
  line-height: 1.5;
  max-height: 120px;
  overflow-y: auto;
}

.chat-textarea::placeholder { color: #7d9187; }

.chat-send-btn {
  width: 30px;
  height: 30px;
  background: #1A1A1A;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.chat-send-btn:hover { opacity: 0.8; }
.chat-send-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.chat-hint {
  font-size: 0.68rem;
  color: #c1c7c3;
  margin-top: 6px;
  text-align: center;
}

/* ── Agent loading (first search: pulse scene + cycling phrases) ─────────── */

.agent-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px);
  gap: 100px;
}

.pulse-scene {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid #000000;
  animation: pulseRing 8s ease-out infinite;
}

.pulse-ring-1 { animation-delay:  0s; }
.pulse-ring-2 { animation-delay: -6s; }
.pulse-ring-3 { animation-delay: -4s; }
.pulse-ring-4 { animation-delay: -2s; }

@keyframes pulseRing {
  0%   { transform: scale(0.05); opacity: 0.6; }
  27%  { transform: scale(4);    opacity: 0;   }
  100% { transform: scale(4);    opacity: 0;   }
}

.pulse-core {
  position: absolute;
  width: 13px;
  height: 13px;
  background: #1A1A1A;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.agent-phrase {
  font-size: 0.9375rem;
  color: #5a6a62;
  text-align: center;
  transition: opacity 0.25s ease;
  font-weight: 400;
}

.agent-phrase.fading {
  opacity: 0;
}

/* ── Simple loading fallback (subsequent page loads) ─────────────────────── */

.exploring-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 48px 0;
  color: #5a6a62;
  font-size: 0.9375rem;
  font-weight: 400;
}

.exploring-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.exploring-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: exploring-bounce 1.2s infinite;
}
.exploring-dots span:nth-child(2) { animation-delay: 0.2s; }
.exploring-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes exploring-bounce {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-4px); }
}

/* ── Jobs Panel ──────────────────────────────────────────────────────────── */

.jobs-panel {
  flex: 0 0 0; /* hero: completely hidden */
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: flex 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.5s ease 0.38s;
}

.main-layout.results-visible .jobs-panel {
  flex: 1 1 0;
  overflow-y: auto;
  opacity: 1;
  pointer-events: auto;
}

/* ── Job card entrance animation ─────────────────────────────────────────── */

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.job-card.animate {
  animation: cardReveal 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.jobs-panel-inner {
  padding: 20px 20px 40px;
  max-width: 960px;
}

#empty-state:not(.hidden) {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Filter bar — hidden */
.filter-bar {
  display: none !important;
}

.filter-bar-label {
  display: none;
}

/* ── Responsive: stack on narrow screens ─────────────────────────────────── */

@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
    transition: none;
  }
  .chat-panel,
  .main-layout.results-visible .chat-panel {
    flex: 0 0 auto;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    transition: none;
  }
  .main-layout:not(.results-visible) .chat-panel {
    height: 100vh;
  }
  .main-layout.results-visible .chat-panel {
    height: 320px;
  }
  .jobs-panel,
  .main-layout.results-visible .jobs-panel {
    flex: 0 0 auto;
    width: 100%;
    overflow-y: visible;
    opacity: 1;
    pointer-events: auto;
    transition: none;
  }
  .hero-title {
    font-size: 1.25rem;
    white-space: normal;
  }
}
