/* =========================
   Dynamic Upgrade Styling
   ========================= */

:root {
  --pf-bg-soft: #f7f9fc;
  --pf-card: #ffffff;
  --pf-border: rgba(20, 37, 63, 0.08);
  --pf-shadow: 0 12px 35px rgba(16, 24, 40, 0.07);
  --pf-shadow-hover: 0 18px 48px rgba(16, 24, 40, 0.12);
  --pf-text: #1b2a41;
  --pf-muted: #667085;
  --pf-primary: #149ddd;
  --pf-success: #12b76a;
  --pf-warning: #f79009;
  --pf-danger: #f04438;
}

/* shells */
.dynamic-pub-shell,
.dynamic-dashboard-shell,
.activity-shell {
  background: var(--pf-bg-soft);
  border: 1px solid var(--pf-border);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--pf-shadow);
}

.dynamic-toolbar {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border: 1px solid var(--pf-border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 8px 26px rgba(16, 24, 40, 0.04);
  margin-bottom: 24px;
}

.dynamic-toolbar .form-label {
  font-size: .87rem;
  font-weight: 700;
  color: var(--pf-text);
  margin-bottom: 8px;
}

.dynamic-toolbar .form-control,
.dynamic-toolbar .form-select {
  min-height: 46px;
  border-radius: 14px;
  border-color: rgba(20, 37, 63, 0.12);
  box-shadow: none;
}

.dynamic-toolbar .form-control:focus,
.dynamic-toolbar .form-select:focus {
  border-color: rgba(20, 157, 221, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(20, 157, 221, 0.12);
}

/* dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-grid.dashboard-grid-6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--pf-border);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--pf-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--pf-shadow-hover);
}

.metric-card-soft-warn {
  background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%);
  border-color: rgba(247, 144, 9, 0.18);
}

.metric-card-soft-danger {
  background: linear-gradient(180deg, #fff8f8 0%, #ffffff 100%);
  border-color: rgba(240, 68, 56, 0.18);
}

.metric-label {
  color: var(--pf-muted);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 10px;
}

.metric-value {
  color: var(--pf-text);
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
  margin-bottom: 10px;
}

.metric-note {
  color: var(--pf-muted);
  font-size: .9rem;
}

.dashboard-chart-card,
.activity-card,
.pub-card-dyn,
.featured-card {
  background: #fff;
  border: 1px solid var(--pf-border);
  border-radius: 24px;
  box-shadow: var(--pf-shadow);
}

.dashboard-chart-card {
  padding: 18px;
  height: 100%;
}

.dashboard-chart-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--pf-text);
  margin-bottom: 14px;
}

.chart-wrap {
  position: relative;
  min-height: 300px;
}

.dashboard-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}

/* activity */
.activity-card {
  padding: 18px;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(20, 37, 63, 0.1);
}

.activity-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 50%;
  margin-top: 6px;
  background: var(--pf-primary);
  box-shadow: 0 0 0 6px rgba(20, 157, 221, 0.12);
}

.activity-meta {
  color: var(--pf-muted);
  font-size: .84rem;
  margin-bottom: 4px;
}

.activity-title {
  color: var(--pf-text);
  font-weight: 700;
  line-height: 1.4;
}

/* featured research */
.featured-publications {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.featured-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background: linear-gradient(135deg, #f2f8ff 0%, #fbfdff 100%);
  border: 1px solid rgba(20, 157, 221, 0.18);
  box-shadow: 0 16px 40px rgba(20, 157, 221, 0.08);
  transition: transform .22s ease, box-shadow .22s ease;
}

.featured-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #149ddd 0%, #66c3ea 100%);
}

.featured-card:hover,
.pub-card-dyn:hover {
  transform: translateY(-5px);
  box-shadow: var(--pf-shadow-hover);
}

.featured-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(20, 157, 221, 0.1);
  color: #0b6ea8;
  border: 1px solid rgba(20, 157, 221, 0.15);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: .78rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: .02em;
}

.featured-title,
.pub-title-dyn {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--pf-text);
  line-height: 1.45;
  margin-bottom: 10px;
}

.featured-title {
  font-size: 1.08rem;
}

.featured-meta,
.pub-meta-dyn {
  color: var(--pf-muted);
  font-size: .92rem;
  margin-bottom: 12px;
}

