/* Profile Page – elements, layout, and theme aligned with main "/" (landing)
   Uses: var(--primary), var(--primary-dark), var(--dark), var(--border), var(--light), var(--gray)
*/

/* ========== HERO (page-header) ========== */
.profile-hero .profile-hero-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.profile-hero-avatar {
  flex-shrink: 0;
}

.profile-hero .avatar-xl {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.profile-hero-body {
  flex: 1;
  min-width: 200px;
}

.profile-hero-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

/* Hero: name + actions in body */
.profile-hero-body .profile-hero-actions { margin-top: 0.75rem; }

.profile-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Meta card: पुस्ता, लिङ्ग, ठेगाना, Same Family – rightmost on desktop, below avatar on mobile */
.profile-hero-meta-card {
  flex-shrink: 0;
  min-width: 200px;
  max-width: 280px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.9);
  overflow: hidden;
  order: 3;
}

.hero-meta-card-inner { padding: 1rem 1.25rem; }

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.hero-meta-row:last-child { margin-bottom: 0; }

.hero-meta-row.hero-meta-relationship {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #e2e8f0);
  margin-bottom: 0;
}

.profile-hero-meta-card .hero-meta-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 70px;
}

.profile-hero-meta-card .hero-meta-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray, #64748b);
  margin-bottom: 0.15rem;
}

.profile-hero-meta-card .hero-meta-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark, #0f172a);
}

.profile-hero-meta-card .hero-meta-item.hero-meta-address { min-width: 100%; }
.profile-hero-meta-card .hero-meta-item.hero-meta-address .hero-meta-value { font-size: 0.9rem; }

/* Relationship badge – inside card */
.hero-relationship-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 2px solid;
}

.hero-relationship-badge.same {
  background: rgba(22, 163, 74, 0.12);
  color: var(--primary);
  border-color: var(--primary);
}

