/*
 * A breeder's public profile (member.php): header, about, certificates, listings, timelines, follow and contact dialogs.
 * Linked from the <head> by the page ($boPageStylesheets).
 */
/* Member Profile Page Styles */
.member-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  padding: var(--space-xl) 0 var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.member-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.member-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: var(--space-lg);
  opacity: 0.8;
}

.member-breadcrumb a {
  color: white;
  text-decoration: none;
}

.member-breadcrumb a:hover {
  text-decoration: underline;
}

.member-breadcrumb .sep {
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
}

.member-breadcrumb .current {
  opacity: 0.7;
}

.member-hero-content {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  position: relative;
  z-index: 1;
}

.member-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.member-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
}

.member-avatar-fallback {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: rgba(255, 255, 255, 0.8);
}

.verified-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 36px;
  height: 36px;
  background: #059669;
  border-radius: 50%;
  border: 3px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.member-info {
  flex: 1;
  min-width: 0;
}

.member-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 var(--space-sm);
  color: white !important;
  line-height: 1.2;
}

.member-breeds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-md);
}

.breed-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: white;
  text-decoration: none;
  transition: all 0.2s ease;
}

.breed-tag:hover {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  transform: translateY(-2px);
}

.member-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.9375rem;
  opacity: 0.9;
}

.member-meta span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Hero Action Buttons */
.member-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.btn-hero-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-hero-action.primary {
  background: white;
  color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-hero-action.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-hero-action.secondary {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-hero-action.secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* Main Content */
.member-main {
  padding: var(--space-2xl) 0 var(--space-3xl);
  background: var(--bg-subtle);
}

.member-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-xl);
  align-items: start;
}

.member-content {
  min-width: 0;
}

/* Cards */
.content-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-xl);
}

.content-card:last-child {
  margin-bottom: 0;
}

.card-header-custom {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.card-header-custom h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: white;
}

.card-header-custom i {
  font-size: 1.25rem;
}

.card-body-custom {
  padding: var(--space-xl);
}

/* About Section */
.about-text {
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--text-secondary);
}

.about-text p {
  margin-bottom: 1.25rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* Certificates Grid */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-lg);
}

.cert-item {
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
}

.cert-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.cert-preview {
  aspect-ratio: 4/3;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-item {
  text-decoration: none;
  display: block;
}

.cert-info {
  padding: var(--space-md);
  text-align: center;
}

.cert-info span {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.no-certs {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
}

.no-certs i {
  font-size: 2.5rem;
  opacity: 0.3;
  margin-bottom: var(--space-md);
  display: block;
}

/* Listings Grid */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.listing-card {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  text-decoration: none;
  display: block;
  border: 1px solid var(--border-color);
}

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

.listing-image {
  aspect-ratio: 4/3;
  background: var(--bg-muted);
  position: relative;
  overflow: hidden;
}

/* A real image (not a CSS background) so tiles below the fold load lazily. */
.listing-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.listing-badge {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  background: var(--primary);
  color: white;
  padding: 0.375rem 0.875rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.listing-body {
  padding: var(--space-lg);
}

.listing-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-breed {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.listing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.listing-price {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--primary);
}

.listing-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  background: var(--bg-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}

.empty-state-icon i {
  font-size: 2.5rem;
  color: var(--text-light);
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
}

.empty-state p {
  color: var(--text-muted);
  margin: 0;
}

/* Sidebar */
.member-sidebar {
  position: sticky;
  top: 100px;
}

/* Contact Card */
.contact-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
}

.contact-header {
  text-align: center;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-lg);
}

.contact-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto var(--space-md);
  overflow: hidden;
  border: 3px solid var(--primary-light);
}

.contact-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-avatar-fallback {
  width: 100%;
  height: 100%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.contact-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.contact-location {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

/* The pale tint (--primary-light is a mid green: dark text on it was ~2:1). */
.contact-item:hover {
  background: var(--primary-subtle);
}

.contact-item i {
  width: 20px;
  text-align: center;
  color: var(--primary);
}

.contact-item a {
  color: var(--text-primary);
  text-decoration: none;
}

.contact-item a:hover {
  color: var(--primary);
}

.contact-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.btn-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
  width: 100%;
}

.btn-contact.primary {
  background: var(--primary);
  color: white;
}

.btn-contact.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-contact.secondary {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-contact.secondary:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
}

/* Subscribe Card. Deep amber so the white text reads (5.0:1 and up; the old
   light amber was 2.0-3.2:1); a white focus ring, as on other dark panels. */
.subscribe-card {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  color: white;
  margin-bottom: var(--space-lg);
  --focus-ring: #ffffff;
}

.subscribe-card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 var(--space-xs);
  color: white;
}