.featured-badges,
.pub-badges-dyn {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

/* regular publications */
.publication-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.pub-card-dyn {
  padding: 20px;
  transition: transform .22s ease, box-shadow .22s ease;
}

/* badges */
.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef7fc;
  color: #0b6ea8;
  border: 1px solid rgba(20, 157, 221, 0.15);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: .78rem;
  font-weight: 700;
}

.badge-chip.success {
  background: #ecfdf3;
  color: #087443;
  border-color: rgba(18, 183, 106, 0.15);
}

.badge-chip.warning {
  background: #fffaeb;
  color: #b54708;
  border-color: rgba(247, 144, 9, 0.15);
}

.badge-chip.danger {
  background: #fef3f2;
  color: #b42318;
  border-color: rgba(240, 68, 56, 0.15);
}

/* abstract + details */
.pub-abstract-dyn,
.pub-extra-dyn {
  color: #344054;
  font-size: .95rem;
  line-height: 1.7;
}

.pub-abstract-dyn {
  margin-top: 2px;
}

.pub-extra-dyn {
  display: none !important;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(20, 37, 63, 0.1);
}

.pub-card-dyn.is-open .pub-extra-dyn,
.featured-card.is-open .pub-extra-dyn {
  display: block !important;
  animation: fadeSlide .28s ease;
}

.pub-extra-dyn p:last-child {
  margin-bottom: 0;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* actions + buttons */
.pub-actions-dyn {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pub-btn-dyn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(20, 37, 63, 0.10);
  background: #fff;
  color: var(--pf-text);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  box-shadow: none;
  transition: all .2s ease;
}

button.pub-btn-dyn {
  font-family: inherit;
}

.pub-btn-dyn:hover {
  color: var(--pf-primary);
  border-color: rgba(20, 157, 221, 0.30);
  background: #fff;
  transform: translateY(-1px);
  text-decoration: none !important;
}

.pub-btn-dyn.primary {
  background: var(--pf-primary);
  color: #fff;
  border-color: var(--pf-primary);
}

.pub-btn-dyn.primary:hover {
  color: #fff;
  filter: brightness(.98);
}

.featured-card .pub-btn-dyn {
  background: rgba(255, 255, 255, .92);
}

.featured-card .pub-btn-dyn.primary {
  background: var(--pf-primary);
}

/* misc */
.dynamic-section-note {
  color: var(--pf-muted);
  font-size: .93rem;
  margin-bottom: 18px;
}

.homepage-toggle-card {
  background: #fff;
  border: 1px solid var(--pf-border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--pf-shadow);
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* responsive */
@media (max-width: 1199px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid.dashboard-grid-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-row,
  .featured-publications {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .dashboard-grid,
  .dashboard-grid.dashboard-grid-6,
  .featured-publications {
    grid-template-columns: 1fr;
  }

  .dynamic-toolbar,
  .dynamic-pub-shell,
  .dynamic-dashboard-shell,
  .activity-shell {
    padding: 16px;
    border-radius: 20px;
  }

  .metric-value {
    font-size: 1.8rem;
  }

  .admin-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* clickable academic service cards */
.rp-link-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.rp-link-card:hover,
.rp-link-card:focus {
  color: inherit;
  text-decoration: none;
}

.resume-title[id] {
  scroll-margin-top: 90px;
}

/* certifications CTA snapshot */
.cert-cta-card {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid rgba(20, 37, 63, 0.08);
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 16px 34px rgba(20, 37, 63, 0.08);
  text-decoration: none !important;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.cert-cta-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 46px rgba(20, 37, 63, 0.12);
  border-color: rgba(20, 157, 221, 0.18);
}

.cert-cta-copy h3 {
  margin: 0 0 10px;
  font-size: 1.65rem;
  color: #173b6c;
}

.cert-cta-copy p {
  margin: 0 0 18px;
  color: #5b6577;
}

.cert-cta-eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 157, 221, 0.08);
  color: #149ddd;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.cert-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #149ddd;
  color: #fff;
  font-weight: 700;
}

.cert-cta-preview {
  position: relative;
  min-height: 240px;
}

.cert-mini-card {
  position: absolute;
  width: 180px;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(20, 37, 63, 0.14);
  border: 1px solid rgba(20, 37, 63, 0.08);
}

.cert-mini-card img {
  display: block;
  width: 100%;
  height: 128px;
  object-fit: cover;
}

.cert-mini-card span {
  display: block;
  padding: 10px 12px;
  font-size: .86rem;
  font-weight: 700;
  color: #173b6c;
}

.cert-mini-1 { top: 0; right: 72px; transform: rotate(-7deg); z-index: 1; }
.cert-mini-2 { top: 44px; right: 0; transform: rotate(5deg); z-index: 2; }
.cert-mini-3 { top: 104px; right: 108px; transform: rotate(-2deg); z-index: 3; }

@media (max-width: 991px) {
  .cert-cta-card { grid-template-columns: 1fr; }
  .cert-cta-preview { min-height: 300px; }
}

@media (max-width: 575px) {
  .cert-cta-card { padding: 18px; border-radius: 18px; }
  .cert-cta-copy h3 { font-size: 1.35rem; }
  .cert-cta-preview { min-height: 250px; }
  .cert-mini-card { width: 140px; }
  .cert-mini-card img { height: 96px; }
  .cert-mini-1 { right: 30px; }
  .cert-mini-2 { top: 40px; right: 0; }
  .cert-mini-3 { top: 110px; right: 56px; }
}


/* certification rendering / scrolling performance */
.portfolio .portfolio-item,
.cert-cta-card {
  content-visibility: auto;
  contain-intrinsic-size: 320px 260px;
}

.portfolio .portfolio-wrap img,
.cert-mini-card img {
  backface-visibility: hidden;
}


/* dashboard publications jump button */
.metric-card-has-jump {
  position: relative;
  padding-right: 62px;
}

.metric-jump-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease, background-color .22s ease;
}

.metric-jump-btn i {
  position: relative;
  z-index: 2;
  font-size: 1rem;
}

.metric-jump-btn-premium {
  overflow: hidden;
  color: #0f5f96;
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(225,244,255,.92));
  border: 1px solid rgba(20, 157, 221, 0.22);
  box-shadow: 0 10px 24px rgba(20, 37, 63, 0.10), inset 0 1px 0 rgba(255,255,255,.85);
}

