/* ═══════════════════════════════════════════
   profile.css  — Company profile page
═══════════════════════════════════════════ */

.profile-content { flex: 1; padding: 1.5rem; overflow-x: hidden; }

/* ── Hero card ── */
.hero-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 1rem; }

.hero-cover {
  height: 180px; position: relative; overflow: hidden;
  /* FIX #1: rich default gradient when no cover image */
  background: linear-gradient(135deg, #2d1b69 0%, #1a0e3d 40%, #0f2027 70%, #0a1628 100%);
}
.hero-cover::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(0,102,204,0.35) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.2) 0%, transparent 50%);
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.verified-pill {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: rgba(16,185,129,.15); border: 1px solid rgba(16,185,129,.4);
  color: #10b981 !important; font-size: 11px !important; font-weight: 500 !important;
  padding: 4px 10px; border-radius: 99px;
  display: flex; align-items: center; gap: 5px;
}
.verified-pill svg { width: 11px; height: 11px; stroke: #10b981; }

/* hero-body: logo + info side-by-side, pulled up so logo overlaps cover */
.hero-body {
  padding: 0 1.5rem 1rem;
  display: flex; gap: 1.25rem; align-items: flex-start;
  margin-top: -40px; position: relative;
}
.hero-logo {
  width: 100px; height: 100px; border-radius: 12px;
  border: 3px solid var(--bg-card); background: var(--bg-chip);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px !important; font-weight: 700 !important;
  flex-shrink: 0; overflow: hidden;
}
.hero-logo img { width: 100%; height: 100%; object-fit: contain; }
/*
  hero-body top = cover(180) - margin(40) = 140px
  padding-top 42px pushes text to 140+42=182px — 2px below cover edge
*/
.hero-info { flex: 1; min-width: 0; padding-top: 42px; padding-bottom: 4px; }
.hero-name   { font-size: 22px !important; font-weight: 700 !important; color: var(--text-primary) !important; margin-bottom: 4px; line-height: 1.2; }
.hero-sector { font-size: 14px !important; color: var(--text-secondary) !important; margin-bottom: 6px; }
.hero-city   { display: flex; align-items: center; gap: 5px; font-size: 13px !important; color: var(--text-muted) !important; }
.hero-city svg { width: 12px; height: 12px; stroke: var(--text-muted); flex-shrink: 0; }

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 1rem 1.5rem 1.25rem; }
.action-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 8px;
  font-size: 13px !important; font-weight: 500 !important;
  border: 1px solid var(--border); background: none;
  color: var(--text-secondary) !important; transition: all .12s; cursor: pointer;
  text-decoration: none !important;
}
.action-btn:hover { border-color: var(--border-hover); color: var(--text-primary) !important; }
.action-btn.primary { background: var(--accent); color: #fff !important; border-color: var(--accent); }
.action-btn.primary:hover { background: var(--accent-hover); }
.action-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Stats bar ── */
.stats-bar {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 0;
  display: flex; flex-wrap: wrap;
  margin-bottom: 1rem; align-items: stretch; overflow: hidden;
}
.stat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 1rem 1.5rem;
  border-right: 1px solid var(--border);
  flex: 1; min-width: 140px;
}
.stat-item:last-child { border-right: none; }
/* .stat-item moved into .stats-bar block above */
.stat-icon   { width: 32px; height: 32px; border-radius: 8px; background: var(--bg-chip); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 14px; height: 14px; stroke: var(--text-muted); }
.stat-label  { font-size: 11px !important; color: var(--text-muted) !important; margin-bottom: 2px; }
.stat-val    { font-size: 13px !important; color: var(--text-primary) !important; font-weight: 500 !important; }

/* ── Sticky scroll-nav ── */
.tab-nav {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  position: sticky; top: 52px; z-index: 50;
  background: var(--bg-page);
  overflow-x: auto; scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  font-size: 13px !important; color: var(--text-muted) !important;
  padding: 12px 20px; background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-weight: 400 !important; white-space: nowrap;
  transition: color .12s; cursor: pointer;
}
.tab-btn.active { color: var(--accent-light) !important; border-bottom-color: var(--accent); font-weight: 500 !important; }
.tab-btn:hover:not(.active) { color: var(--text-secondary) !important; }

