#page-profile { background: var(--cream); }

.profile-header {
  background: var(--ink); padding: 48px;
  display: flex; align-items: flex-start; gap: 28px;
  position: relative; overflow: hidden;
}
.profile-header::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(245,240,232,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,240,232,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
}
.profile-av-wrap { position: relative; z-index: 1; flex-shrink: 0; }
.profile-av {
  width: 88px; height: 88px; border-radius: 24px;
  background: var(--orange); display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 2.4rem; font-weight: 900; color: white;
  overflow: hidden; border: 3px solid rgba(245,240,232,0.15);
}
.profile-av img { width: 100%; height: 100%; object-fit: cover; }

.profile-info { flex: 1; position: relative; z-index: 1; }
.profile-name {
  font-family: 'Fraunces', serif; font-size: 2rem;
  font-weight: 900; color: var(--cream); letter-spacing: -1px; margin-bottom: 4px;
}
.profile-email { color: rgba(245,240,232,0.5); font-size: 0.9rem; margin-bottom: 16px; }
.profile-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-tag {
  padding: 5px 12px; border-radius: 100px;
  background: rgba(245,240,232,0.1); border: 1px solid rgba(245,240,232,0.15);
  color: rgba(245,240,232,0.7); font-size: 0.78rem; font-weight: 500;
}
.profile-tag.orange { background: rgba(232,93,38,0.2); border-color: rgba(232,93,38,0.3); color: #f08060; }

/* LinkedIn badge in header */
.profile-linkedin-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 100px;
  background: rgba(10,102,194,0.15); border: 1px solid rgba(10,102,194,0.3);
  color: #7eb8f5; font-size: 0.8rem; font-weight: 600;
  text-decoration: none; transition: all 0.2s;
}
.profile-linkedin-badge:hover { background: #0a66c2; color: white; }

/* ── Profile body grid ── */
.profile-body { padding: 40px 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.profile-card {
  background: white; border-radius: 18px;
  border: 1.5px solid #ede8df; padding: 28px;
  position: relative;
}
.profile-card-title {
  font-family: 'Fraunces', serif; font-size: 1.1rem;
  font-weight: 700; color: var(--ink); margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}

/* ── Socials corner badge (top-right of skill card) ── */
.socials-corner-badge {
  position: absolute;
  top: 20px; right: 20px;
  display: flex; align-items: center;
  z-index: 10;
}

/* The LinkedIn pill — both the "linked" (has value) and "add" (empty) states */
.socials-li-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 100px;
  font-size: 0.74rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.socials-li-badge.linked {
  background: rgba(10,102,194,0.08); border: 1.5px solid rgba(10,102,194,0.25); color: #0a66c2;
}
.socials-li-badge.linked:hover { background: #0a66c2; color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(10,102,194,0.3); }
.socials-li-badge.add {
  background: #f5f0e8; border: 1.5px dashed var(--sand); color: var(--muted);
}
.socials-li-badge.add:hover { border-color: #0a66c2; color: #0a66c2; background: rgba(10,102,194,0.06); }

/* ── Inline popup that drops down from the badge ── */
.socials-popup {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: white; border: 1.5px solid #ede8df; border-radius: 14px;
  padding: 16px; width: 250px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.13);
  opacity: 0; transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
  z-index: 100;
}
.socials-popup.open {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: all;
}
/* Little arrow pointing up */
.socials-popup-arrow {
  position: absolute; top: -7px; right: 18px;
  width: 12px; height: 12px;
  background: white; border-top: 1.5px solid #ede8df; border-left: 1.5px solid #ede8df;
  transform: rotate(45deg); border-radius: 2px;
}
.socials-popup-title {
  font-size: 0.78rem; font-weight: 700; color: var(--ink);
  margin-bottom: 10px; display: flex; align-items: center;
}
.socials-popup-input {
  width: 100%; padding: 9px 12px; border-radius: 9px;
  border: 1.5px solid var(--sand); background: #faf8f3;
  font-family: 'DM Sans', sans-serif; font-size: 0.85rem; color: var(--ink);
  outline: none; transition: border-color 0.2s;
}
.socials-popup-input:focus { border-color: #0a66c2; box-shadow: 0 0 0 3px rgba(10,102,194,0.1); }
.socials-popup-save {
  flex: 1; padding: 8px 14px; border-radius: 8px;
  background: #0a66c2; color: white; border: none;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem; font-weight: 600; transition: background 0.2s;
}
.socials-popup-save:hover { background: #084d94; }
.socials-popup-cancel {
  padding: 8px 12px; border-radius: 8px;
  background: #f5f0e8; color: var(--muted);
  border: 1.5px solid var(--sand); cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 0.82rem; transition: all 0.2s;
}
.socials-popup-cancel:hover { color: var(--ink); border-color: var(--ink); }

/* ── Full Socials card (span full width) ── */
.profile-socials-card {
  grid-column: 1 / -1;
}

.socials-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

/* Each social row */
.social-input-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: 14px;
  border: 1.5px solid #ede8df; background: #faf8f3;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.social-input-row:focus-within { border-color: #0a66c2; box-shadow: 0 0 0 3px rgba(10,102,194,0.08); }
.social-input-row.twitter:focus-within  { border-color: #000; box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }
.social-input-row.github:focus-within   { border-color: #24292e; box-shadow: 0 0 0 3px rgba(36,41,46,0.08); }
.social-input-row.website:focus-within  { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,93,38,0.1); }

.social-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.social-icon.linkedin { background: #0a66c2; }
.social-icon.twitter  { background: #000; }
.social-icon.github   { background: #24292e; }
.social-icon.website  { background: var(--orange); }

.social-input-inner { flex: 1; min-width: 0; }
.social-input-label {
  font-size: 0.7rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px;
}
.social-input-inner input {
  width: 100%; border: none; background: none;
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem; color: var(--ink); outline: none;
}
.social-input-inner input::placeholder { color: #c0b8a8; }

.social-visit-btn {
  padding: 5px 10px; border-radius: 8px; white-space: nowrap;
  font-size: 0.74rem; font-weight: 600; cursor: pointer; text-decoration: none;
  border: 1.5px solid var(--sand); background: none; color: var(--muted);
  font-family: 'DM Sans', sans-serif; transition: all 0.2s;
}
.social-visit-btn:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.btn-save-socials {
  margin-top: 16px; padding: 12px 28px; border-radius: 12px;
  background: var(--ink); color: var(--cream);
  border: none; cursor: pointer; font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem; font-weight: 600;
  position: relative; overflow: hidden; transition: all 0.2s;
}
.btn-save-socials::before {
  content:''; position:absolute; inset:0; background:#0a66c2;
  transform:scaleX(0); transform-origin:left; transition:transform 0.3s; z-index:0;
}
.btn-save-socials:hover::before { transform:scaleX(1); }
.btn-save-socials:hover { transform:translateY(-1px); box-shadow: 0 8px 20px rgba(10,102,194,0.3); }
.btn-save-socials span { position:relative; z-index:1; }

/* ── Skill tags ── */
.skill-tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag {
  padding: 7px 14px; border-radius: 10px; font-size: 0.82rem; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.skill-tag.offer { background: rgba(232,93,38,0.1); color: var(--orange); border: 1px solid rgba(232,93,38,0.2); }
.skill-tag.want  { background: rgba(45,122,79,0.1);  color: var(--green);  border: 1px solid rgba(45,122,79,0.2); }
.skill-tag-add {
  padding: 7px 14px; border-radius: 10px; font-size: 0.82rem;
  background: #f5f0e8; color: var(--muted); border: 1.5px dashed var(--sand);
  cursor: pointer; transition: all 0.2s; font-family: 'DM Sans', sans-serif;
}
.skill-tag-add:hover { border-color: var(--orange); color: var(--orange); }

/* ── Stats ── */
.profile-stat-row { display: flex; gap: 20px; }
.profile-stat { text-align: center; flex: 1; }
.profile-stat-num { font-family: 'Fraunces', serif; font-size: 1.8rem; font-weight: 900; color: var(--orange); }
.profile-stat-label { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* ── Activity ── */
.profile-activity { list-style: none; }
.profile-activity li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid #f0ebe2; font-size: 0.88rem;
}
.profile-activity li:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex-shrink: 0; }
.activity-time { margin-left: auto; font-size: 0.78rem; color: var(--muted); }

.btn-edit-profile {
  position: absolute; top: 48px; right: 48px; z-index: 2;
  padding: 9px 20px; border-radius: 100px;
  background: rgba(245,240,232,0.1); border: 1px solid rgba(245,240,232,0.2);
  color: rgba(245,240,232,0.7); font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.btn-edit-profile:hover { background: rgba(245,240,232,0.18); color: var(--cream); }

@media (max-width: 900px) {
  .profile-header { padding: 32px 24px; flex-direction: column; }
  .profile-body { padding: 24px; grid-template-columns: 1fr; }
  .profile-socials-card { grid-column: 1 / -1; }
  .socials-grid { grid-template-columns: 1fr; }
  .btn-edit-profile { top: 24px; right: 24px; }
}
