/* Codeix LMS — modern user profile (scoped to profile page only) */
@import url("https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=Manrope:wght@400;500;600;700&display=swap");

#page-user-profile {
  --cx-ink: #0f1724;
  --cx-muted: #5b6578;
  --cx-accent: #2563eb;
  --cx-accent-2: #0ea5a4;
  --cx-surface: #ffffff;
  --cx-surface-soft: #f4f7fb;
  --cx-border: rgba(15, 23, 36, 0.08);
  --cx-shadow: 0 14px 36px rgba(15, 23, 36, 0.08);
  --cx-shadow-hover: 0 18px 40px rgba(37, 99, 235, 0.12);
  --cx-radius: 18px;
  --cx-radius-sm: 12px;
  font-family: "Manrope", sans-serif;
  color: var(--cx-ink);
}

.theme-dark #page-user-profile {
  --cx-ink: #e8eef8;
  --cx-muted: #9aa6bc;
  --cx-surface: #1a2233;
  --cx-surface-soft: #121925;
  --cx-border: rgba(232, 238, 248, 0.1);
  --cx-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  --cx-shadow-hover: 0 18px 40px rgba(37, 99, 235, 0.22);
}

/* Soft page atmosphere behind profile content */
#page-user-profile #page-content,
#page-user-profile #region-main {
  position: relative;
}

#page-user-profile .userprofile {
  max-width: 1120px;
  margin: 0 auto;
}

/* —— Hero —— */
#page-user-profile .userprofile .page-context-header,
#page-user-profile .page-context-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  margin: 0 0 1.75rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--cx-border);
  border-radius: calc(var(--cx-radius) + 4px);
  background:
    radial-gradient(700px 220px at 8% 0%, rgba(37, 99, 235, 0.14), transparent 55%),
    radial-gradient(520px 200px at 92% 20%, rgba(14, 165, 164, 0.12), transparent 50%),
    linear-gradient(165deg, var(--cx-surface) 0%, var(--cx-surface-soft) 100%);
  box-shadow: var(--cx-shadow);
  animation: cx-profile-hero-in 0.55s ease-out both;
}

@keyframes cx-profile-hero-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#page-user-profile .page-context-header .page-header-image .userinitials,
#page-user-profile .page-context-header .page-header-image .userpicture {
  width: 72px !important;
  height: 72px !important;
  margin-right: 0.35rem !important;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.22);
  font-size: 1.35rem !important;
  font-weight: 700;
  font-family: "Sora", sans-serif;
  letter-spacing: 0.02em;
  background: linear-gradient(145deg, #2563eb, #0ea5a4) !important;
  color: #fff !important;
}

.theme-dark #page-user-profile .page-context-header .page-header-image .userinitials,
.theme-dark #page-user-profile .page-context-header .page-header-image .userpicture {
  border-color: rgba(26, 34, 51, 0.9);
}

#page-user-profile .page-context-header .rui-page-title,
#page-user-profile .page-context-header h1,
#page-user-profile .page-context-header .page-header-headings h1 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--cx-ink);
  background: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

#page-user-profile .page-context-header .btn,
#page-user-profile .page-context-header .singlebutton input[type="submit"],
#page-user-profile .page-context-header .singlebutton button {
  border: 1px solid var(--cx-border) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  color: var(--cx-muted) !important;
  font-family: "Manrope", sans-serif !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  padding: 0.45rem 0.95rem !important;
  box-shadow: none !important;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

#page-user-profile .page-context-header .btn:hover,
#page-user-profile .page-context-header .singlebutton input[type="submit"]:hover,
#page-user-profile .page-context-header .singlebutton button:hover {
  background: #fff !important;
  color: var(--cx-accent) !important;
  border-color: rgba(37, 99, 235, 0.28) !important;
}

.theme-dark #page-user-profile .page-context-header .btn,
.theme-dark #page-user-profile .page-context-header .singlebutton input[type="submit"],
.theme-dark #page-user-profile .page-context-header .singlebutton button {
  background: rgba(255, 255, 255, 0.06) !important;
}

/* —— Profile tree / cards —— */
#page-user-profile .userprofile .profile_tree {
  column-count: 2;
  column-gap: 1.25rem;
}

@media (min-width: 1200px) {
  #page-user-profile .userprofile .profile_tree {
    column-count: 3;
  }
}