/* ── Main layout ── */
.profile-body { display: grid; grid-template-columns: 1fr 280px; gap: 1.5rem; align-items: start; }
.profile-main { min-width: 0; }

/* ── Scroll sections ── */
.scroll-section { margin-bottom: 2.5rem; scroll-margin-top: 100px; }
.section-heading {
  font-size: 16px !important; font-weight: 600 !important;
  color: var(--text-primary) !important; margin-bottom: 1.25rem;
  padding-bottom: .625rem; border-bottom: 1px solid var(--border);
}

/* ── About / text blocks ── */
.about-text { font-size: 14px !important; color: var(--text-secondary) !important; line-height: 1.75; }
.about-text p { margin-bottom: .875rem; }
.key-highlights { margin-top: .875rem; padding-left: 1.25rem; }
.key-highlights li { font-size: 13px !important; color: var(--text-secondary) !important; margin-bottom: .5rem; line-height: 1.55; }

/* ── Chips ── */
.chips-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px !important; padding: 6px 13px;
  border-radius: 8px; background: var(--bg-chip);
  color: var(--text-secondary) !important; border: 1px solid var(--border);
}
.chip svg { width: 12px; height: 12px; stroke: var(--text-muted); flex-shrink: 0; }

/* View all expand button */
.expand-btn {
  font-size: 13px !important; color: var(--accent-light) !important;
  background: none; border: none; padding: 0;
  margin-top: .75rem; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.hidden-item { display: none; }

/* ── Competencies ── */
.competency-list { display: flex; flex-direction: column; gap: 10px; }
.competency-item {
  background: var(--bg-chip); border: 1px solid var(--border);
  border-radius: 10px; padding: .875rem 1rem;
}
.competency-name   { font-size: 13px !important; font-weight: 500 !important; color: var(--text-primary) !important; margin-bottom: 3px; }
.competency-issuer { font-size: 12px !important; color: var(--text-muted) !important; }

/* ── Portfolio grid ── */
.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.portfolio-item { border-radius: 10px; overflow: hidden; background: var(--bg-chip); border: 1px solid var(--border); cursor: pointer; }
.portfolio-item:hover .portfolio-img { opacity: .85; }
.portfolio-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; transition: opacity .15s; }
.portfolio-img-placeholder { width: 100%; aspect-ratio: 4/3; background: var(--bg-chip); display: flex; align-items: center; justify-content: center; }
.portfolio-img-placeholder svg { width: 24px; height: 24px; stroke: var(--border-hover); }
.portfolio-caption { padding: 7px 10px; }
.portfolio-title   { font-size: 12px !important; color: var(--text-secondary) !important; font-weight: 500 !important; margin-bottom: 2px; }
.portfolio-loc     { font-size: 11px !important; color: var(--text-muted) !important; }

/* ── Image viewer lightbox ── */
.img-viewer {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.92); z-index: 2000;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.img-viewer.open { display: flex; }
.img-viewer-inner {
  position: relative; max-width: 900px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
}
.img-viewer-img  { max-width: 100%; max-height: 80vh; border-radius: 10px; object-fit: contain; display: block; }
.img-viewer-caption { font-size: 13px !important; color: rgba(255,255,255,.75) !important; text-align: center; }
.img-viewer-count   { font-size: 12px !important; color: rgba(255,255,255,.5) !important; }
.img-viewer-close {
  position: absolute; top: -40px; right: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: none;
  color: #fff !important; font-size: 18px !important;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 1;
}
.img-viewer-prev,
.img-viewer-next {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: #fff !important; font-size: 20px !important;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s;
}
.img-viewer-prev { left: 1rem; }
.img-viewer-next { right: 1rem; }
.img-viewer-prev:hover,
.img-viewer-next:hover { background: rgba(255,255,255,.25); }

/* ── Right sidebar ── */
.profile-sidebar { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 100px; }
.sidebar-card    { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1.25rem; }
.sidebar-card-title { font-size: 14px !important; font-weight: 600 !important; color: var(--text-primary) !important; margin-bottom: 1rem; display: flex; align-items: center; gap: 7px; }
.sidebar-card-title svg { width: 15px; height: 15px; stroke: var(--accent-light); }
.detail-row   { margin-bottom: 10px; }
.detail-row:last-child { margin-bottom: 0; }
.detail-label { font-size: 11px !important; color: var(--text-muted) !important; margin-bottom: 2px; }
.detail-val   { font-size: 13px !important; color: var(--text-primary) !important; font-weight: 500 !important; }

