/* ========================================================================
   Pixel Review — Member Pages (Addon)
   Purpose: Align front-end member pages with Pixel Review design language,
   without fighting the active theme. Uses Pixel Review CSS variables when
   available, and falls back gracefully when not.
   ======================================================================== */

/* Layout wrapper */
.pr-card {
  max-width: 920px;
  margin: 32px auto;
  padding: var(--sh-pad, 24px);
  border: 1px solid var(--sh-border, rgba(0,0,0,.08));
  border-radius: var(--sh-radius-lg, 16px);
  background: var(--sh-bg, #fff);
  box-shadow: var(--sh-shadow-lg, 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04));
  color: var(--sh-text, #111827);
  display: grid;
  gap: 20px;
  font-family: inherit;
}
.pr-card--auth { max-width: 480px; }

.pr-card h2, .pr-card h3 {
  margin: 0;
  line-height: 1.25;
  font-weight: 700;
  color: var(--sh-text, #111827);
}
.pr-card h2 { font-size: 1.75rem; }
.pr-card h3 { font-size: 1.25rem; margin-top: 8px; }
.pr-card p { margin: 0; line-height: 1.6; }

.pr-muted { color: var(--sh-meta, #6b7280); font-size: 0.925em; }
.pr-hr {
  margin: 12px 0;
  border: 0;
  border-top: 1px solid var(--sh-border, rgba(0,0,0,.08));
}

/* Forms */
.pr-form label {
  display: block;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--sh-text, #374151);
  font-size: 0.95rem;
}
.pr-form input[type=text],
.pr-form input[type=password],
.pr-form input[type=email],
.pr-form input[type=url],
.pr-form textarea,
.pr-form select,
.pr-form input[type=date] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--sh-border, #d1d5db);
  border-radius: var(--sh-radius-md, 8px);
  background: var(--sh-bg, #fff);
  color: var(--sh-text, #111827);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pr-form textarea { min-height: 120px; resize: vertical; }

.pr-form input:focus,
.pr-form textarea:focus,
.pr-form select:focus {
  outline: none;
  border-color: var(--sh-accent, #0ea5e9);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sh-accent, #0ea5e9) 25%, transparent);
}
.pr-form small { color: var(--sh-meta, #6b7280); display: block; margin-top: 4px; font-size: 0.875rem; }

/* Grid helpers */
.pr-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .pr-grid { grid-template-columns: 1fr 1fr; } }

/* Buttons */
.pr-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--sh-radius-md, 8px);
  border: 1px solid transparent;
  background: var(--sh-accent, #0ea5e9);
  color: #fff !important; /* Force visibility */
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.pr-button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.pr-button:active { transform: translateY(0); }

.pr-button--secondary {
  background: #fff;
  color: var(--sh-text, #374151) !important;
  border-color: var(--sh-border, #d1d5db);
}
.pr-button--secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.pr-button--danger {
  background: #dc2626;
  color: #fff !important;
}
.pr-button--wordpress {
  background: #2271b1;
  color: #fff !important;
}
.pr-button--google {
  background: #fff;
  color: #374151 !important;
  border: 1px solid #d1d5db;
}
.pr-button--google:hover {
  background: #f9fafb;
}

.pr-link { color: var(--sh-accent, #0ea5e9); text-decoration: none; font-weight: 600; transition: color 0.15s; }
.pr-link:hover { color: color-mix(in srgb, var(--sh-accent, #0ea5e9) 80%, black); text-decoration: underline; }

/* Notices / flash messages */
.pr-notice {
  padding: 12px 16px;
  border-radius: var(--sh-radius-md, 8px);
  border: 1px solid transparent;
  font-size: 0.95rem;
}
.pr-notice--success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}
.pr-notice--error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* Profile avatar */
.pr-profile__avatar {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--sh-bg-soft, #f8fafc);
  border-radius: var(--sh-radius-lg, 12px);
  border: 1px solid var(--sh-border, rgba(0,0,0,.06));
}
.pr-profile__avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.pr-profile__avatar-text { display: grid; gap: 2px; }
.pr-profile__avatar-text strong { font-size: 1.1rem; }

/* Dashboard bits */
.pr-dashboard__header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.pr-dashboard__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Tables */
.pr-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--sh-border, #e5e7eb);
  border-radius: var(--sh-radius-lg, 12px);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}
.pr-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--sh-bg, #fff);
  font-size: 0.95rem;
}
.pr-table th,
.pr-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sh-border, #f3f4f6);
  vertical-align: middle;
}
.pr-table th {
  background: var(--sh-bg-soft, #f9fafb);
  font-weight: 600;
  color: var(--sh-meta, #4b5563);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.pr-table tr:last-child td { border-bottom: 0; }
.pr-table tbody tr:hover td { background-color: #f9fafb; }

.pr-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e5e7eb;
  color: #374151;
}

/* Misc */
.pr-separator { display: flex; align-items: center; gap: 16px; margin: 8px 0; }
.pr-separator:before,
.pr-separator:after {
  content: '';
  height: 1px;
  background: var(--sh-border, #e5e7eb);
  flex: 1;
}

.pr-social-login { display: flex; flex-direction: column; gap: 12px; }
.pr-pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.pr-pagination .page-numbers {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  color: #374151;
  font-size: 0.9rem;
}
.pr-pagination .page-numbers.current {
  background: var(--sh-accent, #0ea5e9);
  color: #fff;
  border-color: var(--sh-accent, #0ea5e9);
}

.pr-details { border: 1px solid var(--sh-border, #e5e7eb); border-radius: var(--sh-radius-lg, 12px); overflow: hidden; }
.pr-details > summary { cursor: pointer; padding: 12px 16px; background: var(--sh-bg-soft, #f9fafb); font-weight: 600; }
.pr-details__content { padding: 16px; background: var(--sh-bg, #fff); }

/* Mobile fix for unreadable text/background */
@media (max-width: 768px) {
  .pr-card {
    background: #fff !important;
    color: #111827 !important;
    border: 1px solid rgba(0,0,0,.1) !important;
  }
  .pr-card h2, .pr-card h3, .pr-form label {
    color: #111827 !important;
  }
  .pr-muted {
    color: #4b5563 !important;
  }
  .pr-form input,
  .pr-form textarea,
  .pr-form select {
    background: #fff !important;
    color: #111827 !important;
    border-color: #d1d5db !important;
  }
}