.metric-jump-btn__shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.88) 0%, rgba(255,255,255,.14) 42%, rgba(20,157,221,.08) 100%);
  z-index: 1;
}

.metric-jump-btn-premium:hover,
.metric-jump-btn-premium:focus-visible {
  transform: translateY(-2px) scale(1.05);
  color: #fff;
  background: linear-gradient(135deg, #1bb6ff, #149ddd);
  box-shadow: 0 16px 32px rgba(20, 157, 221, 0.28);
  filter: saturate(1.05);
}

.metric-jump-btn-premium:hover .metric-jump-btn__shine,
.metric-jump-btn-premium:focus-visible .metric-jump-btn__shine {
  opacity: .18;
}

.metric-jump-btn:focus-visible {
  outline: 0;
}

@media (max-width: 767px) {
  .metric-card-has-jump {
    padding-right: 58px;
  }

  .metric-jump-btn {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
}

/* V12 dashboard publications button — internal scroll pill, not external-link style */
.metric-card-has-jump {
  padding-right: 92px;
}

.metric-jump-btn.metric-jump-btn-premium {
  width: auto;
  min-width: 70px;
  height: 34px;
  padding: 0 11px;
  gap: 6px;
  border-radius: 999px;
  color: #0f6a98;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(232,246,255,.94));
  box-shadow: 0 8px 18px rgba(20, 37, 63, 0.10), inset 0 1px 0 rgba(255,255,255,.9);
}

.metric-jump-btn__text {
  position: relative;
  z-index: 2;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1;
}

.metric-jump-btn.metric-jump-btn-premium i {
  font-size: .95rem;
}

.metric-jump-btn.metric-jump-btn-premium:hover,
.metric-jump-btn.metric-jump-btn-premium:focus-visible {
  transform: translateY(-2px);
}

@media (max-width: 575px) {
  .metric-card-has-jump {
    padding-right: 66px;
  }

  .metric-jump-btn.metric-jump-btn-premium {
    min-width: 38px;
    width: 38px;
    height: 34px;
    padding: 0;
  }

  .metric-jump-btn__text {
    display: none;
  }
}