/* Categories */
.category-item { display: flex; align-items: center; gap: 8px; font-size: 12px !important; color: var(--text-secondary) !important; margin-bottom: 7px; }
.category-dot  { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* Contacts — entire row is link */
a.contact-row, div.contact-row {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 10px; text-decoration: none !important;
}
a.contact-row:last-child, div.contact-row:last-child { margin-bottom: 0; }
a.contact-row:hover .contact-text { color: var(--accent-light) !important; }
a.contact-row:hover .contact-icon { border-color: var(--accent); }
.contact-icon { width: 28px; height: 28px; border-radius: 6px; background: var(--bg-chip); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: border-color .12s; }
.contact-icon svg { width: 13px; height: 13px; stroke: var(--text-muted); }
.contact-text { font-size: 13px !important; color: var(--text-secondary) !important; line-height: 1.4; word-break: break-all; }

/* Share */
.share-grid { display: flex; gap: 8px; }
.share-btn  { width: 36px; height: 36px; border-radius: 8px; background: var(--bg-chip); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-secondary) !important; cursor: pointer; }
.share-btn:hover { border-color: var(--border-hover); }
.share-btn svg { width: 15px; height: 15px; }

/* ── Related ── */
.related-section { margin-top: 2rem; }
.related-header  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.related-title   { font-size: 15px !important; font-weight: 600 !important; color: var(--text-primary) !important; }
.related-view-all{ font-size: 13px !important; color: var(--accent-light) !important; background: none; border: none; cursor: pointer; }
.related-grid    { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.related-card    { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; display: flex; align-items: flex-start; gap: 10px; text-decoration: none !important; }
.related-card:hover { border-color: var(--border-hover); }
.related-logo    { width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px !important; font-weight: 700 !important; flex-shrink: 0; overflow: hidden; }
.related-logo img{ width: 100%; height: 100%; object-fit: contain; }
.related-name    { font-size: 13px !important; font-weight: 500 !important; color: var(--text-primary) !important; margin-bottom: 2px; line-height: 1.3; }
.related-sector  { font-size: 11px !important; color: var(--text-muted) !important; }
.related-city    { font-size: 11px !important; color: var(--text-faint) !important; display: flex; align-items: center; gap: 3px; margin-top: 4px; }
.related-city svg{ width: 10px; height: 10px; stroke: var(--text-faint); }

/* ── Toast ── */
.toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%) translateY(70px); background: var(--bg-nav); border: 1px solid var(--border-hover); border-radius: 8px; padding: 9px 16px; font-size: 13px !important; color: var(--text-primary) !important; z-index: 3000; transition: transform .22s ease; white-space: nowrap; pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .profile-body { grid-template-columns: 1fr; }
  .profile-sidebar { position: static; display: grid; grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .profile-content { padding: 1rem; }
  .hero-logo { width: 76px; height: 76px; font-size: 22px !important; }
  .hero-name { font-size: 18px !important; }
  /* hero-body top = 180-30=150px; padding-top 32px → text at 182px, just below cover */
  .hero-body { margin-top: -30px; padding-bottom: .75rem; }
  .hero-info { padding-top: 32px; }
  .portfolio-grid { grid-template-columns: repeat(2,1fr); }
  .profile-sidebar { grid-template-columns: 1fr; }
  .related-grid   { grid-template-columns: 1fr; }
  .img-viewer-prev{ left: .25rem; }
  .img-viewer-next{ right: .25rem; }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .action-btn   { justify-content: center; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .related-grid   { grid-template-columns: 1fr; }
}

/* FIX 2: white card background for overview section */
.section-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; }
body:not(.dark-mode) .section-card { background: #ffffff; }

/* FIX 4: competency labels */
.competency-label { font-size: 10px !important; font-weight: 600 !important; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }

@media (max-width: 768px) {
  .profile-content { padding-bottom: 80px !important; }
}