.subscribe-card p {
  font-size: 0.875rem;
  color: white;
  margin: 0 0 var(--space-lg);
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.subscribe-form input {
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  border: none;
  /* 16px: anything smaller makes iPhones zoom in when the field is tapped. */
  font-size: 1rem;
  background: #ffffff;
}

.subscribe-form input::placeholder {
  color: #6b7280;
}

.subscribe-form button {
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  border: none;
  background: white;
  color: #b45309;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.subscribe-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.subscribe-form button:disabled {
  opacity: 0.75;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.subscribe-form input[aria-invalid="true"] {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* The security check takes no room until Cloudflare asks for a tick, so
   cancel the column gap it would otherwise add. */
.subscribe-form .bo-turnstile:not(.is-visible) {
  margin-top: calc(-1 * var(--space-sm));
}

.subscribe-form .bo-turnstile.is-visible {
  margin-bottom: 0;
}

/* Always rendered so screen readers announce the result; empty = invisible. */
.subscribe-result {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  text-align: center;
  background: #fff;
}

.subscribe-result:empty {
  margin: 0;
  padding: 0;
}

.subscribe-result.success {
  color: #065f46;
}

.subscribe-result.error {
  color: #991b1b;
}

/* Map Card */
.map-card {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
}

.map-card-header {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.map-card-header i {
  color: var(--primary);
}

.map-container {
  height: 200px;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Share Card */
.share-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.share-title {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  display: block;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.share-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: all 0.2s ease;
  color: white;
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #000; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.copy { background: var(--text-secondary); }

.share-btn:hover {
  transform: scale(1.1);
}

/* Modal with Backdrop Blur */
#contactModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  display: none;
  overflow-y: auto;
  outline: 0;
}

/* Top-aligned, with auto margins on the dialog: centred whenever it fits,
   and on short screens (small phones, landscape, keyboard open) it starts at
   the top and scrolls, instead of being centred with its title and close
   button pushed above the screen where they can't be reached. */
#contactModal.show {
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem 0;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: auto;
  pointer-events: none;
  padding: 0 1rem;
}

#contactModal.show .modal-dialog {
  pointer-events: auto;
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal.fade .modal-dialog {
  transform: scale(0.9) translateY(-30px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(15, 23, 42, 0.6) !important;
}

body.modal-open {
  overflow: hidden;
  padding-right: 0 !important;
}

.modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  background: #ffffff;
}

.modal-header {
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  border-bottom: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  /* The site's green focus ring doesn't show on the green header. */
  --focus-ring: #ffffff;
}

.modal-close-btn {
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.modal-title {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 0;
  color: white;
}

.modal-subtitle {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0.375rem 0 0;
}

.modal-body {
  padding: var(--space-xl);
  background: #ffffff;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.modal-body .form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  transition: all 0.2s;
  background: var(--bg-subtle);
}

.modal-body .form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(34, 139, 34, 0.1);
}

/* Contact form: inline problem / saved-draft notice (BJ13) */
.contact-draft-notice {
  background: #fff7e6;
  border: 1px solid #f6c453;
  color: #7c2d12;
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.contact-draft-notice p {
  margin: 0;
}

.contact-draft-notice .btn {
  margin-top: 0.75rem;
}

.modal-body .form-control::placeholder {
  color: var(--text-light);
}

.modal-body textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.modal-body .btn-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(34, 139, 34, 0.4);
  transition: all 0.2s ease;
}

.modal-body .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 139, 34, 0.5);
}

.modal-body .btn-primary:disabled {
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

/* Responsive */
@media (max-width: 1024px) {
  .member-grid {
    grid-template-columns: 1fr;
  }

  .member-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  .member-sidebar > * {
    margin-bottom: 0;
  }

  .subscribe-card {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .member-hero {
    padding: var(--space-lg) 0;
  }

  .member-hero-content {
    flex-direction: column;
    text-align: center;
  }

  .member-breeds {
    justify-content: center;
  }

  .member-meta {
    justify-content: center;
  }

  .member-avatar, .member-avatar-fallback {
    width: 120px;
    height: 120px;
  }

  .member-sidebar {
    grid-template-columns: 1fr;
  }

  .subscribe-card {
    grid-column: span 1;
  }

  .listings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .card-body-custom {
    padding: var(--space-lg);
  }

  .contact-card {
    padding: var(--space-lg);
  }
}

/* Preview Mode Banner. Deep amber: white text on the old light amber was
   2.0-3.2:1; #b45309 is 5.0:1 (and #92400e 7.1:1). */
.preview-banner {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
  color: white;
  padding: var(--space-md) 0;
  text-align: center;
  --focus-ring: #ffffff;
}

.preview-banner .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.preview-banner-text {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
}

.preview-banner-text i {
  font-size: 1.25rem;
}

.preview-banner .btn-upgrade {
  background: white;
  color: #b45309;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-lg);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  transition: all 0.2s ease;
}

.preview-banner .btn-upgrade:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