.hero-relationship-badge.inlaw {
  background: rgba(234, 179, 8, 0.15);
  color: #b45309;
  border-color: var(--accent, #eab308);
}

.hero-relationship-badge.other {
  background: var(--light, #f8fafc);
  color: var(--dark, #0f172a);
  border-color: var(--border, #e2e8f0);
}

.profile-hero-actions .btn { white-space: nowrap; }

/* ========== SECTION TITLES (card headers) ========== */
.profile-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark, #0f172a);
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(22, 163, 74, 0.25);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-section-title i { color: var(--primary); }

.profile-section-title.mb-0 { margin-bottom: 0; }

/* ========== PROFILE CARDS (match featured-card / member-card) ========== */
.profile-page .profile-card {
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 16px;
  transition: all 0.3s;
  overflow: hidden;
  background: #fff;
}

.profile-page .profile-card:hover {
  border-color: var(--primary);
  box-shadow: 0 12px 32px rgba(22, 163, 74, 0.15);
  transform: translateY(-2px);
}

.profile-page .profile-card .card-body { padding: 1.5rem 1.75rem; }

.profile-completeness-card {
  border: 2px solid var(--border, #e2e8f0) !important;
  border-left: 4px solid var(--primary) !important;
}
.profile-completeness-card:hover { transform: none; }

.profile-progress {
  height: 20px;
  border-radius: 999px;
  background: var(--light, #f8fafc);
  overflow: hidden;
}
.profile-progress .progress-bar {
  border-radius: 999px;
  transition: width 0.4s ease;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 20px;
}
.profile-progress .progress-bar.bg-success { background-color: var(--primary) !important; }
.profile-completeness-badge { font-size: 0.95rem; }

.badge-sm { font-size: 0.7rem !important; }

/* Female icon (replaces inline style) */
.profile-page .icon-female { color: #ec4899; }

/* ========== ABOUT LIST ========== */
.profile-about { margin: 0; }

.profile-about li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
  transition: background 0.2s;
}

.profile-about li:hover { background: rgba(22, 163, 74, 0.04); padding-left: 0.5rem; border-radius: 8px; }

.profile-about li:last-child { border-bottom: none; }

.profile-about li span {
  color: var(--gray, #64748b);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 130px;
}

.profile-about li strong { font-weight: 600; color: var(--dark, #0f172a); text-align: right; flex: 1; }

.profile-about li strong a { color: var(--primary); text-decoration: none; }
.profile-about li strong a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ========== OVERVIEW ========== */
.overview-facts .fw-semibold a { color: var(--primary); }
.overview-facts .fw-semibold a:hover { color: var(--primary-dark); }

/* ========== EMPTY STATES ========== */
.profile-empty-state {
  padding: 2rem 1.5rem;
  border-radius: 16px;
  border: 2px dashed var(--border, #e2e8f0);
  background: rgba(22, 163, 74, 0.04);
}
.profile-empty-title { font-size: 2.5rem; font-weight: 700; }
.profile-empty-title-sm { font-size: 1.75rem; }

/* ========== FILTER BAR + SEARCH ========== */
.profile-filter-bar .nav-pills { gap: 0.25rem; }
.profile-search-wrap {
  max-width: 220px;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.profile-search-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}
.profile-search-wrap .input-group-text {
  border: none;
  border-right: 1px solid var(--border, #e2e8f0);
  background: var(--light, #f8fafc);
  color: var(--gray, #64748b);
}
.profile-search-wrap .form-control {
  border: none !important;
  box-shadow: none !important;
}
.profile-search-wrap .form-control:focus {
  box-shadow: none !important;
}

/* ========== ADDRESS BLOCKS (Contact) ========== */
.profile-address-block {
  border-radius: 12px !important;
  border: 2px solid var(--border, #e2e8f0) !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.profile-address-block:hover {
  border-color: rgba(22, 163, 74, 0.4) !important;
  box-shadow: 0 2px 12px rgba(22, 163, 74, 0.08);
}

/* ========== TABS / NAV PILLS ========== */
.profile-tabs-wrap { margin-bottom: 1.25rem; }

.profile-nav-pills {
  background: rgba(22, 163, 74, 0.08);
  padding: 0.5rem;
  border-radius: 14px;
  gap: 0.35rem;
  border: 2px solid rgba(22, 163, 74, 0.25);
  flex-wrap: wrap;
}

.profile-nav-pills .nav-link {
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  color: var(--dark, #0f172a);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.25s;
  border: none;
}

.profile-nav-pills .nav-link:hover {
  background: rgba(22, 163, 74, 0.15);
  color: var(--primary);
}

.profile-nav-pills .nav-link.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 12px rgba(22, 163, 74, 0.4);
}

.profile-nav-pills .nav-link .badge,
.profile-nav-pills .nav-link .profile-tab-badge { font-size: 0.7rem; }
.profile-tab-badge {
  background: var(--primary) !important;
  color: #fff !important;
}
.profile-nav-pills .nav-link.active .profile-tab-badge {
  background: rgba(255, 255, 255, 0.3) !important;
  color: #fff !important;
}

/* Sub-pills (Children/Siblings/Cousins filters) */
.profile-page #childrenRole .nav-link.active,
.profile-page #siblingsRole .nav-link.active,
.profile-page #cousinsRole .nav-link.active { background: var(--primary); color: #fff; }

.profile-page #childrenRole .nav-link:hover,
.profile-page #siblingsRole .nav-link:hover,
.profile-page #cousinsRole .nav-link:hover { background: rgba(22, 163, 74, 0.1); color: var(--primary); }

/* ========== CHILD / SIBLING / COUSIN CARDS ========== */
.profile-page .card.gender-male,
.profile-page .card.gender-female {
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 14px;
  transition: all 0.3s;
}

.profile-page .card.gender-male:hover,
.profile-page .card.gender-female:hover {
  border-color: var(--primary);
  box-shadow: 0 12px 32px rgba(22, 163, 74, 0.15);
  transform: translateY(-4px);
}

.profile-page #childrenGrid .img-fluid,
.profile-page #siblingsGrid .img-fluid,
.profile-page #cousinsGrid .img-fluid {
  height: 130px;
  width: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* Membership & Board list items */
.profile-page .profile-card .list-group-item {
  padding: 1rem 0;
  border-color: var(--border, #e2e8f0);
  transition: background 0.2s;
}
.profile-page .profile-card .list-group-item:hover {
  background: rgba(22, 163, 74, 0.04);
}
.profile-page .profile-card .list-group-item:last-child { border-bottom: none; }

/* ========== GALLERY ========== */
.profile-page .photo-card {
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 14px;
  transition: all 0.3s;
  overflow: hidden;
}

.profile-page .photo-card:hover {
  border-color: var(--primary);
  box-shadow: 0 12px 32px rgba(22, 163, 74, 0.15);
}

.profile-photo-img {
  height: 200px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

/* ========== FORM CONTROLS ========== */
.profile-page .form-control {
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-page .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
  outline: none;
}

/* ========== BADGES (-subtle used in about, etc.) ========== */
.bg-primary-subtle { background: rgba(22, 163, 74, 0.12) !important; color: var(--primary) !important; border: 1px solid rgba(22, 163, 74, 0.25); }
.bg-secondary-subtle { background: rgba(100, 116, 139, 0.12) !important; color: var(--gray, #64748b) !important; border: 1px solid rgba(100, 116, 139, 0.2); }
.bg-success-subtle { background: rgba(22, 163, 74, 0.12) !important; color: var(--primary) !important; border: 1px solid rgba(22, 163, 74, 0.25); }
.bg-warning-subtle { background: rgba(234, 179, 8, 0.15) !important; color: #b45309 !important; border: 1px solid rgba(234, 179, 8, 0.3); }
.bg-info-subtle { background: rgba(14, 165, 233, 0.12) !important; color: #0284c7 !important; border: 1px solid rgba(14, 165, 233, 0.25); }

/* ========== ALERTS, BUTTONS, MODAL ========== */
.profile-page .alert-info {
  background: rgba(22, 163, 74, 0.08);
  color: var(--dark, #0f172a);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
}

.profile-page .btn-sm.btn-light {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  transition: all 0.25s;
}

.profile-page .btn-sm.btn-light:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Add Membership, Add Board Membership, Add Photo – brand green */
.profile-page .btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  border-radius: 10px;
}
.profile-page .btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}
.profile-page .btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
  border-radius: 10px;
}
.profile-page .btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

#dataRequestModal .modal-header.bg-primary { background: var(--primary) !important; border-bottom: none; }
#dataRequestModal .form-control {
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 10px;
}
#dataRequestModal .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
  outline: none;
}
#dataRequestModal .btn-primary { background: var(--primary); border-color: var(--primary); }
#dataRequestModal .btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.profile-page .text-primary { color: var(--primary) !important; }

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
  .profile-hero .profile-hero-inner { flex-direction: column; text-align: center; align-items: stretch; }
  .profile-hero-avatar { order: 1; }
  .profile-hero-meta-card { order: 2; max-width: 100%; align-self: center; }
  .profile-hero-body { order: 3; min-width: 100%; }
  .profile-hero-actions { justify-content: center; }
  .profile-hero .avatar-xl { width: 100px; height: 100px; }
  .profile-hero-name { font-size: 1.5rem; }
  .profile-hero-meta-card .hero-meta-item { align-items: center; }
  .hero-meta-row { justify-content: center; }
  .hero-meta-row.hero-meta-relationship { justify-content: center; }
}

@media (max-width: 768px) {
  .profile-hero .avatar-xl { width: 88px; height: 88px; }
  .profile-hero-name { font-size: 1.35rem; }
  .profile-hero-meta-card .hero-meta-item { min-width: 60px; }
  .profile-hero-meta-card .hero-meta-value { font-size: 0.85rem; }
  .hero-relationship-badge { font-size: 0.9rem; padding: 0.4rem 1rem; }
  .hero-meta-card-inner { padding: 0.85rem 1rem; }
  .profile-about li { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .profile-about li span { min-width: auto; }
  .profile-about li strong { text-align: left; }
}

@media (max-width: 576px) {
  .profile-nav-pills .nav-link { padding: 0.5rem 0.85rem; font-size: 0.85rem; }
  .profile-hero-actions .btn { font-size: 0.8rem; padding: 0.4rem 0.7rem; }
  .profile-search-wrap { max-width: 100%; }
  .profile-filter-bar { flex-direction: column; align-items: stretch; }
  .profile-filter-bar .nav-pills { justify-content: center; }
  .profile-empty-title { font-size: 1.75rem; }
  .profile-empty-title-sm { font-size: 1.35rem; }
}

/* ========== ANIMATION ========== */
@keyframes profileFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.profile-page .profile-card { animation: profileFadeIn 0.4s ease-out; }
