/* =================================================================
   User Profile — hero, panels, applications, documents
   ================================================================= */

.jb-profile {
  display: grid;
  gap: 24px;
}

/* ---- Hero ---- */
.jb-profile__hero {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 3vw, 36px);
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--jb-border, rgba(255,255,255,.08)) 88%, transparent);
  background: var(--jb-surface, rgba(20, 20, 24, .85));
  display: grid;
  gap: 24px;
}
.jb-profile__hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% -10%, rgba(255, 59, 59, .25), transparent 55%),
    linear-gradient(135deg, rgba(255, 59, 59, .08), transparent 60%);
  pointer-events: none;
}

.jb-profile__identity {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}
.jb-profile__avatar {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--jb-primary, #ff3b3b) 35%, transparent);
  box-shadow: 0 14px 30px -10px rgba(255, 59, 59, .35);
  flex-shrink: 0;
}
.jb-profile__avatar--initials {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 59, 59, .85), rgba(255, 120, 120, .65));
  color: #fff;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -.02em;
}

.jb-profile__name {
  margin: 0;
  font-size: clamp(1.8rem, 2.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
}

.jb-profile__handles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .92rem;
  opacity: .85;
}
.jb-profile__handle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}
.jb-profile__handle .material-symbols-rounded { font-size: 16px; opacity: .65; }
.jb-profile__handle--link:hover { color: var(--jb-primary, #ff3b3b); }
.jb-profile__handle--link:hover .material-symbols-rounded { opacity: 1; color: var(--jb-primary, #ff3b3b); }

.jb-profile__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.jb-profile__role-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
}
.jb-profile__role-chip .material-symbols-rounded { font-size: 14px; }

.jb-profile__edit-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  color: inherit;
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s ease, border-color .2s ease;
}
.jb-profile__edit-link:hover {
  background: rgba(255, 59, 59, .15);
  border-color: rgba(255, 59, 59, .4);
}
.jb-profile__edit-link .material-symbols-rounded { font-size: 16px; }

.jb-profile__quick-facts {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.jb-profile__quick-facts > div {
  display: grid;
  gap: 4px;
}
.jb-profile__quick-facts dt {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  opacity: .55;
}
.jb-profile__quick-facts dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

/* ---- Two-column layout ---- */
.jb-profile__layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 22px;
  align-items: start;
}
.jb-profile__main,
.jb-profile__aside {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.jb-profile__aside {
  position: sticky;
  top: 18px;
  align-self: start;
}

/* ---- Panel ---- */
.jb-profile-panel {
  padding: clamp(18px, 2vw, 24px);
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--jb-border, rgba(255,255,255,.08)) 88%, transparent);
  background: var(--jb-surface, rgba(20, 20, 24, .85));
  display: grid;
  gap: 16px;
}
.jb-profile-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.jb-profile-panel__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.jb-profile-panel__pill {
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .78rem;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  white-space: nowrap;
}
.jb-profile-panel__pill--accent {
  background: rgba(255, 59, 59, .14);
  border-color: rgba(255, 59, 59, .25);
  color: #ff7676;
}
.jb-profile-panel__empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
  border: 1px dashed rgba(255, 255, 255, .08);
  opacity: .75;
  font-size: .9rem;
  margin: 0;
}
.jb-profile-panel__empty .material-symbols-rounded { font-size: 20px; opacity: .7; }

/* ---- Applications ---- */
.jb-profile__applications {
  display: grid;
  gap: 12px;
}
.jb-profile-application {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: transform .2s ease, border-color .2s ease;
}
.jb-profile-application:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--jb-primary, #ff3b3b) 35%, rgba(255,255,255,.06));
}
.jb-profile-application__main { display: grid; gap: 6px; }
.jb-profile-application__role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  width: fit-content;
}
.jb-profile-application__role .material-symbols-rounded { font-size: 14px; }
.jb-profile-application__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.jb-profile-application__meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .8rem;
  opacity: .75;
}
.jb-profile-application__meta li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.jb-profile-application__meta .material-symbols-rounded { font-size: 14px; opacity: .65; }