@media (max-width: 767.98px) {
  #page-user-profile .userprofile .profile_tree {
    column-count: 1;
  }

  #page-user-profile .page-context-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.15rem 1.2rem;
  }
}

#page-user-profile .profile_tree .node_category.card {
  break-inside: avoid;
  page-break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin: 0 0 1.25rem !important;
  border: 1px solid var(--cx-border) !important;
  border-radius: var(--cx-radius) !important;
  background: var(--cx-surface) !important;
  box-shadow: var(--cx-shadow);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  animation: cx-profile-card-in 0.5s ease-out both;
}

#page-user-profile .profile_tree .node_category.card:nth-child(2) {
  animation-delay: 0.05s;
}
#page-user-profile .profile_tree .node_category.card:nth-child(3) {
  animation-delay: 0.1s;
}
#page-user-profile .profile_tree .node_category.card:nth-child(4) {
  animation-delay: 0.15s;
}
#page-user-profile .profile_tree .node_category.card:nth-child(5) {
  animation-delay: 0.2s;
}
#page-user-profile .profile_tree .node_category.card:nth-child(6) {
  animation-delay: 0.25s;
}

@keyframes cx-profile-card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: hover) {
  #page-user-profile .profile_tree .node_category.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--cx-shadow-hover);
    border-color: rgba(37, 99, 235, 0.22) !important;
  }
}

#page-user-profile .profile_tree .node_category .card-body {
  padding: 1.15rem 1.25rem 1.2rem !important;
}

#page-user-profile .profile_tree .node_category .card-title {
  margin: 0 0 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--cx-border);
  font-family: "Sora", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cx-muted);
  line-height: 1.3;
}

#page-user-profile .profile_tree .node_category ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#page-user-profile .profile_tree .node_category li {
  padding: 0;
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

#page-user-profile .profile_tree .node_category li.contentnode > a,
#page-user-profile .profile_tree .node_category li > a {
  display: block;
  padding: 0.45rem 0.6rem;
  margin: 0 -0.35rem;
  border-radius: var(--cx-radius-sm);
  color: var(--cx-ink);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

#page-user-profile .profile_tree .node_category li.contentnode > a:hover,
#page-user-profile .profile_tree .node_category li > a:hover {
  background: rgba(37, 99, 235, 0.07);
  color: var(--cx-accent);
  text-decoration: none;
}

.theme-dark #page-user-profile .profile_tree .node_category li.contentnode > a:hover,
.theme-dark #page-user-profile .profile_tree .node_category li > a:hover {
  background: rgba(37, 99, 235, 0.18);
}

/* Definition lists (email, country, timezone, login activity) */
#page-user-profile .profile_tree .node_category dl {
  margin: 0.15rem 0 0.55rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.15rem 0.75rem;
}

#page-user-profile .profile_tree .node_category dt {
  margin: 0.45rem 0 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cx-muted);
}

#page-user-profile .profile_tree .node_category dd {
  margin: 0.1rem 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--cx-ink);
  word-break: break-word;
}

#page-user-profile .profile_tree .node_category dd a {
  color: var(--cx-accent);
  text-decoration: none;
  font-weight: 600;
}

#page-user-profile .profile_tree .node_category dd a:hover {
  color: var(--cx-accent-2);
  text-decoration: underline;
}

/* Edit profile CTA */
#page-user-profile .profile_tree .editprofile {
  margin: 0 0 1rem !important;
  text-align: left !important;
}

#page-user-profile .profile_tree .editprofile a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cx-accent), #3b82f6 55%, var(--cx-accent-2));
  color: #fff !important;
  font-family: "Sora", sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

#page-user-profile .profile_tree .editprofile a:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.34);
  color: #fff !important;
}

#page-user-profile .profile_tree .viewmore {
  text-align: left !important;
  margin-top: 0.35rem;
}

#page-user-profile .profile_tree .viewmore a {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cx-accent);
}

/* Description / bio */
#page-user-profile .userprofile .description {
  margin: 0 0 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  background: var(--cx-surface);
  box-shadow: var(--cx-shadow);
  color: var(--cx-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Reduce default gap above tree when hero sits above */
#page-user-profile .page-context-header + .profile_tree {
  margin-top: 0;
}
