/* Profiley profile/search system
   Namespaced with py- classes so it does not affect the existing home index. */

:root {
  --py-navy: #07133f;
  --py-navy-2: #0d1c50;
  --py-blue: #08aef0;
  --py-blue-2: #126ef4;
  --py-indigo: #4254f6;
  --py-purple: #6d28e9;
  --py-text: #122043;
  --py-muted: #6c7693;
  --py-line: #e7eaf3;
  --py-surface: rgba(255,255,255,.92);
  --py-shadow: 0 26px 80px rgba(24, 37, 82, .14);
  --py-radius-xl: 34px;
  --py-radius-lg: 24px;
  --py-radius-md: 18px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body.py-body {
  margin: 0;
  min-height: 100vh;
  color: var(--py-text);
  background: #f7f9ff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

body.py-body::before,
body.py-body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -3;
}

/* Different background language for each Profiley category */
body.py-category-people {
  background:
    radial-gradient(circle at 10% 20%, rgba(0,171,238,.15) 0 80px, transparent 81px),
    radial-gradient(circle at 88% 18%, rgba(109,40,233,.12) 0 140px, transparent 141px),
    linear-gradient(145deg, #fbfdff 0%, #f2f6ff 55%, #faf7ff 100%);
}
body.py-category-people::before {
  width: 420px; height: 420px; border: 1px solid rgba(18,110,244,.13);
  border-radius: 50%; left: -220px; top: 32vh;
  box-shadow: 0 0 0 65px rgba(18,110,244,.035), 0 0 0 130px rgba(109,40,233,.025);
}

body.py-category-individual {
  background:
    radial-gradient(circle at 12% 15%, rgba(8,174,240,.19), transparent 34%),
    radial-gradient(circle at 88% 25%, rgba(109,40,233,.16), transparent 36%),
    linear-gradient(135deg, #ffffff 0%, #f5f7ff 48%, #faf7ff 100%);
}
body.py-category-individual::after {
  width: 44vw; height: 44vw; right: -17vw; bottom: -18vw;
  background: repeating-radial-gradient(circle, rgba(66,84,246,.07) 0 2px, transparent 2px 17px);
  border-radius: 50%;
}

body.py-category-institution {
  background-color: #f8faff;
  background-image:
    linear-gradient(rgba(18,110,244,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18,110,244,.05) 1px, transparent 1px),
    radial-gradient(circle at 82% 8%, rgba(109,40,233,.11), transparent 30%);
  background-size: 38px 38px, 38px 38px, auto;
}

body.py-category-organisation {
  background:
    radial-gradient(ellipse at 0% 35%, rgba(8,174,240,.18), transparent 38%),
    radial-gradient(ellipse at 100% 70%, rgba(109,40,233,.14), transparent 38%),
    #f8faff;
}
body.py-category-organisation::before {
  inset: auto -10vw 12vh -10vw;
  height: 220px;
  background: repeating-linear-gradient(168deg, transparent 0 28px, rgba(66,84,246,.045) 29px 30px);
  transform: rotate(-2deg);
}

body.py-category-business {
  background:
    linear-gradient(125deg, rgba(8,174,240,.08) 0 14%, transparent 14% 34%, rgba(66,84,246,.06) 34% 52%, transparent 52% 76%, rgba(109,40,233,.06) 76% 100%),
    #fafbff;
}
body.py-category-business::after {
  width: 360px; height: 360px; right: -130px; top: 18vh;
  border-radius: 70px;
  background: linear-gradient(135deg, rgba(8,174,240,.10), rgba(109,40,233,.10));
  transform: rotate(26deg);
}

body.py-category-company {
  background:
    radial-gradient(circle at 76% 12%, rgba(66,84,246,.18), transparent 25%),
    radial-gradient(circle at 12% 78%, rgba(8,174,240,.13), transparent 28%),
    linear-gradient(160deg, #fff 0%, #f7f8ff 42%, #f9f6ff 100%);
}
body.py-category-company::before {
  width: 480px; height: 180px; left: -120px; top: 23vh;
  border-radius: 42px;
  background: linear-gradient(90deg, rgba(8,174,240,.08), rgba(109,40,233,.08));
  transform: rotate(-12deg);
}

a { color: inherit; }

.py-sitebar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid rgba(220,225,241,.72);
}

.py-sitebar-inner {
  width: min(1180px, calc(100% - 28px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.py-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: 23px;
  font-weight: 800;
  color: var(--py-navy);
  letter-spacing: -.6px;
}

.py-brand img { width: 36px; height: 36px; object-fit: contain; }
.py-brand-dot { color: var(--py-blue-2); }
.py-brand-me {
  background: linear-gradient(90deg, var(--py-blue-2), var(--py-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.py-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.py-link {
  color: var(--py-navy);
  text-decoration: none;
  font-weight: 700;
  padding: 11px 13px;
  border-radius: 12px;
}

.py-btn {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.py-btn:hover { transform: translateY(-1px); }

.py-btn-primary {
  color: #fff;
  background: linear-gradient(105deg, var(--py-blue-2), var(--py-indigo) 48%, var(--py-purple));
  box-shadow: 0 12px 28px rgba(66,84,246,.22);
}

.py-btn-soft {
  color: var(--py-navy);
  background: #f4f6ff;
  border: 1px solid #e3e7f7;
}

.py-btn-white {
  color: var(--py-navy);
  background: #fff;
  border: 1px solid #e5e8f2;
}

.py-wrap {
  width: min(1040px, calc(100% - 28px));
  margin: 34px auto 72px;
}

.py-profile-shell {
  position: relative;
  background: var(--py-surface);
  border: 1px solid rgba(255,255,255,.88);
  border-radius: var(--py-radius-xl);
  box-shadow: var(--py-shadow);
  overflow: hidden;
}

.py-cover {
  position: relative;
  aspect-ratio: 3.65 / 1;
  min-height: 180px;
  max-height: 290px;
  background:
    radial-gradient(circle at 78% 30%, rgba(255,255,255,.22), transparent 0 20%, rgba(255,255,255,.10) 20% 32%, transparent 32%),
    linear-gradient(112deg, #08afe9 0%, #0f85f5 30%, #365cf5 57%, #6435ee 100%);
  overflow: hidden;
}

.py-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.py-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 58%, rgba(7,19,63,.10));
}

.py-profile-head {
  position: relative;
  padding: 0 44px 34px;
}

.py-photo-qr-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: -72px;
  gap: 20px;
  position: relative;
  z-index: 3;
}

.py-avatar,
.py-qr-box {
  width: 148px;
  height: 148px;
  flex: 0 0 148px;
  background: #fff;
  border: 7px solid #fff;
  box-shadow: 0 14px 35px rgba(21,35,78,.16);
}

.py-avatar {
  border-radius: 28px;
  overflow: hidden;
}

.py-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #eef2ff;
}

.py-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #eef6ff, #f2efff);
  color: var(--py-indigo);
  font-size: 48px;
  font-weight: 800;
}

.py-qr-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.py-qr-box {
  border-radius: 24px;
  padding: 8px;
  overflow: hidden;
}

.py-qr-box img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.py-mini-action {
  border: 0;
  background: transparent;
  padding: 6px 8px;
  color: var(--py-indigo);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
}

.py-identity {
  padding-top: 24px;
  max-width: 720px;
}

.py-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.py-name {
  margin: 0;
  color: var(--py-navy);
  font-size: clamp(29px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -1.5px;
}

.py-verify {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  box-shadow: 0 5px 14px rgba(22,31,70,.14);
}
.py-verify--green { background: #13ae6a; }
.py-verify--gold { background: #e6a90d; }
.py-verify--red { background: #e7445a; }

.py-username {
  margin-top: 7px;
  color: var(--py-indigo);
  font-size: 16px;
  font-weight: 800;
}

.py-role {
  margin-top: 6px;
  color: #5f6a87;
  font-weight: 700;
}

.py-short {
  margin: 19px 0 0;
  color: #58647f;
  font-size: clamp(16px, 2vw, 19px);
  max-width: 760px;
}

.py-rating {
  margin-top: 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.py-rating-label {
  color: var(--py-muted);
  font-size: 14px;
  font-weight: 700;
}

.py-like-btn {
  min-height: 42px;
  border: 1px solid #dfe4f4;
  background: #fff;
  color: var(--py-navy);
  border-radius: 13px;
  padding: 0 14px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  touch-action: manipulation;
}
.py-like-btn[disabled] { opacity: .65; cursor: default; }

.py-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 44px 36px;
}

.py-action-card {
  min-height: 74px;
  border: 1px solid var(--py-line);
  background: rgba(255,255,255,.80);
  border-radius: var(--py-radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--py-navy);
  font-weight: 850;
  cursor: pointer;
  touch-action: manipulation;
}

.py-action-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--py-indigo);
  background: linear-gradient(145deg, #eff7ff, #f2edff);
}

.py-section {
  margin: 0 44px;
  padding: 34px 0;
  border-top: 1px solid var(--py-line);
}

.py-section h2 {
  margin: 0 0 16px;
  color: var(--py-navy);
  font-size: clamp(21px, 3vw, 29px);
  letter-spacing: -.5px;
}

.py-story {
  color: #44516f;
  overflow-wrap: anywhere;
}
.py-story p:first-child { margin-top: 0; }
.py-story a { color: var(--py-indigo); font-weight: 750; }

.py-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

.py-info-card {
  min-height: 76px;
  border: 1px solid var(--py-line);
  border-radius: var(--py-radius-md);
  padding: 16px;
  background: rgba(249,250,255,.74);
}

.py-info-label {
  color: var(--py-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 5px;
}

.py-info-value {
  color: var(--py-navy);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.py-info-value a { color: var(--py-indigo); text-decoration: none; }

.py-social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 11px;
}

.py-social-link {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--py-line);
  border-radius: 15px;
  text-decoration: none;
  background: #fff;
  font-weight: 820;
}

.py-social-badge {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #eef7ff, #f1ecff);
  color: var(--py-indigo);
  font-size: 12px;
  font-weight: 900;
}

.py-bottom-cta {
  margin: 0 44px 44px;
  padding: 26px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 0%, rgba(255,255,255,.18), transparent 32%),
    linear-gradient(110deg, #087df2, #4456f5 50%, #6b2ae8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.py-bottom-cta h3 { margin: 0 0 5px; font-size: 22px; }
.py-bottom-cta p { margin: 0; opacity: .9; }
.py-bottom-cta .py-btn { background: #fff; color: var(--py-navy); flex: 0 0 auto; }

.py-footer {
  width: min(1040px, calc(100% - 28px));
  margin: -40px auto 50px;
  padding-top: 62px;
  color: #77809a;
  text-align: center;
  font-size: 13px;
}

/* Search */
.py-search-wrap {
  width: min(1180px, calc(100% - 28px));
  margin: 38px auto 72px;
}

.py-search-hero {
  padding: clamp(30px, 5vw, 62px);
  border-radius: 32px;
  background:
    radial-gradient(circle at 82% 20%, rgba(255,255,255,.18), transparent 24%),
    linear-gradient(112deg, #0b8eef, #385ef5 52%, #6c2ae9);
  color: #fff;
  box-shadow: 0 24px 70px rgba(45,67,180,.18);
}

.py-search-hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1;
  letter-spacing: -2px;
}
.py-search-hero p { margin: 14px 0 0; max-width: 720px; opacity: .92; }

.py-filter-panel {
  margin-top: -23px;
  position: relative;
  z-index: 2;
  background: rgba(255,255,255,.96);
  border: 1px solid #eef0f7;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 20px 54px rgba(21,34,80,.10);
}

.py-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
}

.py-filter-grid .py-field-wide { grid-column: span 2; }

.py-field label {
  display: block;
  margin-bottom: 6px;
  color: #65708d;
  font-size: 12px;
  font-weight: 850;
}

.py-input,
.py-select,
.py-textarea {
  width: 100%;
  min-height: 47px;
  border: 1px solid #dfe4f2;
  border-radius: 13px;
  padding: 10px 12px;
  color: var(--py-navy);
  background: #fff;
  font: inherit;
  outline: 0;
}

.py-input:focus,
.py-select:focus,
.py-textarea:focus {
  border-color: var(--py-indigo);
  box-shadow: 0 0 0 4px rgba(66,84,246,.09);
}

.py-filter-actions {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.py-results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 36px 0 18px;
}

.py-results-head h2 { margin: 0; color: var(--py-navy); }
.py-results-head p { margin: 4px 0 0; color: var(--py-muted); }

.py-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
}

.py-result-card {
  background: #fff;
  border: 1px solid #edf0f6;
  border-radius: 23px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(18,32,75,.06);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.py-result-cover {
  height: 128px;
  background: linear-gradient(120deg, #08aef0, #395df5, #6d28e9);
}
.py-result-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.py-result-body {
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.py-result-avatar {
  width: 78px; height: 78px;
  margin-top: -39px;
  border: 5px solid #fff;
  border-radius: 20px;
  overflow: hidden;
  background: #eef2ff;
  box-shadow: 0 10px 24px rgba(20,34,75,.11);
}
.py-result-avatar img { width:100%; height:100%; object-fit:cover; }
.py-result-avatar .py-avatar-placeholder { font-size: 26px; }

.py-result-name {
  margin: 13px 0 3px;
  color: var(--py-navy);
  font-size: 20px;
  line-height: 1.16;
}
.py-result-user { color: var(--py-indigo); font-size: 13px; font-weight: 800; }
.py-result-desc {
  color: #68728b;
  margin: 12px 0 16px;
  min-height: 48px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.py-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  margin-bottom: 14px;
}
.py-chip {
  padding: 6px 9px;
  border-radius: 999px;
  background: #f3f5fd;
  color: #5a6684;
  font-size: 12px;
  font-weight: 770;
}
.py-result-card .py-btn { width: 100%; }

.py-pagination {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}
.py-page {
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #e0e5f2;
  display: grid;
  place-items: center;
  background: #fff;
  text-decoration: none;
  font-weight: 800;
}
.py-page.is-active { color:#fff; background:var(--py-indigo); border-color:var(--py-indigo); }

/* Admin + Beta */
.py-form-shell {
  width: min(980px, calc(100% - 28px));
  margin: 36px auto 72px;
  background: #fff;
  border: 1px solid #e9ecf4;
  border-radius: 28px;
  padding: clamp(22px, 4vw, 42px);
  box-shadow: var(--py-shadow);
}
.py-form-shell h1 { margin-top: 0; color: var(--py-navy); }
.py-form-section { padding: 26px 0; border-top: 1px solid #edf0f6; }
.py-form-section:first-of-type { border-top: 0; }
.py-form-section h2 { color: var(--py-navy); font-size: 20px; }
.py-admin-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.py-admin-grid .py-field-full { grid-column: 1 / -1; }
.py-textarea { min-height: 145px; resize: vertical; }
.py-help { color: var(--py-muted); font-size: 12px; margin-top:5px; }
.py-alert { padding: 13px 15px; border-radius: 13px; margin: 0 0 18px; }
.py-alert-good { background:#eaf9f2; color:#087844; }
.py-alert-bad { background:#fff0f2; color:#b52e43; }
.py-admin-nav { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:22px; }
.py-table-wrap { overflow-x:auto; }
.py-table { width:100%; border-collapse:collapse; min-width:720px; }
.py-table th,.py-table td { padding:12px; border-bottom:1px solid #edf0f6; text-align:left; }
.py-table th { color:#69748e; font-size:12px; text-transform:uppercase; letter-spacing:.06em; }
.py-empty {
  text-align:center;
  padding:45px 20px;
  background:#fff;
  border:1px dashed #dfe4f1;
  border-radius:20px;
  color:#6b7590;
}

@media (max-width: 900px) {
  .py-quick-actions { grid-template-columns: repeat(2,1fr); }
  .py-profile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .py-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .py-filter-grid .py-field-wide { grid-column: span 2; }
  .py-social-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 640px) {
  .py-sitebar-inner { min-height: 64px; }
  .py-link.py-hide-mobile { display:none; }
  .py-brand { font-size:20px; }
  .py-brand img { width:32px; height:32px; }
  .py-sitebar .py-btn { min-height:42px; padding:0 12px; font-size:13px; }

  .py-wrap { width: min(100% - 14px, 1040px); margin-top: 16px; }
  .py-profile-shell { border-radius: 24px; }
  .py-cover { min-height: 150px; aspect-ratio: 2.25/1; }
  .py-profile-head { padding: 0 20px 26px; }
  .py-photo-qr-row { margin-top:-48px; }
  .py-avatar,.py-qr-box { width:104px; height:104px; flex-basis:104px; border-width:5px; }
  .py-avatar { border-radius:22px; }
  .py-qr-box { border-radius:19px; padding:6px; }
  .py-identity { padding-top:19px; }
  .py-name { letter-spacing:-.7px; }

  .py-quick-actions { margin:0 20px 24px; gap:9px; }
  .py-action-card { min-height:62px; padding:10px; font-size:14px; }
  .py-action-icon { width:34px; height:34px; flex-basis:34px; }

  .py-section { margin:0 20px; padding:27px 0; }
  .py-info-grid,.py-social-grid { grid-template-columns:1fr; }
  .py-bottom-cta { margin:0 20px 24px; padding:22px; flex-direction:column; align-items:flex-start; }
  .py-bottom-cta .py-btn { width:100%; }

  .py-search-wrap { width:min(100% - 14px,1180px); margin-top:16px; }
  .py-search-hero { border-radius:24px; }
  .py-filter-panel { border-radius:20px; padding:14px; }
  .py-filter-grid { grid-template-columns:1fr; }
  .py-filter-grid .py-field-wide { grid-column:auto; }
  .py-filter-actions { align-items:stretch; }
  .py-filter-actions .py-btn { flex:1; }
  .py-results-head { align-items:flex-start; flex-direction:column; }
  .py-profile-grid { grid-template-columns:1fr; }

  .py-form-shell { width:min(100% - 14px,980px); margin-top:16px; border-radius:22px; }
  .py-admin-grid { grid-template-columns:1fr; }
  .py-admin-grid .py-field-full { grid-column:auto; }
}

@media print {
  @page { size: A4; margin: 10mm; }
  body.py-body {
    background:#fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.py-body::before,body.py-body::after,
  .py-sitebar,.py-footer,.py-bottom-cta,.py-mini-action,
  .py-like-btn,.py-action-card[data-no-print="true"] {
    display:none !important;
  }
  .py-wrap {
    width:100%;
    margin:0;
  }
  .py-profile-shell {
    box-shadow:none;
    border:1px solid #e1e4ed;
    border-radius:18px;
  }
  .py-cover { min-height:145px; }
  .py-profile-head { padding-left:26px; padding-right:26px; }
  .py-quick-actions,.py-section,.py-bottom-cta { margin-left:26px; margin-right:26px; }
  .py-section { break-inside:avoid; }
  a { text-decoration:none; }
}
