/* ==========================================
   Profile Page
   ========================================== */
.profile-page {
  padding-bottom: var(--space-xl);
}

.profile-route-shell {
  padding-top: var(--space-xl);
}

.profile-page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.profile-header {
  background: linear-gradient(150deg, var(--primary-green) 0%, var(--primary-green-light) 60%, #054e44 100%);
  padding: var(--space-xl) 0;
  padding-top: calc(var(--space-xl) + 20px);
  padding-bottom: var(--space-2xl);
  color: var(--white);
}

.profile-cover {
  position: relative;
  text-align: center;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  background: var(--white);
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-green);
  border: 4px solid var(--white);
  overflow: hidden;
}

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

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.profile-username {
  opacity: 0.8;
  margin-bottom: var(--space-sm);
}

.profile-bio {
  max-width: 640px;
  margin: 0 auto var(--space-md);
  line-height: 1.9;
  color: rgba(255,255,255,0.92);
}

.profile-location {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: rgba(255,255,255,0.2);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  margin-bottom: var(--space-lg);
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
}

.profile-stat {
  text-align: center;
}

.profile-stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
}

.profile-stat-label {
  font-size: 0.8rem;
  opacity: 0.8;
}

.profile-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.profile-content {
  padding: var(--space-lg) 0;
  margin-top: -28px;
  border-radius: 28px 28px 0 0;
  background: var(--off-white);
  position: relative;
  z-index: 1;
}

.profile-edit-card {
  background: var(--white);
  border: 1px solid rgba(0, 38, 35, 0.06);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: var(--space-lg);
}

.profile-edit-head {
  margin-bottom: var(--space-lg);
}

.profile-edit-title {
  color: var(--dark-gray);
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.profile-edit-subtitle {
  color: var(--text-gray);
  line-height: 1.8;
}

.profile-edit-hint {
  color: var(--text-gray);
  font-size: 0.85rem;
  margin-top: 8px;
}

.profile-avatar-picker {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px;
  border: 1px dashed rgba(0, 38, 35, 0.16);
  border-radius: 20px;
  background: var(--off-white);
}

.profile-avatar-picker-preview {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-green);
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.profile-avatar-picker-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-picker-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.profile-avatar-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.profile-edit-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
}

.profile-danger-zone {
  background: #fff7f8;
  border: 1px solid rgba(107, 31, 42, 0.2);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: var(--space-lg);
}

.profile-danger-zone-head {
  margin-bottom: 8px;
}

.profile-danger-zone-title {
  color: var(--accent-red);
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.profile-danger-zone-subtitle {
  color: #7a2a34;
  font-size: 0.9rem;
}

.profile-danger-zone-warning {
  color: #52232b;
  line-height: 1.9;
  margin-bottom: var(--space-md);
}

.profile-delete-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 var(--space-md);
  color: #4a2028;
  font-weight: 500;
}

.profile-delete-confirm input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.profile-danger-zone-actions {
  display: flex;
  justify-content: flex-start;
}

.profile-delete-widget-overlay {
  z-index: 260;
}

.profile-delete-widget-modal {
  max-width: 560px;
}

.profile-delete-widget-warning {
  color: #52232b;
  line-height: 1.9;
  margin-bottom: var(--space-md);
}

.profile-relations-list {
  display: grid;
  gap: var(--space-md);
}

.profile-relation-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 18px;
  background: var(--white);
  border: 1px solid rgba(0, 38, 35, 0.06);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.profile-relation-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
}

.profile-relation-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-relation-name {
  color: var(--dark-gray);
  font-weight: 700;
}

.profile-relation-meta {
  color: var(--text-gray);
  font-size: 0.9rem;
}

.profile-relation-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.profile-tabs {
  display: flex;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-xs);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.profile-tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--text-gray);
  transition: all var(--transition-fast);
}

.profile-tab.active {
  background: var(--primary-green);
  color: var(--white);
}
