@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');
@import url('https://unpkg.com/@tabler/icons-webfont@latest/tabler-icons.min.css');

/* ==========================================================================
   Member Dashboard – page template styles
   Shares the pdnet design token system with effective-practice-hub.css.
   Enqueue alongside (or after) effective-practice-hub.css so the :root
   tokens are already available.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tabler icons (enqueue the webfont in functions.php if not already loaded)
   -------------------------------------------------------------------------- */
/* wp_enqueue_style( 'tabler-icons', 'https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/tabler-icons.min.css' ); */

/* --------------------------------------------------------------------------
   Dashboard layout – stacked sections with consistent gap
   -------------------------------------------------------------------------- */
.page-wrap,
.page-wrap * {
  font-family: 'Poppins', sans-serif !important;
}

.page-wrap .ti {
  font-family: 'tabler-icons' !important;
}

.page-wrap > section:not(:first-child) {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.dash-section-label {
  display: inline-block;
  background: linear-gradient(135deg, var(--pd-purple), var(--pd-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  margin-top:30px;
}

.page-wrap > section:nth-child(2) .dash-section-label {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   Welcome banner
   -------------------------------------------------------------------------- */
.title-banner--welcome {
  text-align: left;
  padding: clamp(26px, 4vw, 44px);
}

.dash-welcome-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.dash-welcome__name {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.dash-welcome__name span {
  opacity: 0.85;
}

.dash-welcome__sub {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
}

.dash-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   News grid – horizontal cards, max 4 columns
   -------------------------------------------------------------------------- */
.dash-news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.dash-news-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 22px rgba(63, 68, 72, 0.06);
}

.dash-news-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--pd-purple);
  margin-bottom: 10px;
}

.dash-news-dot.amber { background: var(--standard-orange); }
.dash-news-dot.teal  { background: var(--standard-green); }
.dash-news-dot.blue  { background: var(--pd-blue); }

.dash-news-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.dash-news-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.dash-news-title a {
  color: inherit;
  text-decoration: none;
}

.dash-news-title a:hover {
  color: var(--pd-purple);
  text-decoration: underline;
}

.dash-news-meta {
  font-size: 0.78rem;
  color: var(--pd-grey);
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dash-news-meta .ti {
  font-size: 0.78rem;
}

.dash-news-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}

.dash-news-excerpt {
  font-size: 0.82rem;
  color: var(--pd-grey);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.dash-news-readmore {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pd-purple);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 8px;
}

.dash-news-readmore .ti {
  font-size: 0.78rem;
}

.badge-new      { background: var(--pd-purple-soft);       color: var(--pd-purple-dark); }
.badge-event    { background: var(--standard-green-soft);  color: var(--standard-green); }
.badge-resource { background: var(--standard-orange-soft); color: var(--standard-orange); }

/* --------------------------------------------------------------------------
   Quick-access tiles
   -------------------------------------------------------------------------- */
.dash-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.dash-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 22px rgba(63, 68, 72, 0.06);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dash-tile:hover,
.dash-tile:focus {
  border-color: var(--pd-blue);
  box-shadow: 0 12px 28px rgba(0, 168, 232, 0.14);
  transform: translateY(-2px);
}

.dash-tile__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Tile icon colour variants */
.ti-purple { background: var(--pd-purple-soft);       color: var(--pd-purple); }
.ti-teal   { background: var(--standard-green-soft);  color: var(--standard-green); }
.ti-amber  { background: var(--standard-orange-soft); color: var(--standard-orange); }
.ti-coral  { background: #faece7;                     color: #993c1d; }
.ti-blue   { background: var(--pd-blue-soft);         color: var(--pd-blue-dark); }
.ti-green  { background: #eaf3de;                     color: #3b6d11; }

.dash-tile__name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.dash-tile__desc {
  font-size: 0.78rem;
  color: var(--pd-grey);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Training cards
   -------------------------------------------------------------------------- */
.dash-training-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.dash-training-card {
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 22px rgba(63, 68, 72, 0.06);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}

.dash-training-card:hover {
  border-color: var(--pd-blue);
  box-shadow: 0 12px 28px rgba(0, 168, 232, 0.14);
  transform: translateY(-2px);
}

.dash-training-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.dash-training-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.dash-training-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.dash-training-sub {
  font-size: 0.78rem;
  color: var(--pd-grey);
  margin-top: 2px;
}

.dash-progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.dash-progress-label span {
  font-size: 0.72rem;
  color: var(--pd-grey);
  font-weight: 600;
}

.dash-progress-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--pd-grey-soft);
  overflow: hidden;
}

.dash-progress-fill {
  height: 5px;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.dash-btn-start {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: var(--pd-purple, #6f2da8);
  color: var(--white, #ffffff);
  font: 700 0.78rem/1 inherit;
  cursor: pointer;
  transition: opacity 0.15s ease;
  align-self: flex-start;
}

.dash-training-card .dash-btn-start {
  background: var(--pd-purple, #6f2da8) !important;
  color: #fff !important;
  border: none !important;
}

.dash-btn-start:hover {
  opacity: 0.88;
}

.dash-btn-start .ti {
  font-size: 0.75rem;
}

/* Level 2 card variant – purple accent to distinguish from Level 1 */
.dash-training-card--l2 {
  border-top: 3px solid var(--pd-purple);
}

/* Level 2 link tile – matches training card height and sits in the same grid */
.dash-tile--l2 {
  align-content: start;
  border-top: 3px solid var(--pd-purple);
  min-height: 160px;
}

/* --------------------------------------------------------------------------
   Level 2 upsell card (non-L2 members)
   -------------------------------------------------------------------------- */
.dash-training-card--l2-upsell {
  cursor: default;
  border-top: 3px solid var(--pd-purple);
}

.dash-training-card--l2-upsell:hover {
  transform: none;
  border-color: var(--line);
  border-top-color: var(--pd-purple);
  box-shadow: 0 8px 22px rgba(63, 68, 72, 0.06);
}

.dash-training-desc {
  font-size: 0.82rem;
  color: var(--pd-grey);
  line-height: 1.6;
  margin: 0.5rem 0;
}

.dash-training-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0.5rem 0;
}

.dash-training-pills span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pd-purple);
  background: var(--pd-purple-soft);
  border-radius: 999px;
  padding: 3px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dash-training-pills span .ti {
  font-size: 0.72rem;
}

.dash-training-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.dash-training-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.dash-training-price span {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--pd-grey);
}

.dash-btn-purchase {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pd-purple);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.dash-btn-purchase:hover {
  opacity: 0.88;
  color: var(--white);
}

.dash-btn-purchase .ti {
  font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Activity stats
   -------------------------------------------------------------------------- */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.dash-stat-card {
  padding: 20px;
  background: var(--pd-grey-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.dash-stat-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pd-grey);
  margin-bottom: 8px;
}

.dash-stat-label .ti {
  font-size: 0.85rem;
}

.dash-stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.dash-stat-sub {
  font-size: 0.78rem;
  color: var(--pd-grey);
  margin-top: 5px;
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */
.dash-empty {
  color: var(--pd-grey);
  font-size: 0.9rem;
  padding: 16px 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .dash-news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .dash-news-grid,
  .dash-tiles-grid,
  .dash-training-grid,
  .dash-stats-grid {
    grid-template-columns: 1fr;
  }

  .dash-tiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-welcome {
    flex-direction: row;
  }
}

/* --------------------------------------------------------------------------
   My profile section
   -------------------------------------------------------------------------- */

/* Avatar */
.dash-profile-avatar {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--pd-purple);
    border: 2px solid rgba(255,255,255,.35);
    box-shadow: 0 0 0 3px rgba(111,45,168,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    transition: box-shadow .2s ease;
}
.dash-profile-avatar:hover { box-shadow: 0 0 0 3px var(--pd-purple); }
.dash-profile-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.dash-profile-avatar__initials {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}
.dash-profile-avatar__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s ease;
    border-radius: 50%;
    color: #fff;
    font-size: 1rem;
}
.dash-profile-avatar:hover .dash-profile-avatar__overlay { opacity: 1; }

/* Fields layout */
.dash-profile-fields { margin-top: 16px; }

.dash-profile-section-heading {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--pd-purple);
    margin: 20px 0 12px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.dash-profile-fields > .dash-profile-section-heading:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.dash-profile-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.dash-profile-field {
    margin-top: 30px;
    margin-bottom: 20px;
}
.dash-profile-field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--pd-grey);
    margin-bottom: 5px;
}
.page-wrap .dash-profile-field input[type="text"]:focus,
.page-wrap .dash-profile-field input[type="email"]:focus,
.page-wrap .dash-profile-field select:focus {
    border-color: var(--pd-purple) !important;
    box-shadow: 0 0 0 3px rgba(111,45,168,.12) !important;
    outline: none;
}

.dash-profile-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}
.dash-profile-checkbox-row input[type="checkbox"] {
    accent-color: var(--pd-purple);
    width: 16px; height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}
.dash-profile-checkbox-row label {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--pd-grey);
    line-height: 1.5;
    margin: 0;
    cursor: pointer;
}

.dash-profile-radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.dash-profile-radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: var(--white);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink);
    transition: border-color .2s ease, background .2s ease;
}
.dash-profile-radio-option:has(input:checked) {
    border-color: var(--pd-purple);
    background: var(--pd-purple-soft);
}
.dash-profile-radio-option input[type="radio"] {
    accent-color: var(--pd-purple);
    width: 14px; height: 14px;
    flex-shrink: 0;
}

.dash-profile-save-status {
    font-size: 0.82rem;
    font-weight: 600;
}
.dash-profile-save-status.success { color: var(--standard-green); }
.dash-profile-save-status.error   { color: #c03030; }

@media (max-width: 600px) {
    .dash-profile-row-2 { grid-template-columns: 1fr; }
}