/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: #333;
  background: #f5f6f8;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: #0077cc; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ──────────────────────────────────────────── */
.header {
  background: rgb(0, 29, 23);
  padding: 14px 24px;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo { cursor: pointer; }
.header-logo img { display: block; }

.header-title {
  font-size: 19px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2px;
  line-height: 1.3;
  border-left: 1px solid rgba(255,255,255,0.25);
  padding-left: 16px;
}

.header-powered {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  flex-shrink: 0;
}

.header-powered a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
}

.header-powered a:hover {
  color: rgba(255,255,255,0.8);
}

.header-powered img {
  filter: brightness(0) invert(1);
  opacity: 0.7;
}

.header-powered a:hover img {
  opacity: 1;
}

.internal-badge {
  font-size: 12px;
  color: #b86800;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: #fff7eb;
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid #f0d090;
}

/* ── Container ───────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ── Hero / Search ───────────────────────────────────── */
.hero {
  text-align: center;
  padding: 36px 0 28px;
}

.hero-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a3a4a;
  margin-bottom: 6px;
}

.hero-heading {
  font-size: 16px;
  font-weight: 600;
  color: #555;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 14px;
  color: #777;
  max-width: 620px;
  margin: 0 auto 24px;
}

.source-note {
  font-size: 13px;
  color: #999;
}

.search-wrapper {
  max-width: 580px;
  margin: 0 auto;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #999;
  pointer-events: none;
}

#company-search {
  width: 100%;
  padding: 14px 40px 14px 44px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.2s;
  outline: none;
}

#company-search:focus {
  border-color: #0077cc;
}

.clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.clear-btn:hover { color: #333; }

/* ── Back to Start ──────────────────────────────────── */
.back-to-start {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #0077cc;
  text-decoration: none;
}

.back-to-start:hover {
  text-decoration: underline;
}

/* ── Results Section ─────────────────────────────────── */
.results-section {
  margin-top: 8px;
}

.results-header {
  font-size: 15px;
  font-weight: 600;
  color: #444;
  padding: 12px 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 12px;
}

.results-header a {
  font-weight: 700;
  color: #0077cc;
}

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

/* ── Company Card ────────────────────────────────────── */
.company-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}

.company-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.company-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: #e0e0e0;
  border: 2px solid #eee;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}

.company-info {
  flex: 1;
  min-width: 0;
}

.company-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.company-sector {
  color: #666;
  font-style: italic;
}

.company-domain a {
  color: #888;
}

.company-domain a:hover {
  color: #0077cc;
}

.company-link {
  flex-shrink: 0;
}

.company-link a {
  font-size: 12px;
  color: #0077cc;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Hint text hierarchy ────────────────────────────── */
.hint-small {
  font-size: 13px;
  color: #999;
  font-weight: 400;
}

.hint-big {
  font-size: 16px;
  font-weight: 600;
  color: #444;
}

/* ── Results Subheader ───────────────────────────────── */
.results-subheader {
  font-size: 14px;
  font-weight: 500;
  color: #555;
  padding: 14px 0 6px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 4px;
}

.results-subheader-empty {
  color: #999;
  font-style: italic;
  border-bottom: none;
  padding-bottom: 0;
}

/* ── Vendor Header Card ─────────────────────────────── */
.vendor-header-card {
  background: #f8fafb;
  border: 2px solid #d0dde5;
  padding: 16px 20px;
  cursor: default;
  flex-wrap: wrap;
}

.vendor-header-card:hover {
  box-shadow: none;
  transform: none;
}

.vendor-header-logo {
  width: 52px;
  height: 52px;
  font-size: 22px;
}

.vendor-header-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e0e8ed;
}

.btn-action {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-action:hover {
  opacity: 0.85;
  text-decoration: none;
}

.btn-profile {
  background: #e6f2ff;
  color: #0066bb;
}

.btn-email {
  background: #e8f5e9;
  color: #2e7d32;
}

/* ── Type Badges ─────────────────────────────────────── */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-vendor {
  background: #e6f2ff;
  color: #0066bb;
}

.badge-client {
  background: #fff2e6;
  color: #b86800;
}

.badge-both {
  background: #e8f5e9;
  color: #2e7d32;
}

/* ── No Results ──────────────────────────────────────── */
.no-results {
  margin-top: 8px;
}

.no-results-inner {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 32px 24px;
  text-align: center;
}

.no-results-inner p {
  margin-bottom: 12px;
  color: #555;
}

.no-results-detail {
  font-size: 14px;
  color: #888;
}

/* Data gap vs genuine absence styling */
.no-results-inner.data-gap {
  border-left: 4px solid #e6a817;
}

.no-results-inner.not-found {
  border-left: 4px solid #ccc;
}

/* ── Sector Insights ─────────────────────────────────── */
.insights {
  margin-top: 32px;
  margin-bottom: 32px;
}

.insights-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a3a4a;
  text-align: center;
  margin-bottom: 4px;
}

.insights-subtitle {
  text-align: center;
  font-size: 13px;
  color: #999;
  margin-bottom: 20px;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.insight-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 16px 20px;
}

.insight-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: #1a3a4a;
  margin-bottom: 10px;
  text-transform: none;
}

.insight-buyers {
  list-style: none;
}

.insight-buyers li {
  padding: 4px 0;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f5f5f5;
}

.insight-buyers li:last-child {
  border-bottom: none;
}

.insight-buyer-name {
  color: #0077cc;
  cursor: pointer;
  font-weight: 500;
}

.insight-buyer-name:hover {
  text-decoration: underline;
}

.insight-buyer-count {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}

/* ── Stats Bar ───────────────────────────────────────── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 0;
  padding: 24px 0;
  border-bottom: 1px solid #e0e0e0;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #1a3a4a;
}

.stat-label {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

/* ── Footer ──────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: #999;
  border-top: 1px solid #eee;
  background: #fff;
}

/* ── Auth Gate ───────────────────────────────────────── */
.auth-gate {
  position: fixed;
  inset: 0;
  background: rgb(0, 29, 23);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.auth-box {
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.auth-box h2 {
  font-size: 20px;
  color: #1a3a4a;
  margin-bottom: 4px;
}

.auth-box p {
  font-size: 14px;
  color: #888;
  margin-bottom: 20px;
}

.auth-box form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-box input[type="password"] {
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.auth-box input[type="password"]:focus {
  border-color: #0077cc;
}

.auth-box button {
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: rgb(0, 29, 23);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.auth-box button:hover {
  opacity: 0.85;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; gap: 8px; text-align: center; }
  .header-brand { flex-direction: column; gap: 8px; }
  .header-title { font-size: 14px; border-left: none; padding-left: 0; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 6px; }
  .internal-badge { font-size: 11px; }
  .hero { padding: 24px 0 20px; }
  .hero-title { font-size: 22px; }
  .hero-heading { font-size: 14px; }
  .hero-subtitle { font-size: 13px; }
  .stats-bar { gap: 24px; }
  .stat-number { font-size: 22px; }
  .company-card { padding: 10px 12px; }
  .insights-grid { grid-template-columns: 1fr; }
}