.jb-profile-application__side {
  display: grid;
  gap: 8px;
  justify-items: end;
}
.jb-profile-application__status {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}
.jb-profile-application__status--submitted { background: rgba(59, 130, 246, .16); color: #93c5fd; }
.jb-profile-application__status--reviewing { background: rgba(245, 158, 11, .16); color: #fcd34d; }
.jb-profile-application__status--interview { background: rgba(168, 85, 247, .16); color: #d8b4fe; }
.jb-profile-application__status--accepted  { background: rgba(34, 197, 94, .16);  color: #86efac; }
.jb-profile-application__status--rejected  { background: rgba(239, 68, 68, .16);  color: #fca5a5; }
.jb-profile-application__status--withdrawn { background: rgba(255, 255, 255, .08); color: rgba(255,255,255,.65); }

.jb-profile-application__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--jb-primary, #ff3b3b);
  text-decoration: none;
}
.jb-profile-application__link .material-symbols-rounded { font-size: 14px; }

/* ---- Documents ---- */
.jb-profile__documents {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.jb-profile-document {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: border-color .2s ease;
}
.jb-profile-document:hover {
  border-color: color-mix(in srgb, var(--jb-primary, #ff3b3b) 35%, rgba(255,255,255,.06));
}
.jb-profile-document__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 59, 59, .12);
  color: #ff7676;
  display: grid;
  place-items: center;
}
.jb-profile-document__icon .material-symbols-rounded { font-size: 22px; }
.jb-profile-document__body { display: grid; gap: 2px; min-width: 0; }
.jb-profile-document__name {
  font-size: .95rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jb-profile-document__meta {
  font-size: .78rem;
  opacity: .65;
}
.jb-profile-document__action {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  color: inherit;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
}
.jb-profile-document__action:hover {
  background: rgba(255, 59, 59, .15);
  border-color: rgba(255, 59, 59, .4);
}
.jb-profile-document__action .material-symbols-rounded { font-size: 20px; }

/* ---- Aside stats (Duolingo etc.) ---- */
.jb-profile__stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.jb-profile__stats li {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  display: grid;
  gap: 2px;
  text-align: center;
}
.jb-profile__stat-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  opacity: .55;
}
.jb-profile__stats strong {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.jb-profile__lang-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---- Socials ---- */
.jb-profile__socials {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.jb-profile__socials li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
}
.jb-profile__social-provider {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: .9rem;
}
.jb-profile__social-provider .material-symbols-rounded { font-size: 18px; opacity: .65; }
.jb-profile__social-link {
  color: var(--jb-primary, #ff3b3b);
  text-decoration: none;
}
.jb-profile__social-link .material-symbols-rounded { font-size: 18px; }

/* ---- Companies ---- */
.jb-profile__companies {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.jb-profile__companies li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  font-weight: 600;
  font-size: .9rem;
}
.jb-profile__company-link {
  color: var(--jb-primary, #ff3b3b);
  text-decoration: none;
}
.jb-profile__company-link .material-symbols-rounded { font-size: 18px; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .jb-profile__layout { grid-template-columns: 1fr; }
  .jb-profile__aside { position: static; top: auto; }
}

@media (max-width: 720px) {
  .jb-profile__identity {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
  .jb-profile__handles { justify-content: center; }
  .jb-profile__roles { justify-content: center; }
  .jb-profile-application { grid-template-columns: 1fr; }
  .jb-profile-application__side { justify-items: flex-start; }
}

/* Candidate hero → profile link (admin candidature view) */
.jb-app-hero__name-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  width: fit-content;
  transition: color .2s ease;
}
.jb-app-hero__name-link .material-symbols-rounded {
  font-size: 22px;
  opacity: .55;
  transition: opacity .2s ease, transform .2s ease;
}
.jb-app-hero__name-link:hover { color: var(--jb-primary, #ff3b3b); }
.jb-app-hero__name-link:hover .material-symbols-rounded {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* =========================================================================
   Parcours professionnel (public/admin profile panel)
   ========================================================================= */
.jb-profile__experiences {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.jb-profile__experience {
  padding: 12px 0;
}

.jb-profile__experience + .jb-profile__experience {
  border-top: 1px solid var(--jb-border, rgba(0, 0, 0, .08));
}

.jb-profile__experience .jb-exp-item__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
